Category "dart"

Mongo Dart SubDocument Updating and Editing

Hello I have a data like that: { "_id":ObjectID(), "field1":"field1 value", "group1":{ {"name": "name1", "favoriteBooks":{"book1","book2"}}, {"name": "name

LateError (LateInitializationError: Field 'documentSnapshot' has not been initialized)

I am using Cloud Firestore in my Flutter application and I am facing this issue in app: LateError (LateInitializationError: Field 'documentSnapshot' has not bee

How to use more than just if/else in ternary operator?

I am having trouble with writing the right syntax for this ternary operator. I want to put like three 'if statements' and one 'else statement'. But as far as I

Preload network images to avoid load times

I'd like to add and remove items on top of each on the press of a button to avoid load times for network images. My idea is to add ~5 images to a Stack on top o

Flutter Firebase Realtime Database write/update to multiple nodes at once

I'm using Firebase as the backend to my Flutter project. I need to write to multiple nodes in one transaction. Now I have: await (_firebaseDatabase .ref

How to change Status Bar and App Bar color in Flutter?

I'm trying to change the color of the system status bar to black. The configuration seems to be overridden by the AppBar class. I can achieve what I want by ass

How do I convert a date/time string to a DateTime object in Dart?

Say I have a string "1974-03-20 00:00:00.000" It is created using DateTime.now(), how do I convert the string back to a DateTime object?

What is the use of constant values in dart?

As described in the documentations: The const keyword isn’t just for declaring constant variables. You can also use it to create constant values, as w

How To Create Folder in Local Storage/External Flutter?

import 'package:path_provider/path_provider.dart'; import 'dart:io'; void createAppFolder() async { final directory = await getExternalStorageDi

Can't build a flutter project with PathProvider dependency

Disclaimer: First of all, this is my early attempt to play with Flutter. So forgive me if is a noob question. I had been playing with an MVP-Clean architecture

Stringbuffer access by index or range

TLDR: I am looking for a datastructure with the properties of a string buffer that I can access by index in dart. Long version: I need the properties of Stringb

Stringbuffer access by index or range

TLDR: I am looking for a datastructure with the properties of a string buffer that I can access by index in dart. Long version: I need the properties of Stringb

Unhandled Exception: DioError PONSE]: Http status error [500]

I made FormData use the dio package to upload images to the database, but my compilation was running "flutter run", an error appeared. After I see the error th

How to replace the bundled Dart SDK in Flutter to run natively on Apple Silicon (ARM64)?

Dart SDK officially supports ARM64 and as of now, 2.14.2 is the latest (stable) Dart SDK that has support for ARM64. Though it was the same version that was bun

Initialize Dio with persistent cookie at the start of the program

I'm using Dio in my app and I want it to save cookies. It turns out I have to download three additional packages to do that: cookie_jar, dio_cookie_manager and

flutter: how to change current date and time from my app

Flutter or kotlin or Java: How to change the current device date and time from my app. without going to device settings. My phone time is now 6:45 and I want to

How to get click and change debug text to dev top right corner red debug banner?

I'm trying to change the name of that banner "debug" to "dev", "stage", "prod". programmatically I want to do some action on the click of that debug banner. I

flutter-how to download file with inappwebview

I want to use inappwebview to download files on a website, but when I try the code available at https://blog.codemagic.io/inappwebview-the-real-power-of-webview

How to remove an animation in Flutter?

I would like to remove an animation and just print the result but I don't know how to remove the animation from this result Here is where the result is: onPress

Text label that explains what a certain button in the app would do

I need to create a text label component that will act as an in-app tutorial explanatory label in Flutter. This text label should show up above a button explaini