What do you want to save?
Add Code snippet
New code examples in category Dart
-
Phoenix Logan 2022-03-02 14:05:43
flutter close app programmatically
SystemNavigator.pop() Add solution -
A-312 2022-02-28 03:40:01
when i type string in textediter in flutter it shows intger
Repository().placeAddApiProvider(_section_id.text as int) but it is not work show me this error: Unhandled Exception: type 'String' is not a subtype of type 'int' in type cast E/flutter ( 6950): #0 AddPlaceState.build.<anonymous closure> (pac... Add solution -
Awgiedawgie 2022-02-27 23:25:04
flutter futurebuilder future called twice
The future is firing again because you're creating it in the build method at the same time as the FutureBuilder. From the FutureBuilder docs: The future must have been obtained earlier, e.g. during State.initState Add solution -
Awgiedawgie 2022-02-27 16:40:02
type '_InternalLinkedHashMap<DateTime, int>' is not a subtype of type 'Map<DateTime, double>'
Future<List<Map<String, dynamic>>> fetch() async { http.Response response = await http.get('http://10.0.2.2:8000/api/membres'); if (response.statusCode != 200) return null; return List<Map<String, dynamic>>.from(json.de... Add solution -
Awgiedawgie 2022-02-27 07:15:35
Try using 'as prefix' for one of the import directives, or hiding the name from all but one of the imports.dartambiguous_import
import 'package:permission_handler/permission_handler.dart' as ph; // then use the alias // ... if (await ph.Permission.locationWhenInUse.serviceStatus.isDisabled || await ph.Permission.speech.isPermanentlyDenied) { await ph.openAppSettings(); } // (...) Add solution -
A-312 2022-02-26 21:35:02
dart null aware operators
int minVal = (a < b) ? a : b; // if(a < b) {minVal = a;} else {minVal = b;} var x = y ?? z; // assign y to x if y is not null, else z var x ??= y; // assign y to x only if x is null myObject?.myProp // (myObject != null) ? myObject.m... Add solution -