flutter-dependencies

Get updated State outside a Widget tree with Redux

耗尽温柔 提交于 2021-02-11 12:23:13
问题 Is it possible to get an up-to-date state from the Store outside the Widget tree? In Provider, you can easily do that by calling Provider like this and the state will update if there is any change. Provider.of<WelcomeBloc>(context) But when I call: StoreProvider.of<AppState>(context).state.currentPage; I just get the current state but it doesn't update on changes (or I am doing something wrong there) In that case, I need to use that call in a block which updates on changes... what in my

Flutter - How to ensure the switch is on even after clicking on the back button?

自闭症网瘾萝莉.ら 提交于 2021-02-10 06:33:14
问题 I have a settings menu with 8 listTiles and If I turn on one of the switches, the issue is - when I click on the back button and click on the settings menu again, the switch is turned off ... what would I have to add to make sure the switch is on even if the back button is clicked? After this- what ever switch is turned on that's the color image I want to display in another class ..... that is why I need to ensure only one switch is on at one time, and that once the user clicks the back

ListTile OnTap is working when I use ListView. But when i use ListWheelScrollView it doesnt work

我只是一个虾纸丫 提交于 2021-02-09 11:11:52
问题 ListTile OnTap is working when I use ListView. But when i use ListWheelScrollView it doesn't work. I mean it doesn't get tapped. The view changes. But i can't seem to tap it. I looked for the solution in a lot of places and links but still couldn't find the solutions. These are the code I did. @override Widget build(BuildContext context) { return new ListWheelScrollView( physics:FixedExtentScrollPhysics(), children: getPostList(), itemExtent: 100.0, ); } List<PostListItem> getPostList() {

ListTile OnTap is working when I use ListView. But when i use ListWheelScrollView it doesnt work

我怕爱的太早我们不能终老 提交于 2021-02-09 11:07:08
问题 ListTile OnTap is working when I use ListView. But when i use ListWheelScrollView it doesn't work. I mean it doesn't get tapped. The view changes. But i can't seem to tap it. I looked for the solution in a lot of places and links but still couldn't find the solutions. These are the code I did. @override Widget build(BuildContext context) { return new ListWheelScrollView( physics:FixedExtentScrollPhysics(), children: getPostList(), itemExtent: 100.0, ); } List<PostListItem> getPostList() {

ListTile OnTap is working when I use ListView. But when i use ListWheelScrollView it doesnt work

陌路散爱 提交于 2021-02-09 11:06:53
问题 ListTile OnTap is working when I use ListView. But when i use ListWheelScrollView it doesn't work. I mean it doesn't get tapped. The view changes. But i can't seem to tap it. I looked for the solution in a lot of places and links but still couldn't find the solutions. These are the code I did. @override Widget build(BuildContext context) { return new ListWheelScrollView( physics:FixedExtentScrollPhysics(), children: getPostList(), itemExtent: 100.0, ); } List<PostListItem> getPostList() {

How Use shared preference with injectable and get_it in flutter?

江枫思渺然 提交于 2021-02-09 08:59:12
问题 im using injectable and get_it package in flutter i have a shared preference class : @LazySingleton() class SharedPref { final String _token = 'token'; SharedPreferences _pref; SharedPref(this._pref); Future<String> getToken() async { return _pref.getString(_token) ?? ''; } Future<void> setToken(String token) async { await _pref.setString(_token, token); } } this class inject as LazySingleton and i have a module for inject the shared preference : @module abstract class InjectableModule {

Implementing MQTT in Flutter

倖福魔咒の 提交于 2021-02-07 07:19:43
问题 I am new to Flutter (coming from Android background) and want to implement MQTT client in flutter. This is what i want: MQTT client which should be "alive" when the app is open/not killed by OS. I don't want to run it in background (without the app open, i know there is issue doing it in iOS, read it somewhere) but while the app is open. Updating UI/State based on messages coming in subscribed topics. I looked into pub and found 2 packages, mqtt and mqtt_client, they look like non-Flutter

How can I use multiple order by in real time database flutter to order data by specific field? [duplicate]

我的未来我决定 提交于 2021-01-29 17:31:13
问题 This question already has answers here : Query based on multiple where clauses in Firebase (6 answers) Closed 20 days ago . I am trying to short "realtime database" result according to "date" in flutter . But I cant use multiple orderByChild('child_name') . It throw an error. My code is final String path = 'jsondata'; final _dbRef = FirebaseDatabase.instance.reference(); _dbRef.child(path) .orderByChild('trade_code').equalTo('GP') .once() .then((DataSnapshot snapshot) { snapshot.value.forEach

Flutter Mailer isn't working due to these errors

丶灬走出姿态 提交于 2021-01-29 13:30:28
问题 I am trying to send a form from flutter app to my email automatically when the user submit the form. here's the code : import 'package:flutter/material.dart'; import 'dart:async'; import 'dart:convert'; import 'package:url_launcher/url_launcher.dart'; import 'package:mailer/mailer.dart'; import 'package:mailer/smtp_server.dart'; import 'package:http/http.dart' as http; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_speed_dial/flutter_speed_dial.dart

Attempt to execute code removed by Dart AOT compiler (TFA), how to troubleshoot this issue

馋奶兔 提交于 2021-01-29 13:01:04
问题 I see this error once I install the release apk - "Attempt to execute code removed by Dart AOT compiler (TFA)" on the Material Widget. How do I resolve this? I used charts_flutter: ^0.6.0 to implement some charts in my flutter project then tested the project using the "flutter run" command. It was running fine. After completing my project I generated a Release APK with the command "flutter build apk --release". Now I see this error once I install the release apk - "Attempt to execute code