Collect all kinds of flutter programming exceptions and fault solutions.

Lost connection to device in Flutter?

I'm facing a problem while using the plugins image_picker: "0.6.1+11" and
barcode_scan: "^1.0.0". Firstly I scan a barcode and then take a picture from the camera.
The problem is most of the tim...

Flutter: How to change color of showTimePicker widget

I would like to change the color of the showTimePicker. Here is my code
onTap: () {

Flutter calling screen

I want to add in-app (video) calling like Messenger (Facebook) does. It works when one party creates channel and another one joins.
But is there a way to create calling screen where party B can ac...

Using Flutter Provider means no StatefulWidgets?

I'm getting ready to write my first nontrivial app with Flutter and Provider. I've read up on how Provider facilitates immutable widgets (StatelessWidgets). My question is, is it always an antipatt...

Flutter: How to enable only certain dates in DatePicker

I have an array with certain dates.
I want to disable these dates in the date picker and also change the color. How to do this?

Keyboard appears automatically in flutter

how to implement this automatic appearance of key board without tapping the text field in flutter

How to get Dart and Flutter version within the app

How to log() the version of Dart and Flutter within the app?
String dartVersion = ?;
log("dart: $dartVersion");

Cannot access 'android.arch.lifecycle.LifecycleOwner' which is a supertype of ''

I create a new flutter project in android studio then "open project" the android part of it, I met
an error in MainActivity.kt however it builds successfully.
My class pathes are:
and finally my

Error: Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1

Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero
exit value 1
I have this problem on Android Studio.
Does anybody know how to fix this problem?

Allow Only lowercase with no space Input Textfield Flutter

So i am making a chat app and i want user to submit username which should not be uppercase and have space, i can accept the name and change it later in onchanged feature but i want user to know it as

How to display image with top and bottom gradient shadow in flutter?

I am working on flutter to display a image with top and bottom gradient overlay.
Some portion of image top and bottom should be display with shadow like covered by other color like gray.
Please f...

Flutter: Future.doWhile end timeout exception

I have problem with dosen't stop iteration in Future.doWhile after catch timeout error.
Below is code my example function:
Future<void> testFunction() async {
print(">>> start

Correct implementation of the Flutter in_app_purchase plugin for multiple consumables

I've followed tutorial on how to implement the in_app_purchase plugin as I am trying to implement purchases on consumable products in my app. I've had some success and am 95% of the way...

Flutter: How can I use DraggableScrollableActuator.reset AND the ScrollController from DraggableScrollableSheet for a nested list?

I am getting this error.
The following assertion was thrown building _InheritedResetNotifier(dirty):
flutter: ScrollController attached to multiple scroll views.
flutter: 'package:flutter/src/widg...

Change tab in TabBar using swipe in flutter

I want my tabs to change depending on the scrolling of the user, like in this post but in flutter: Change tab in tab bar controller using finger swipe

How to play Flutter assets audio one by one with different playback speeds?

I want to play audio files(.wav) stored in assets, one by one but flutter is playing them both together or the last audio.
Also all the audio files should have different playback speeds.
I have tri...

Visual Studio Code - Flutter : "Device emulator-5554 is offline"

I have just spent an hour reading through similar questions on Stack Overflow, and they are all for Android Studio, not Visual Studio Code. Also, I am doing Flutter development, so don't have acces...

Flutter count number of page view and show it

I want to implement the number of views feature in my application with flutter.
The feature is the same as StackOverflow question view counter: it's persisted.
I was thinking of firebase analytics ...

How to render SVG in Flutter Web?

My final goal is to convert Flutter mobile app to Flutter web app.
I used flutter_svg in Flutter mobile app but not working in Flutter web app.
What is the alternative plugin for Flutter web?
Here is

How to resolve an error: The sandbox is not in sync with the Podfile.lock

When I add new plugin in Flutter, I get this error in my runner xcode:
The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation
and I have already

Custom FlexibleSpaceBar Widget

I want that the title be under image and also be collaped with the image......
What I achieved
home: Scaffold(
body: CustomScrollView(
slivers: <Widget>[

how to find out which index of element is selected in dropdown flutter

i'm new in flutter i try to make an dropdownbutton ,and i wanna when user clicked on a item,send the index of that element to API
and here is my dropdown
DropdownButton<String> androidDropd...

Flutter code into APK/IPA file inside my flutter app

I need to compile on-the-fly (within a smartphone) a flutter code into APK/IPA file inside my flutter app.
How to do it?

Flutter - how to do i forward mapped data to another page

I have three files - companies.dart, Company_Card_Style.dart and Company_Details.
I'm mapping company parameters to company_card_Style from companies.dart, now i need to send the same data to

Error "The term 'unblock-file' is not recognized"

See this image and errors:
Please solve this error The term 'unblock-file is not recognized, it shows many errors. I browsed too much for it but I couldn't find a single answer working for me!

How to assign a variable to flutter Navigator.push(context, variable);

I tried to assign it a string
String variable = "'/branchHome'";
Navigator.push(context, variable);
but it doesn't work with the error
Error: The argument type 'String' can't be assigned...

Initializing riverpod Provider with a custom ChangeNotifier

I'm just trying out the new river_pod, flutter state management library. My goal here is simple. GestureDetector in the main page listens to vertical drags and updates the animation controller

How to edit an element from an array in flutter

I have been working on a to do list app in flutter and now I am trying to implement an edit function in which the user can select the element the user wants to edit and finally saving those changes...

RxDart BehaviorSubject confusion

I have been using RxDart along my Flutter projects for a while. However I find it confusing that defining a BehaviorSubject you can listen directly to the subject, and also to the subject's stream. I

What is my mistake with Flutter Provider Architecture, since it keeps rebuilding infinintly?

What am I mistaking with provider architecture?
My EntryPoint:
void main() {
providers: [
create: (

Strange Build error in Azure Devops while using flutter

I used this guide to make a build script on my azure

Only Static members can be initialised error in Flutter

I am trying to solve a code which was not written by me.I am new to flutter and having a hard time to understand it.
I have to call the MyHomePage widget and pass the page no. and an extension whic...

my function flutter run don't work it show me Permission non accordée like on screen shot

I execute that sudo chown root flutter/ but not solution.
I don't no if the error from gradle or
need help.
Launching lib/main.dart on SM A260G in debug mode...
Running Gradle ...

Flutter getting 'ActionFactory' isn't a type Error

after search many website to resolve this problem. i can't and when i try to run application i get this error:
Error: 'ActionFactory' isn't a type.
Map<LocalKey, ActionFactory> actions,

Flutter Firebase listview with filters

I have created a listview in flutter which is pulling the data from firestore. Till here it works fine, but now I want to add some filters using dropdown which will filter the listview based on dro...

Display list of datas from sharedprefrence to text widget flutter?

I am saving some list of data to Sharedprefrence and tried to call the data from saved sharedprefrence and it returs all the values i have saved,then i tried to show data from sharedprefrence to a ...

Place Widgets adjacent to each other in Flutter

I have these two widgets:
Text('Completed Purchases'),
widget.user.profile.designation != ''
? SizedBox(
// width: widget.screenSize.size.

How to push a route from ChangeNotifier?

My question is quite simple: How do i initiate navigation from the ChangeNotifier?
I have a dashboard setup with a consumer and i want to change the route depending on the result of certain operati...

Flutter local notifications throwing an error

While trying to show the notifications from flutter_local_notification it throws the following error:
E/ Failed to handle method call

Unable to get user data from GeoFlutterFire

I want to display the user information that I got from a geoquery with geoflutterfire just like I did when I queryed my database based on the username. I tried to do the same thing with the data fr...

Provider showing null on json list

In my flutter app I am using the provider architecture to fetch JSON from an API and display at throughout the app on widgets. However, I am getting null values on the list that is returned. The API

Flutter plugin just_audio example error then dispose

I've just copied the example of just_audio library and put in into my project, and then I'm doing a hot reload or pressing back, I'm getting an error
[] Dart Error: Unhandled

how to create custom widget for label text in flutter

how to make the required text green and the * symbol red colored on the label text in a text field
controller: _controller,
decoration: new InputDecoration(
hintText: 'Search her...

How can I show YouTube video link get from database in flutter

I have this class which handle the data comes from future function :
Class MyYoutube {
final int index ;
final String link; // youtube Link
MyYoutube(this.index ,; }
to get this

add 3 text in ListTile, change background color for each column, and add search in this list

How can I add a search in my listview below please
And is it possible to add 3 text in my ListTile if yes how can I do please.
And how can I do to change background colors in my list one time blue ...

Tap photo in flutter show it bigger

I am making an app in flutter and i want to know how i can make the photo to show the photo bigger when the user click on it . Like when you tap on a photo on facebook and automatically it opens i...

Minimum height on horizontal list view

There is an annoying blank space between the two lists. ( Check screenshoot below )
Question How to remove this blank space without specifying the height of the first list. Just make it wra...

Flutter-desktop Frameless window support

just started with flutter and I am playing with macos desktop app. I wonder if flutter has support for frameless window.
For example in Electron.js we can define frameless window and our app window...

Timer inside flutter isolate not stopping when isolate is killed

I have an app uploading joystick position data to a webserver using an API call.
This method gets called when a joystick is moved. It stops any previously running isolate and starts a new isolate i...

Change the leading and title according to Appbar height

return Scaffold(
preferredSize: Size.fromHeight(120),// change appbar size

backgroundColor: Color.fromARGB(255,254,202,8),