Flutter

Flutter GmailApi throws exception Object.noSuchMethod

我只是一个虾纸丫 提交于 2021-01-29 11:34:52
问题 I am trying to create a app which reads messages from Gmail and process them. I was able to achieve that in kotlin using GoogleAccountCredential and Gmail.Build APIs. But I am trying to do the same in Flutter, but no success so far. I have used https://pub.dartlang.org/packages/google_sign_in to sign in, and then create a HTTPClient similar to one mentioned in this post: How to use Google API in flutter? Then used that client to create GmailApi : https://github.com/dart-lang/googleapis/blob

How to get the size of a directory including its files

*爱你&永不变心* 提交于 2021-01-29 11:33:05
问题 I want to get the total size of a directory in flutter, including its files , files in its sub-folders and so on. I tried to use Directory.statSync , but it seems to only return the meta size of the directory itself. Should I recursively walk the directory to calculate the size? If so, is there a dart package that already does that (I can't find one)? If not, what more efficient way is available? 回答1: This is a example walk a directory recursively (sync version). Async version can be done

How to solve Exception Error: FirebaseApp with name [DEFAULT] doesn't exist?

喜你入骨 提交于 2021-01-29 11:24:54
问题 Here is where the exception is happening: @override Future<FirebaseUser> getCurrentUser() async { FirebaseUser user = await _firebaseAuth.currentUser(); return user; } The exact error is: Exception has occurred. PlatformException (PlatformException(error, FirebaseApp with name [DEFAULT] doesn't exist. , null)) My Flutter Doctor Output: [flutter] flutter doctor -v [√] Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.17763.914], locale en-US) • Flutter version 1.12

error: The argument type '(int) → dynamic' can't be assigned to the parameter type '(String) → void'

爷,独闯天下 提交于 2021-01-29 11:24:12
问题 I have some fields which post String and int , the String fields are working properly and I am getting these values at the db, the at the int type fields I'm getting this error message. The argument type '(int) → dynamic' can't be assigned to the parameter type '(String) → void'. I'm using bloc to post to a firebase db. here is how it looks. Widget build(BuildContext context) { final trackerBloc = Provider.of<TrackerBloc>(context); String docId = DateTime.now().millisecondsSinceEpoch.toString

how to create horizontally scrollable vertical listview in Flutter?

时光总嘲笑我的痴心妄想 提交于 2021-01-29 11:22:33
问题 i want to create a list view on Flutter which can be scrolled vertically as well as horizontally. Like in android we can build a recycler view over a horizontal scroll view then it allows us to scroll vertically as well as horizontally. Is there any solution for Flutter to behave same. I have tried nestedScroll view, customscroll view, nested Listview and was not able to achieve what i wanted. If list view cannot do this please suggest any other widget with this property. Please anybody help

A RenderFlex overflowed by 40 pixels on the bottom problem

爷,独闯天下 提交于 2021-01-29 11:13:53
问题 Another exception was thrown: A RenderFlex overflowed by 40 pixels on the bottom. I am getting this error. Please someone help me. I am new in flutter. I did change lots of things on the code but still couldn't change the result. import 'package:flutter/material.dart'; import 'package:estilo/pages/cart.dart'; class Cart_products extends StatefulWidget { @override _Cart_productsState createState() => _Cart_productsState(); } class _Cart_productsState extends State<Cart_products> { var Products

Unable to load asset (file the app created)

﹥>﹥吖頭↗ 提交于 2021-01-29 11:10:11
问题 Why does this cause a crash? final directory = await getApplicationDocumentsDirectory(); final testFile = File("${directory.path}/test.txt"); await testFile.writeAsString("Hello there!", flush: true); final ByteData bytes = await rootBundle.load(testFile.path); The rootBundle.load() call causes: Unhandled Exception: Unable to load asset: /data/user/0/com.flutter.tests/app_flutter/test.txt BUT if I do a hot reload then it works fine until I restart the app. I have a dependency path_provider:

How can i make a new stream of other streams returning a list of all the values emitted (bloc pattern)?

别来无恙 提交于 2021-01-29 10:40:15
问题 I have three streams like this: final _light1RoomCtlr = BehaviorSubject<String>(); final _light2RoomCtlr = BehaviorSubject<String>(); final _light3RoomCtlr = BehaviorSubject<String>(); Stream<String> get getLight1Room => _light1RoomCtlr.stream; Function(String) get setLight1Room => _light1RoomCtlr.sink.add; Stream<String> get getLight2Room => _light2RoomCtlr.stream; Function(String) get setLight2Room => _light2RoomCtlr.sink.add; Stream<String> get getLight3Room => _light3RoomCtlr.stream;

Dynamically update keyboardType in Flutter

我的梦境 提交于 2021-01-29 10:14:16
问题 I have a search TextFied and a Tabbar allowing to search by a number or a text. When the TabBar is Fired/Tapped the keyboard type should be updated. The listener allowing to detect the type is correctly fired The build method is fired and the Textfield is rebuild with the keyboardType But the keyboard type is not updated _handleTabSelection() { if (_tabController.indexIsChanging) { switch (_tabController.index) { case kNameIndex: _searchBy = RunnersSubscriptionsSearchBy.name; _keyboardType =

Closure call with mismatched arguments: function '_myListView.functionOne'

无人久伴 提交于 2021-01-29 10:12:55
问题 I don't know why this error is appearing in the console box. everything appears fine but still this below appears Closure call with mismatched arguments: function '_myListView.functionOne' Receiver: Closure: () => Null Tried calling: _myListView.functionOne(Instance of 'SliverMultiBoxAdaptorElement') Found: _myListView.functionOne() => Null HERE IS MY CODE FOR LISTVIEW import 'package:flutter/material.dart'; import 'package:linear_gradient/linear_gradient.dart'; import 'package:gradient_text