Questions tagged [dart]

Dart is a class-based, statically(& strongly)-typed programming language for building web and mobile applications. Dart compiles to modern JavaScript to run in the browser and compiles to native code to run on mobile platforms like Android and iOS. Dart also runs on the command-line for scripting and server-side apps.

Dart is an open-source, class-based, statically(& strongly)-typed (with inference) programming language for building web and mobile applications created by Google. Although Dart is statically-typed it supports dynamic-typing through the 'dynamic' type.

Dart’s design goals are:

  • Create a structured yet flexible language.
  • Make Dart feel familiar and natural to programmers and thus easy to learn.
  • Ensure that Dart delivers high performance on modern web browsers, mobile, and environments ranging from small handheld devices to server-side execution.

Dart targets a wide range of development scenarios, from a one-person project without much structure to a large-scale project needing formal types in the code to state programmer intent.

To support this wide range of projects, Dart provides the following features and tools:

  • Sound type system: A type system which feels lightweight thanks to inference and gives good safety
  • Mobile and Web frameworks: Dart developers can use Flutter on mobile and AngularDart on the web
  • IDE Integration: official plugins for Jetbrains' IDEs (IntelliJ IDEA / WebStorm etc) and Visual Studio Code. Community plugins also exist for many other editors backed by the Dart Analysis Server

Links

Documentation

FAQ

Chat Room

90488 questions
26
votes
6 answers

Does dart support operator overloading

I read that Dart does not support function overloading. Does it support operator overloading? If yes, can you show me how it's done in a simple example? And what are some advantages etc?
Muhammad Umer
  • 17,263
  • 19
  • 97
  • 168
25
votes
9 answers

Error:RenderBox was not laid out: NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE

i am having problem using SingleChildScrollView in this way, i dont no what is wrong, i keep getting this error. If add the SingleChildScrollView the page will be blank(will not show all the widget)but if i remove the SingleChildScrollView, the page…
Gbenga B Ayannuga
  • 2,407
  • 3
  • 17
  • 38
25
votes
4 answers

The method '[]' can't be unconditionally invoked because the receiver can be 'null'

I'm new to Flutter. I am trying to develop an application. I want to show the staff list in the Firebase database. However, I am getting the following error. Error : The method '[]' can't be unconditionally invoked because the receiver can be…
25
votes
6 answers

flutter: LateInitializationError: Field 'name' has not been initialized

Error: Runner[463:34314] flutter: LateInitializationError: Field 'name' has not been initialized. I recently updated to using firebase core and nullsafety and made some changes to my code that I don't quite understand, I'm new to programming here.…
giroprotagonist
  • 138
  • 1
  • 3
  • 15
25
votes
3 answers

LateInitializationError: Field '_userData@32329253' has not been initialized

Getting this when trying to initialize data. The following LateError was thrown building UserProfile(dirty, state: _UserProfileState#752a9): LateInitializationError: Field '_userData@32329253' has not been initialized." Here's the code: late…
Satyam Pandey
  • 537
  • 2
  • 5
  • 10
25
votes
3 answers

Flutter TextButton padding

With the Flutter 2.0 release, the FlatButton has been replaced with TextButton. Hence, the padding property is not longer available directly, but as a ButtonStyle property. My problem is, how can I set it since it's no longer available as…
Sen Alexandru
  • 1,953
  • 3
  • 19
  • 35
25
votes
1 answer

How to wait for forEach to complete with asynchronous callbacks?

Sample code: Map gg = {'gg': 'abc', 'kk': 'kojk'}; Future secondAsync() async { await Future.delayed(const Duration(seconds: 2)); print("Second!"); gg.forEach((key, value) async { await Future.delayed(const…
Jeet Agrawal
  • 380
  • 1
  • 3
  • 9
25
votes
9 answers

How do I get documentid of a firestore document in flutter?

I have tried the following but it returns a random string which is not present in the firestore. I did manage to get documentid of parent collection using a Query Snapshot DocumentReference…
Pruthvik Reddy
  • 275
  • 1
  • 3
  • 10
25
votes
3 answers

How to change language of Show date picker in flutter

I would like to change the language from english to french in show date picker, Please find below the code i am using and one like which supposed to solve that but it makes the code not working for this part: new Step( …
25
votes
28 answers

On running default app, Flutter throws "log reader stopped unexpectedly" after switching to Master

PS D:\flutterApp\myapp> flutter run Running Gradle task 'assembleDebug'... Running Gradle task 'assembleDebug'... Done 203.1s (!) √ Built build\app\outputs\apk\debug\app-debug.apk. Installing build\app\outputs\apk\app.apk... …
Ajay Tom George
  • 1,890
  • 1
  • 14
  • 26
25
votes
4 answers

dependOnInheritedElement() was called before initstate() in flutter

I am currently having an issue while fetching a Provider' value ininitstate`. I want to set a default value in dropdown in an Appbar and other parts in body. But I got an error saying dependOnInheritedElement() was called before initstate() in…
Brooklyn Lee
  • 369
  • 2
  • 6
  • 15
25
votes
1 answer

Flutter: Object was given an infinite size during layout

I'm battling an issue where I'm given the error "Object was given an infinite size during layout" and "This probably means that it is a render object that tries to be as big as possible, but it was put inside another render object that allows its…
Rasmus Lian
  • 357
  • 1
  • 8
  • 22
25
votes
2 answers

How to Delete cache and app dir in flutter

In my flutter app, I store some images in cache directory and some files in application document directory, now I want to add possibility to my users to delete the cache dir and app dir, How can I achieve this?
mohammad
  • 2,568
  • 3
  • 20
  • 41
25
votes
3 answers

Flutter - How to reduce App Size on Device

My App Bundle Download Size in Google PlayStore is around 23 MB: But Why after installed, the App Size on Disk raises significantly to 83 MB: Any Idea why this happens, because: 1) Flutter's assets file (images, sound & fonts) on projects only…
questionasker
  • 2,536
  • 12
  • 55
  • 119
25
votes
2 answers

Error: Not a constant expression in Flutter

I using the demo from this library and it works perfectly. But when I implement in my project, I get error on this line Error: Not a constant expression. const AssetImage(snapshot.data[index]), My Container is wrapping in InkWell. InkWell( …
Tony
  • 2,515
  • 14
  • 38
  • 71