Category "dart"

How do you round a double in Dart to a given degree of precision AFTER the decimal point?

Given a double, I want to round it to a given number of points of precision after the decimal point, similar to PHP's round() function. The closest thing I can

Flutter, Freezed: Set Class as default value

I have a User class which contains a Purchase class. I want to make it non-nullable, but not required. So this means that I would need to set a default value. I

How to build an app locker application using flutter

I want to create an app which allows to put lock on the other apps that are to be protected in the device. This app lock will start automatically before opening

Where to set the path to the protoc to import standards Protocol Buffers

Where need I to set the path to the protoc to get import standards Protocol Buffers (protobuf), like empty.proto and timestamp.proto in Windows and Dart? When

Invalid characters while converting API response to PDF

I used the following syntax for my GET request var response = await http.get(Uri.parse(url), headers: { "Content-Type": "application/pdf", 'Authorizatio

Flutter doctor error -cmdline tools component missing and Android sdkmanager tool not found. Windows

I'm trying to setup an android emulator but I don't have intel. I've been through so many similar pages but none have given me an answer on why I can't get my f

Error in using table_calendar: ^3.0.5 dependency in flutter

I get this error in my code where I used a table_calendar dependency. Here is my code where I implemented the calendar. import 'package:fitr/reusable_widgets/bo

Why im getting this error Warning: Operand of null-aware operation '??' has type 'Color' which excludes null

Im using this package flutter_datetime_picker: ^1.5.1 And this is my code String _date = "Please pick Age"; Widget _buildage() { return Column(crossAxis

Dart/Flutter How to compare two TimeOfDay times?

TimeOfDay documentation has no comparison operator and primitive comparison does not work. My only solution that I can thinking of right now is to convert TimeO

How to display a dynamic map using Tabs and SliverGrid

I have a Model called service provider that contains a the following data: class ServiceProvider { final String logoUrl; final int lowerPrice; final

How to display notifications on windows using flutter?

I want to show notifications on windows using Flutter. But I'm unable to do so. I've tried packages like deskkop_notifications and flutter_local_notifications.

Dart "--no-sound-null-safety" flag not working

I am trying to run a dart file without null safety using the command line. The file is: sandbox.dart void main() { String a; print(a); } I then run the

Dart "--no-sound-null-safety" flag not working

I am trying to run a dart file without null safety using the command line. The file is: sandbox.dart void main() { String a; print(a); } I then run the

How to retain the state of the app when navigating to another screen in flutter using riverpod

Good day, guys I'm new to using Riverpod, I have a counter app that when the FAB button is tapped it increases the counter by 1. This works well using Riverpod

How to make toMap and fromMap method for Enums class dart flutter?

I used an enum variable in a class. Now I want to implement the toMap and fromMap methods for the class. enter code here enum ColorNumber { inc, dec, none }

flutter onClick delete image from firebase storage and firestore

I need on click delete image from firebase storage and firestore I've written this code that does the delete from firestore only. onLongPress: ()async{ await

How to read and write a text file in Flutter

How do you read text from a file and write text to a file? I've been learning about how to read and write text to and from a file. I found another question abo

Error: Try adding an initializer expression, or add a field initializer in this constructor, or mark it 'late'

void main() { Car c1 = new Car('E1001'); } class Car { String engine; Car(String engine) { this.engine = engine; print("The engine is : ${engine}

Flutter - remove a firebase document onTap()

I have a ListView, filled with Firebase collection as chat messages. When the user long press a ListTile (an item on the list), I show a BottomSheet. When the

Set height of DropdownButtonFormField list

In Flutter, DropdownButtonFormField's modal list keeps growing to fill some height limit that seems to be ~90% of the screen (or possibly, and more likely, the