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
234
votes
27 answers

How to Move bottomsheet along with keyboard which has textfield(autofocused is true)?

I'm trying to make a bottomsheet that has a text field and autofocus is set to true so that the keyboard pops up. But, bottomsheet is overlapped by the keyboard. Is there a way to move bottomsheet above the keyboard? Padding( padding: …
Manjunath Rao
  • 3,790
  • 3
  • 12
  • 18
233
votes
28 answers

InkWell not showing ripple effect

Tapping the container triggers the onTap() handler but does not show any ink splash effect. class _MyHomePageState extends State { @override Widget build(BuildContext context) { return new Scaffold( appBar: new AppBar( …
J. Sarkar
  • 2,433
  • 2
  • 10
  • 4
232
votes
24 answers

Force Flutter navigator to reload state when popping

I have one StatefulWidget in Flutter with button, which navigates me to another StatefulWidget using Navigator.push(). On second widget I'm changing global state (some user preferences). When I get back from second widget to first, using…
bartektartanus
  • 15,284
  • 6
  • 74
  • 102
225
votes
12 answers

Flutter doctor error - Android sdkmanager tool not found. Windows

I have been going around in circles with this issue, there are so many people who have issues similar to mine, but not one of them is the same. I am trying to get flutter fully set up, but can't resolve one of the issues. When I run flutter doctor…
Mark Perry
  • 2,908
  • 3
  • 18
  • 27
225
votes
30 answers

Flutter plugin not installed error; When running 'flutter doctor'

I am configuring the Flutter SDK on my Linux Ubuntu 16.04 (Xenial Xerus) system. Why am I getting the following error when I run the flutter doctor? I have specified both PATHS for flutter and dart in the .bashrc file, but I get this error when I…
Philip Mutua
  • 6,016
  • 12
  • 41
  • 84
220
votes
12 answers

Flutter how to programmatically exit the app

How can I programmatically close a Flutter application. I've tried popping the only screen but that results in a black screen.
Dirk
  • 3,095
  • 4
  • 19
  • 37
217
votes
17 answers

How to change color of CircularProgressIndicator

How can I change the color of CircularProgressIndicator? The value of the color is an instance of Animation, but I am hoping there is a simpler way to change the color without trouble of the animation.
Arash
  • 11,697
  • 14
  • 54
  • 81
217
votes
5 answers

How does the const constructor actually work?

I've noticed it's possible to create a const constructor in Dart. In the documentation, it says that const word is used to denote something a compile time constant. I was wondering what happens when I use a const constructor to create an object. Is…
markovuksanovic
  • 15,676
  • 13
  • 46
  • 57
216
votes
12 answers

Sort a list of objects in Flutter (Dart) by property value

How to sort a list of objects by the alphabetical order of one of its properties (Not the name but the actual value the property holds)?
Nomnom
  • 4,193
  • 7
  • 27
  • 37
215
votes
16 answers

How to set Custom height for Widget in GridView in Flutter?

Even after specifying the height for Container GridView, my code is producing square widgets. class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState…
Ajay Kumar
  • 15,250
  • 14
  • 54
  • 53
215
votes
16 answers

Flutter remove all routes

I want to develop a logout button that will send me to the log in route and remove all other routes from the Navigator. The documentation doesn't seem to explain how to make a RoutePredicate or have any sort of removeAll function.
chrislondon
  • 12,487
  • 5
  • 26
  • 65
214
votes
10 answers

How to perform runtime type checking in Dart?

Dart specification states: Reified type information reflects the types of objects at runtime and may always be queried by dynamic typechecking constructs (the analogs of instanceOf, casts, typecase etc. in other languages). Sounds great, but…
Volo
  • 28,673
  • 12
  • 97
  • 125
214
votes
40 answers

How to change status bar color in Flutter?

I am trying to change the status bar color to white. I found this pub on flutter. I tried to use the example code on my dart files.
Mohamed Hassan
  • 2,177
  • 2
  • 12
  • 8
213
votes
5 answers

Flutter (Dart) How to add copy to clipboard on tap to a app?

I'm a beginner to Flutter and I just started following their Name Generator app tutorial and made a simple name generating app. I'm wondering if it's possible to add copy to clipboard feature when a user tap on a name? I tried to implement a…
Gihan
  • 3,144
  • 2
  • 9
  • 36
212
votes
17 answers

Cannot run with sound null safety because dependencies don't support null safety

I have followed "Enabling null safety" on dart.dev and also migrated my whole Flutter application to null safety. Now, I am trying to run it using flutter run. However, it will not start because of the following error: Error: Cannot run with sound…
creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402