Category "dart"

Flutter: Generating routes with auto_route using a Class with named constructors instead of default constructor

I am trying to generate the router.gr.dart file using the auto_route package in flutter. My class has 3 named constructors: ProfilePage.a({ Key? key,

Convert arabic number to english number & the reverse in Dart

I want to replace Arabic number with English number. 1-2-3-4-5-6-7-8-9 <== ١-٢-٣-٤-٥-٦-٧-٨-٩

The method "collection" isn't defined for the type FirebaseStorage

I'm getting an error trying to store data in firestore. Another issue is using my emulator in android studio ( pixel 5 ) or even all my 4 connected devices. I c

The method 'get' isn't defined for the type 'AppState'. pics with Flutter

Hello everyone. I was studying "Dart and Flutter: The Complete Developer's Guide" on Udemy. And this error showed up, I have no idea how to fix this error. Ever

Flutter - How to save recorded audio file?

I am using flutter_sound to record voice(audio). I can't see any file save on the emulator after the recording stops. Recorder class: import 'package:flutter/ma

How to Disable ReorderableListView Reorder capability but still allow scrolling?

How do we deactivate the ReorderableListView dragging/reordering capabilities in Flutter? I would like to disable the dragging function but still allow scrollin

The state of flutter bloc is not updating if called outside the bloc builder

I initialised all necessary blocs in my main file. Even after this, the state of bloc is not updating if called from outside the bloc builder. I am trying to im

How to open existing flutter project from Xcode?

I have an existing flutter project, which coded with VS Code. Now I want to open it from Xcode to do some configurations in Runner.xcworkspace. But it was unab

How to delete a specific array element in firebase collection?

I have list of appointments stored in firebase collection, how can I delete a specific appointment ?

How to update data and restart the timer on click?

I have data in the application and the exchange rate is updated by a timer every 5 seconds. How can I make it so that when a floatingButton is clicked, the data

How to refresh snapshot in flutter

I what to refresh home page so I create widget called RefreshWidget look like this import 'dart:io'; import 'package:flutter/cupertino.dart';

Flutter won't compile a release build of my app?

After working on this app I tried to build my app to iOS using the flutter run --release command. But whenever I do I get this error *Could not build the precom

I want to change my app name to S&S in flutter ios in info.plist but i am getting error

I want to use "&" in app name for ios. what's method . i want to change name in CFBundleName tag in info.plist file of flutter. i am getting error while com

Parse long String of coords into lat & longs Flutter

I receive a String of Lats & Longs from an API call in Json "lineStrings": [ "[[[-0.301457,51.515017],[-0.288265,51.51014],[-0.280462,51.503057],[-0

Flutter - type 'Future<dynamic>' is not a subtype of type 'List<Map<String, dynamic>>'

I am using mysql1: ^0.19.2 and trying to fetch some data from a database to display in a select_form_field (select_form_field: "^2.2.0"). The database table I'm

Expected a value of type 'Map<String, dynamic>', but got one of type 'Null'

I'm using flutter and managing data by cloud_firestore. I could send data to firestore, but now I'm Struggling with reading data. In firestore, data are stored

Error: Expected a value of type 'int', but got one of type 'String'

screenshoot Error: Expected a value of type 'int', but got one of type 'String' at Object.throw_ [as throw] (http://localhost:50026/dart_sdk.js:5405:11) at Obje

Dart equivalent of Apache Commons Collections Bag

Is there a collection in Dart that allows storing multiple items along with their repetition count? For instance, such a collection is in Apache Commons Collect

Is there a way of assigning a future variable to another variable without returning null in dart?

I was trying to pass a data to a variable that returns future but it returns out to be null even though I'm using async and await. what is I'm missing here ? im

Can required parameters in a Dart constructor be named?

I am working with some Dart code for a Flutter/Dart class I'm taking. I expected the following code to compile, but it did not: class Person { String? name;