Click here to Skip to main content
15,888,454 members
Everything / Programming Languages / Dart

Dart

Dart

Great Reads

by Manish Dubeyy
How to debug the design time errors in WPF XAML file?
by Meshack Musundi
Implementing the MVVM pattern in Flutter using ScopedModel
by ThatsAlok
This is getting started beginner tutorial in DART 2, I would be touching Basic setup, Datatypes, Conditional Statements and Loops.
by ThatsAlok
In this second article of series, I would be focusing completely on List working

Latest Articles

by Meshack Musundi
Implementing the MVVM pattern in Flutter using ScopedModel
by ThatsAlok
Object Oriented Programming in DART
by ThatsAlok
Let's explore Flutter Grid view and MediaQuery
by ThatsAlok
Flutter ListView: A scrollable control for everyday need

All Articles

Sort by Updated

Dart 

14 Apr 2024 by gacar
I have firebase realtime database. When I manually change data on the Firebase console, vscode stops responding and throws the following error. Error: TypeError: Instance of '_Exception': type '_Exception' is not a subtype of type...
10 Mar 2024 by Andre Oosthuizen
Quote: Thanks for your response. I asked this question in more detail on stackoverflow. Unfortunately I will not be visiting StackOverflow to view your question, I doubt i if anyone else would. Please give full detail here by using the Improve...
9 Mar 2024 by gacar
I want use a google fonts icon. I have Code point (e88e, info icon). But i cannot get right icon. How can i get icon from google icons by Code point? Thanks. This is icon link: Material Symbols and Icons - Google Fonts[^] import...
3 Mar 2024 by M-Badger
The issue with your code is that you're trying to assign a value to value1A directly in the class body of B. In Dart, you can’t assign values to inherited variables directly in the class body. You should do this inside a method or constructor. ...
3 Mar 2024 by gacar
Hello, I want set a value of extended class. How can i do it? Thanks. class A { String? value1A; A({ this.value1A, }); } class B extends A { String value1B = ""; value1A= ""; //
1 Mar 2024 by Member 14933789
Hey, codeproject wonderful community! I am trying to implement the Chewie Flutter package into my app as a custom widget and I got everything down and made it as customizable as possible. It complies well, but when I run it on the web, android,...
14 Feb 2024 by gacar
I found solution on flutter/dart discord channel. I should have marked the method of the new class as "late". I marked late then working now. class Data { String read() { return ""; } } class Data2 { var newData= Data(); //...
14 Feb 2024 by gacar
Hello, I'm new to Flutter/Dart. When I take an instance of a class and try to use a method in it, I getting below error.How can i use method from instance class with new class name? Thanks. "The instance member 'newData' can't be accessed in an...
28 Jan 2024 by gacar
I want to use if condition in the icon widget, but Dart gives an error. How should it be used correctly? Thanks. class Cell extends StatelessWidget { const Cell({super.key, this.caseTrend = false}); final bool caseTrend; @override ...
28 Jan 2024 by M Imran Ansari
Unfortunately, you can’t write if statement directly inside your widget properties as if you were writing in your method or function. But there are a few ways you can write a conditional statement inside your widget. You can use the ternary...
21 Jan 2024 by Richard MacCutchan
Se https://stackoverflow.com/questions/77663954/flutter-failed-to-extract-native-libraries-res-18[^]
20 Jan 2024 by Kavya Bhargava
I am receiving this error: Error: ADB exited with exit code 1 Performing Streamed Install adb: failed to install /Users/XXX/FlutterDev/XXX_app/build/app/outputs/flutter-apk/app-debug.apk: Failure [INSTALL_FAILED_CONTAINER_ERROR: Failed to...
17 Jan 2024 by Kavya Bhargava
I after a long time was working on one of my projects so I updated my flutter code and packages too. I started receiving error: A problem occurred configuring project for "package name". At first, it was for cloud firestore and firebase ones but...
24 Nov 2023 by Graeme_Grant
For Identity, cookies are okay for non-mobile applications. For mobile, you will need to use Bearer tokens.
24 Nov 2023 by Trần Toàn from Hanoi
I am encountering difficulties with my Duende Identity Server implementation. The server successfully provides tokens to a WPF Desktop client, but I'm facing issues when trying to obtain an access token from the server using a mobile app. I...
24 Jul 2023 by MohammedZr
Hello I'm trying to use the google_maps_flutter package to make a Google map for the Client so that he can Track and locate Orders within the application the maps are not showing from the first time Even though you see in this code the GoogleMap...
12 Jun 2023 by Aryaveer Chaudhary
I am writing a federated plugin in Flutter but acc to url_launcher . I have to create app_facing_package, platform_package and platform_interface_package but I don't know what to write in these packages What I have tried: in docs, there is a...
12 Jun 2023 by Richard MacCutchan
See Developing packages & plugins | Flutter[^].
5 Jun 2023 by Dan Sep2022
I have base64 encoded string version of docx file stored in my database and I have to embed into my Flutter app to view the content of the file and I come up with this solution using webview_flutter which apparently I got from ChatGPT ...
15 Mar 2023 by Alva Rizky
On this code, i try to create Delete features, which is can delete history/data that already added. Here's the code : menuOption(String value, History history) async { if (value == 'update') { Get.to(() => UpdateHistoryPage( ...
15 Mar 2023 by OriginalGriff
Thee error message is pretty explicit: the function returns a nullable value - bool? - and you are trying to store it in a non-nullable type - bool; the types are not the same. The simplest solutions are to change the type of yes to bool?, or...
15 Mar 2023 by Tiaan 2023
I want to save a bool value (The value is already made in my Firebase Realtime Database whith a default value of false), but when I save the value it doesn't save. I follow the videos I use their code examples (modified to work for my code ofc)...
8 Mar 2023 by Richard MacCutchan
This is the same issue as your previous question at Type 'null' is not a subtype of type 'string' while trying to retrieve data from list into listview[^]. You need to look at the code at ... var custUsernameGet = await...
8 Mar 2023 by Dan Sep2022
I have a function that will retrieve username from database and that username value will be stored in global string variable, everything works, and my goal is to display that username variable on the AppBar text but I keeps getting "Null is not a...
5 Mar 2023 by Dan Sep2022
This problem is driving me crazy and I don't know what to do anymore I'm completely lost and it's ruining my life. I'm trying to insert a list values which I retrieved from MySQL database into listView when the user pressed a button but the...
18 Feb 2023 by Kavya Bhargava
My flutter share button is running extremely slow. Reason I think is that it has to screenshot the image after getting from firebase for each specific news.(My Assumption) Share button: IconButton( onPressed: () async { ...
14 Feb 2023 by Dan Sep2022
I have this StatefulWidget that supposed to retrieve data from MySQL database based on condition and add those retrieved values into an array so I can use the array values to be display on ListView. My Problem is that sometimes when the array...
12 Oct 2022 by abimjoshi7
I am working with an expansion tile in a flutter that shows user information in an irregular hierarchical order. I am optimizing the code to increase the performance of the expansion tile widget. Unit-III hierarchy differs from the rest and I am...
27 Aug 2022 by mustafa aboud
im confused among dart dart and kotlin so if i basically dont know about programming will easily learn dart ? what beside should i learn plus flutter ? dart will be enoght to build web apps and android ( with flutter ( ? What I have tried: ...
27 Aug 2022 by Richard MacCutchan
The only way to find out is to go to the Flutter and/or Dart websites and look at the documentation: Learn Flutter[^]. Tutorials | Dart[^].
27 Aug 2022 by OriginalGriff
We can't tell you. While we know where you are now (knows nothing about the subject, has not coded before) and we know where you want to be (can code well in the language) nobody (not even you!) has any idea how you think, and what aptitude you...
18 Aug 2022 by Digiyang
Hi all, Can someone please tell me how to make my bottom navigation bar persistent in my app with auto_route ? I tried to find something in the official documentation, but unfortunately nothing. Thank you in advance for any help! Here is my...
10 Aug 2022 by wseng
Something wrong on this line. child: Image1.file(File(image1.path)), child suppose return Widget, not Image1.file What is Image1 exactly? Is it the class created by you or it's an library?
10 Aug 2022 by Priya Smarteer
When I try to pass an image from one screen to another I get an error. Here the error: Prefer typing uninitialized variables and fields. Use generic function type syntax for parameters. The prefix 'image1' can't be used here because it's...
7 Aug 2022 by Digiyang
Hi all, I'm trying to implement a slider that add a certain value to the initial value when checking out. But I'm not able to pass that extra value to my checkout API Call. Here an example: https://imgur.com/a/mp5ytzW Structure: PaymentWidget...
7 Aug 2022 by wseng
You can pass widget.value to PaymentsWidget like how you did for spi and conversationId. PaymentsWidget( widget.spi, widget.conversationId, widget.value ),
7 Aug 2022 by Digiyang
Hi all, I'm trying to implement a slider that add a certain value to the initial value when checking out. But I'm not able to pass that extra value to my checkout API Call, that is in the initSate. Any idea how to update the value inside...
4 Aug 2022 by ROCKSTAR 2022
I am building a history app. When a person has viewed a story, the ID of the user who viewed that story is written to that story's database in the Readers collection. There is also a list with all the stories. And I want to sort these stories by...
4 Aug 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
9 Jul 2022 by Mathis 2022
Conceptionally I would make a LoadingWidget where you execute the async Function to get the bool is. Then in the async Function: if (is) Navigator.push(MaterialPageRoute...); else if (is)...
23 Jun 2022 by Abim Joshi
I am receiving notification on all state(foreground, background(on-Paused), terminated(on-Detached)) but it's redirecting me to the intended url only in(foreground and terminated state). Surprisingly, on receiving notification during foreground...
29 May 2022 by Kavya Bhargava
Before every video I am getting a black screen which I am not sure why is it appearing. At first I thought it is due to the internet connection or something but that does not seem to be affecting it at all. I am getting video urls from the...
9 May 2022 by Kavya Bhargava
I am using a video player to play the videos I get from my streambuilder. I am unable to place my dispose function in such a way that I don't get this error. Error is causing the emulator to crash after certain point. My screen where I am...
5 May 2022 by Member 15625382
Hello everyone here's my test app and I have some problems with making a Favorite page section where you can tap on button and add the item into fav page. I'm receiving a data from API and implementing it by Listview.builder In main.dart, I'm...
2 Apr 2022 by Kavya Bhargava
I am trying to display the video after selecting it with the help of an image picker. videoscreen: List _video = []; @override Widget build(BuildContext context) { return Scaffold( body: Column(children: [ ...
24 Mar 2022 by Gyve Jayson Tolosa
I want to get the data like username and password from realtime database (firebase) and use it to login the user What I have tried: I tried getting the values but it didnt work
23 Mar 2022 by Fazaamajd Fazaa
i have three types of user in my application (nurse,substitute, patient), every type will have access to specific home page. every type of user have his homepage and his specific features. so i want to implement some logic in my code to resolve...
17 Mar 2022 by Kavya Bhargava
I made a listview builder following a course in which I kept an elevated button(which adds video through image picker) to be index 0 and then videos shall be showed at index 0. My elevated button is not showing. I made same code for image picker...
16 Mar 2022 by Mohamed Reda 2022
.................................
16 Mar 2022 by Patrice T
Quote: Nothing Time to kick your brain, all things do not comes all cooked. The job of programming is also CREATING SOLUTIONS. For the barcode, you have to ask yourself some questions and answer them. The answers will tell you what to do. 'Why a...
16 Mar 2022 by OriginalGriff
Quote: What I have tried: Nothing While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades...
4 Mar 2022 by Kavya Bhargava
I was following a tutorial for Firebase push notifications. I followed all the steps: Connecting app to Firebase, and importing packages (Firebase messaging and Firebase push notifications). I tried sending several notifications, but it did not...
22 Feb 2022 by Kavya Bhargava
I am using a navigation bar with two buttons for both of them I have set the color as white but for one of them, the button is not changing and appears to be the same color as the navigation bar. The icons.newspaper widget is causing the issue. ...
22 Feb 2022 by Andre Oosthuizen
Looks like you have set the color for navigation bar and button to the same color - color: Color.fromARGB(255, 55, 126, 185), buttonBackgroundColor: Color.fromARGB(255, 55, 126, 185),
21 Feb 2022 by Osama Orabi 2022
How do I open the notification in Webview when clicked using OneSignal flutter OneSignal.shared.setNotificationOpenedHandler((OSNotificationOpenedResult result) { // Will be called whenever a notification is opened/button pressed. }); What...
17 Feb 2022 by Kavya Bhargava
I have built a streambuilder that has two-page builders. I realized it is not iterating over the last if statement, does anyone knows a function so that I can get it to iterate over the last if statement too? The condition of all if statements...
13 Feb 2022 by OriginalGriff
Without your data there isn't a lot we can do - we can't run your code in isolation, and you need it running to work out where the problem occurs. And without that, you can't work out why it occurs! So, it's going to be up to you. Fortunately,...
9 Feb 2022 by Kavya Bhargava
I am trying to make a reels app. I am getting this error, I checked other answers for this question all of them said there is a problem with the video but I am using cloud-firestore URL, the same URL is working for the listview Widget but not for...
6 Feb 2022 by Kavya Bhargava
I am trying to upload videos to firebase before that I am trying to display them in the app in listview but they are not getting displayed on the screen, there is'nt any error messages in debug console either so I am unable to figure out what is...
29 Jan 2022 by Kavya Bhargava
I built an image picker after learning in a course. I am not getting any errors in the debug console or in the build. I am trying to click it but it is not working. I made another image picker in a similar manner in same app but that did not gave...
26 Jan 2022 by Member 15514073
My app screen does not change the state of it in real-time while updated in the firebase real-time database .. the earnings screen is updated after the driver ends the trip and collects the fares of the trip then updated total earnings and number...
24 Jan 2022 by JamesPiner
Trying to sort my list of cards by the latitude and longitude I have set as fields in Firestore to the user's location in Flutter (by their latitude and longitude). Does anyone know how to do this? My code below in the sort function only reversed...
24 Jan 2022 by Member 15511393
Iam having the same problem , did you know how to make it?
21 Jan 2022 by Coding-Jutsu
So I've already had a problem with this code before and got some help to fix my error, but I have a new one. So basically I'm waiting for a variable and this variable is not null because when I print it, I can see the value of this variable. The...
8 Jan 2022 by Kavya Bhargava
I am unable to assign my one class to another even though I have imported the lib for them. I am following a course . In this I will fetch the orders from firebase and showing the orderscreen. Orderscreen(where i am getting the error): import...
8 Jan 2022 by Dave Kreskowiak
The error is pretty explicit. You're calling a function is is expecting an array or list of OrderItem objects and you're passing in a single OrderItem object. Pass in an array of OrderItem objects, even if that array has only a single OrderItem...
29 Dec 2021 by Abuabacarr Jobarteh
void main() { runApp(Covid_19_20AppApp()); } class Covid_19_20AppApp extends StatelessWidget { get generateRoute => null; @override Widget build(BuildContext context) { return MaterialApp( title: 'Covid-19', theme:...
26 Dec 2021 by Rafia Chowdhury
This is the instruction provided by them for a website: Include JavaScript 1. Start eye tracking GazeCloudAPI.StartEyeTracking() ; 2. Define your...
22 Dec 2021 by Member 10907325
Hello i am loading json from local assets file and show in listview in my flutter app anyone know how to implement searchbar here is my code body: Container( child: Center( // Use future builder and...
22 Dec 2021 by Richard MacCutchan
Quote: i tried to search on google but no result found What did you search for? Look at this: flutter search bar example - Google Search[^].
2 Nov 2021 by Kavya Bhargava
In this, I think I am getting errors at the navigators. If I comment both of them out the app runs fine(except the page change). The first navigator is giving this error when I comment it out .The second navigator is working but not as it is...
19 Oct 2021 by Ghali Skalli
I'm making an movie lister app. I made my app like that: 1. The main.dart who run the project and contain all Tmdb (The Movie DataBase) process 2. The root_page.dart who contain all the "immovable" elements (app bar, bottom navigation bar, page...
10 Oct 2021 by _-_-_-me
Here I did not typecast like we do in java, but I am getting correct output Why is that so? void main() { print(10/3); } output: 3.3333333333333335 What I have tried: I tried searching in google ..................................
10 Oct 2021 by Richard Deeming
The Dart division operator[^] works on double values. It has a different operator for integer division[^] if you want the same behaviour as Java. Only the language designers could tell you why it does that. At a guess, they saw how many people...
27 Sep 2021 by Richard MacCutchan
See Widget class - widgets library - Dart API[^]
30 Aug 2021 by Dave Kreskowiak
Look at your main function. All you're doing is defining variables. That's it, nothing else. You're not calling any of your other functions in the code.
31 Jul 2021 by Member 10907325
Hello i am making app on flutter i need help in pageview builder whem your swipe left want jump pervious and when user swipe right i want user go to next page but for example user is 6 postion the click on swipe left it jum to postion 5 if it...
24 Jun 2021 by Rabia Başıbüyük
How can I pull data from a Flutter Firebase real-time database in the form of a list?can you help me please? What I have tried: I tried FutureBuilder to extract data from flutter firebase realtime database in the form of a list, but it gave an...