dart

how to fix E/flutter (15862): Unhandled Exception: Bad state: No element when push data to firebase in flutter?

亡梦爱人 提交于 2021-02-11 13:50:30
问题 i trying to send data to firebase i did every thing this my code my code the modal import 'package:firebase_database/firebase_database.dart'; class Student { String _id; String _name; String _age; String _city; String _department; String _description; Student(this._id, this._name, this._age, this._city, this._department, this._description); Student.map(dynamic obj) { this._id = obj['id']; this._name = obj['name']; this._age = obj['age']; this._city = obj['city']; this._department = obj[

flutter: 加载与运行Dart

半腔热情 提交于 2021-02-11 13:17:45
环境: flutter sdk v1.7.8+hotfix.3 @stable 对应 flutter engine: 54ad777fd29b031b87c7a68a6637fb48c0932862 在建立异步线程与消息循环之后,自然就是运行应用脚本,也就是dart文件。这一部分感觉很庞大而且千头万绪:对dart不同模式的编译,不同参数的配置,从代码看还有热加载(hot reload)的机制,从里到外都是一团乱麻;有这种感觉只是因为不熟悉,刚刚接触陌生环境产生的畏惧,只要熟悉啥都不是事。所以先不贸然进入热加载之类的细节,以目前了解的通信与异步为基础,渐次深入对象关联关系为上。 在 FlutterActivityDelegate.onCreate 的最后容易发现一个比较重要的调用 runBundle ,深入的调用序列如下: FlutterActivity.onCreate FlutterActivityDelegate.onCreate FlutterActivityDelegate.runBundle FlutterView.runFromBundle FlutterView.preRun FlutterNativeView.runFromBundle FlutterNativeView.runFromBundleInternal FlutterJNI

Flutter & Dart

倖福魔咒の 提交于 2021-02-11 13:04:15
Flutter & Dart https://www.dartlang.org/install https://flutter.dev/ https://flutter.dev/docs/get-started/install/macos flutter_macos_v1.2.1-stable.zip & 464 MB https://storage.googleapis.com/flutter_infra/releases/stable/macos/flutter_macos_v1.2.1-stable.zip https://flutter.dev/docs/development/tools/sdk/archive https://flutter.dev/community/china https://flutter-io.cn/ https://codelabs.flutter-io.cn/ https://codelabs.flutter-io.cn/codelabs/first-flutter-app-pt1-cn/index.html#0 https://classroom.udacity.com/courses/ud905 https://flutter.dev/docs/get-started/install/macos#get-the-flutter-sdk

how to edit value at the child widget

对着背影说爱祢 提交于 2021-02-11 13:01:39
问题 i try to edit the value of the child widget, i can do it with StatefulWidget parent but i want to do it with StatelessWidget parent and without using global value class Homepage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( actions: <Widget>[ FlatButton(child: Text('addFile'), onPressed: () {}), FlatButton(child: Text('deleteFile'), onPressed: () {}) ], ), body: Child(), ); } } class Child extends StatefulWidget { @override

how to edit value at the child widget

徘徊边缘 提交于 2021-02-11 12:59:05
问题 i try to edit the value of the child widget, i can do it with StatefulWidget parent but i want to do it with StatelessWidget parent and without using global value class Homepage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( actions: <Widget>[ FlatButton(child: Text('addFile'), onPressed: () {}), FlatButton(child: Text('deleteFile'), onPressed: () {}) ], ), body: Child(), ); } } class Child extends StatefulWidget { @override

Flutter app crashes after using package path_provider, how do I fix it in flutter? [duplicate]

醉酒当歌 提交于 2021-02-11 12:58:07
问题 This question already has answers here : NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/Preconditions; (1 answer) Android 3.1.1 - Failed resolution of: Lcom/google/android/gms/common/internal/zzbq; (10 answers) java.lang.NoClassDefFoundError: Failed resolution Failed resolution of: Lcom/google/android/gms/common/internal/zzab; (4 answers) Closed 5 months ago . I've been trying to make an offline app using json for local storage in flutter. I've used a

Private and public routers in Flutter

左心房为你撑大大i 提交于 2021-02-11 12:51:22
问题 I am new in Flutter and my task is to divide path into public and private. For solution, this I used the suggested advice from Dima Rostopira answered Jul 28 '20 at 8:29 in this topic My main problem is that instead of the shown in the example: MyAuth.isUserLoggedIn I need to use an asynchronous function: Auth().isAuth() but example solution does not work with an asynchronous function. Can someone help solve this problem? ConditionalRouter.dart class ConditionalRouter extends MapMixin<String,

Private and public routers in Flutter

戏子无情 提交于 2021-02-11 12:50:57
问题 I am new in Flutter and my task is to divide path into public and private. For solution, this I used the suggested advice from Dima Rostopira answered Jul 28 '20 at 8:29 in this topic My main problem is that instead of the shown in the example: MyAuth.isUserLoggedIn I need to use an asynchronous function: Auth().isAuth() but example solution does not work with an asynchronous function. Can someone help solve this problem? ConditionalRouter.dart class ConditionalRouter extends MapMixin<String,

How do I catch an error in Flutter (`beacon_broadcast` library)? Conventional methods don't work for this library

两盒软妹~` 提交于 2021-02-11 12:41:21
问题 I am using a library called beacon_broadcast when I start the beacon broadcast, it outputs an error in the console, but I'm not able to catch it ( try , .catchError , and using .then doesn't work). Console Output: D/BeaconParser( 7318): Parsing beacon layout: blah_blah_blah D/BluetoothAdapter( 7318): isLeEnabled(): ON D/BluetoothAdapter( 7318): isLeEnabled(): ON E/BeaconTransmitter( 7318): Advertisement start failed, code: 2 Error code 2 means advertising slot not available. I do not think

How do I catch an error in Flutter (`beacon_broadcast` library)? Conventional methods don't work for this library

杀马特。学长 韩版系。学妹 提交于 2021-02-11 12:39:11
问题 I am using a library called beacon_broadcast when I start the beacon broadcast, it outputs an error in the console, but I'm not able to catch it ( try , .catchError , and using .then doesn't work). Console Output: D/BeaconParser( 7318): Parsing beacon layout: blah_blah_blah D/BluetoothAdapter( 7318): isLeEnabled(): ON D/BluetoothAdapter( 7318): isLeEnabled(): ON E/BeaconTransmitter( 7318): Advertisement start failed, code: 2 Error code 2 means advertising slot not available. I do not think