Category "dart"

Flutter - FutureBuilder fires twice on hot reload

In my flutter project when I start the project in the simulator everything works fine and the future builder only fires once, but when I do hot reload the Futur

pull down to REFRESH in Flutter

My dashboard code looks like this, Here I am doing get req in getReport method, I have added the RefreshIndicator in the code which when pulled down inside cont

ERROR: The GPU does not support this version of OpenGL ES, try an older version in flutter

I/Adreno (21484): ERROR: The GPU does not support this version of OpenGL ES, try an older version D/skia (21484): Shader compilation error D/skia

Error on trying to jsonDecode String in Flutter application

When I try to decode a json String: [{"device-mac":"C9BF2EB47C17","on":true}] with the following function the error: I/flutter ( 8954): type 'List' is not a su

In Dart, how to verify a void method that does not throw exception in unit tests?

I am implementing some data verification library in Dart. The validating method has void return type and throws exceptions on errors. The code below shows an ex

codeUnits property vs utf8.encode function in Dart

I have this little code: void main(List<String> args) { const data = 'amigo+/=:chesu'; var encoded = base64Encode(utf8.encode(data)); var encoded2 =

The difference between the use of constructor " className() and className._()

I have these two ways to write a constructor. className() and className._() What is the difference between them and when should I use which? class GlobalStat

how to access flutter bloc in the initState method?

In the code shown below , the dispatch event is called from within the build method after getting the BuildContext object. What if I wish to do is to dispatch a

codeUnits property vs utf8.encode function in Dart

I have this little code: void main(List<String> args) { const data = 'amigo+/=:chesu'; var encoded = base64Encode(utf8.encode(data)); var encoded2 =

How to make background image to be fixed in flutter

I'm using an image as a background, and it looks good until I use the keyboard, how to solve that? before the keyboard is shown and that's after the keyboard is

Best practices to change app state from a package

I'm developing a standalone package which is currently inside an app like this: app/packages/my_package I created the package with the create command package te

Dart 'the constructor being called isn't a const constructor' when using FlexibleSpaceBar background property

When using the FlexibleSpaceBar widget in flutter I am unable to set the background property. According to the docs it's supposed to be a Widget. From the docs

Dart support for using Script Property Values in Regular Expressions

The Unicode regular expression documentation describes doing complex matches for text. Specifically, I am wondering about matching various scripts within a stri

How to make 2 FutureBuilders wait on the same Future in Flutter?

I have a Future which, when complete, adds some data to a ChangeNotifierProvider. Then I use the data in the ChangeNotifierProvider to populate some ListViews.

How to play Music (mp3, m4a etc) from Google Drive in Flutter

I want to play Music Files like mp3, m4a files from Google Drive in Flutter. So far, I'm able to fetch the link of files in my google drive Assets I'm using ass

Flutter : Handling error Dio Package (404,400 etc)

I'm learn searching data by ID with package DIO https://pub.dev/packages/dio, my problem is every time I'm type wrong keyword search, the app suddenly crash wit

Flutter auto_router: Error: Type 'NavigatorState' not found

Problem summary Hi, I have an issue getting the auto_route package up and running in a Flutter project. Following the official documentation, I have done the fo

How To Prevent Navigation Loops In Flutter

In my application I have 13 screens in total, some of them has links to other screens, I also have a drawer that has links to most of these screens. The followi

How to increase slider track width in flutter

In SliderThemeData trackheight is given but I want to increase the track's width. Here is my current code: SliderTheme( data: SliderThemeData( tra

Flutter - drawAtlas circular cutout

I'm trying to implement a circular cutout of an image and I am using drawAtlas for it. Here is my implementation so far: canvas.drawAtlas( image!, [ /*