Category "dart"

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

How to print a message in the console between the times form 9.00 AM to 16.30 PM in Flutter?

I want to print a message in the console every hour between the times from 9.00 AM to 16.30 PM using flutter.

Flutter Webview two way communication with Javascript

I have an html file that I am loading in Flutter webview using flutter_webview_plugin. I am using evalJavascript to call function in my javascript code, meaning

Flutter: Add custom color to existing theme

I am using Flutters built-in themes like this: return MaterialApp( theme: ThemeData.light().copyWith( primaryColor: const Color(0xFF5E975

Converting DateTime to time ago in Dart/Flutter

The question is how to format a Dart DateTime as a string stating the time elapsed similar to the way you see times displayed on Stack Overflow. Is there any b

Flutter DataTable - Tap on row

I am using Flutter DataTables to display list of items in cart. Now I want to edit the quantity of any selected row. Is there a way to get the information of th

How to find IP address using multicast_dns in flutter/dart?

I am writing a flutter application. To make life easier for end users I decided to find services running on a Raspberry Pi. Avahi is running and working. I can

How to give Flutter SDK Path in Android Studio on Mac os, How to update Flutter SDK path in MACOS?

I have installed the Android studio and the plugin's DART,FLUTTER to kickstart the flutter but as i am not able to give path of sdk while creating my very first

How can I get the size of the Text widget in Flutter

I've painted a shape for the background of my content of Text. I want the background autoscale the Text, even the softWrap being true. So, I need to get the