dart

flutter error Invalid `Podfile` file: no implicit conversion of nil into String. ive searched through discussions but I cant seem to fix the issue

丶灬走出姿态 提交于 2021-02-07 13:43:33
问题 This is the error I am receiving. I tried flutter clean and changing the syntax of some lines but im new to dart and flutter so im not really sure. I reinstalled cocoa pods and ruby as well but Im receiving the same error. I also made sure to update ruby to the latest version. [!] Invalid `Podfile` file: no implicit conversion of nil into String. # from /Users/(name)/Downloads/Projects/doctor_consultation_app/ios/Podfile:57 # ------------------------------------------- # unless File.exist?

Datetime timezone deserialization

有些话、适合烂在心里 提交于 2021-02-07 13:41:39
问题 I've developed a Rest API for my app. It sends to the app dates in the following format 2018-09-07T17:29:12+02:00 , where I guess +2:00 represents my timezone as part of one object. In my Flutter app, once I deserialize the received object, it substracts two hours to the actual received DateTime object. The class I'm trying to deserialize is defined as follows: import 'package:json_annotation/json_annotation.dart'; part 'evento.g.dart'; @JsonSerializable(nullable: false) class Evento { final

Datetime timezone deserialization

回眸只為那壹抹淺笑 提交于 2021-02-07 13:41:20
问题 I've developed a Rest API for my app. It sends to the app dates in the following format 2018-09-07T17:29:12+02:00 , where I guess +2:00 represents my timezone as part of one object. In my Flutter app, once I deserialize the received object, it substracts two hours to the actual received DateTime object. The class I'm trying to deserialize is defined as follows: import 'package:json_annotation/json_annotation.dart'; part 'evento.g.dart'; @JsonSerializable(nullable: false) class Evento { final

Extending the List<T> class [duplicate]

隐身守侯 提交于 2021-02-07 13:38:54
问题 This question already has answers here : How do I extend a List in Dart? (5 answers) Closed 6 years ago . Is it possible to extend a generic list with my my own specific list. Something like: class Tweets<Tweet> extends List<T> And how would a constructor look like, if I wanted to construct with my own constructor: Datasource datasource = new Datasource('http://search.twitter.com/search.json'); Tweets tweets = new Tweets<Tweet>(datasource); And how to call the parent constructor then, as this

Extending the List<T> class [duplicate]

血红的双手。 提交于 2021-02-07 13:38:36
问题 This question already has answers here : How do I extend a List in Dart? (5 answers) Closed 6 years ago . Is it possible to extend a generic list with my my own specific list. Something like: class Tweets<Tweet> extends List<T> And how would a constructor look like, if I wanted to construct with my own constructor: Datasource datasource = new Datasource('http://search.twitter.com/search.json'); Tweets tweets = new Tweets<Tweet>(datasource); And how to call the parent constructor then, as this

Why is map not working but foreach is?

隐身守侯 提交于 2021-02-07 13:35:51
问题 This forEach works just fine var newMarkers = new List<Marker>(); providers.forEach((p) { var marker = markerFrom(p); newMarkers.add(marker); print("got one"); }); _markers = newMarkers; but this map doesn't ever get called when placed in the exact same place as the forEach : _markers = providers.map((p) => markerFrom(p)); Additionally, this is the markerFrom method: Marker markerFrom(FoodProvider provider) { var marker = new Marker(new MarkerOptions() ..map = _map ..position = new LatLng

Flutter How to refresh StreamBuilder?

放肆的年华 提交于 2021-02-07 13:34:27
问题 Consider the following code: StreamBuilder<QuerySnapshot> _createDataStream(){ return StreamBuilder<QuerySnapshot>( stream: Firestore.instance.collection("data").limit.(_myLimit).snapshots(), builder: (context, snapshot){ return Text(_myLimit.toString); } ); } I want that the StreamBuilder refreshes when the _myLimit Variable changes. It's possible doing it like this: void _incrementLimit(){ setState(() =>_myLimit++); } My Question is if there is another, faster way, except the setState((){})

Flutter How to refresh StreamBuilder?

馋奶兔 提交于 2021-02-07 13:32:17
问题 Consider the following code: StreamBuilder<QuerySnapshot> _createDataStream(){ return StreamBuilder<QuerySnapshot>( stream: Firestore.instance.collection("data").limit.(_myLimit).snapshots(), builder: (context, snapshot){ return Text(_myLimit.toString); } ); } I want that the StreamBuilder refreshes when the _myLimit Variable changes. It's possible doing it like this: void _incrementLimit(){ setState(() =>_myLimit++); } My Question is if there is another, faster way, except the setState((){})

Add different routes/screens to Flutter app

别来无恙 提交于 2021-02-07 13:20:30
问题 I'm trying to add multiple screens to my flutter app but can't get it to work. And there are no tutorials/ guides to do this. Does anyone have an example on how to accomplish this. Thanks in advance. 回答1: You can use the Navigator It's use is demonstrated in the Stocks example in https://github.com/flutter/flutter/blob/c8447c91a93cdee28eddb01ee3ace27b9362220f/packages/flutter/test/widgets/navigator_test.dart Navigator.pushNamed(context, '/second'); ... onTap: () => Navigator.pop(context),

flutter: fcm ios push notifications doesn't work in release mode

浪尽此生 提交于 2021-02-07 13:00:55
问题 I have bound my flutter-iOS app to firebase and i'm also using firebase-messaging and cloud functions for sending notifications via subscribing to topics, i'm using the APNs push notifications key of apple developer account. when i use the option runner>flutter run main.dart in release mode to build my app on my phone, fcm notifications doesn't work anymore, while it works in development mode, anyone can help me fix this? this is my index.json code: const functions = require('firebase