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
24
votes
1 answer

Refresh Flutter Text widget content every 5 minutes or periodically

I have a Flutter Text widget and its content is populated from an external REST call.I would like to refresh the widget content periodically every 5 mins by calling the REST endpoint. So far I managed to call the endpoint every 5 mins but unable to…
isudarsan
  • 437
  • 1
  • 6
  • 14
24
votes
4 answers

Recreate Flutter's ios and android folder with Swift and Kotlin

Hi I just found out that it is possible to create Flutter project with Swift and Kotlin. However, I'm already invested in my current projects and want to recreate the ios and android as Swift and Kotlin (currently they are default to Java and…
Inquisitor K
  • 683
  • 1
  • 7
  • 19
24
votes
6 answers

Flutter DataTable - Tap on row

I am using Flutter DataTables to display list of items in cart. Now I want to edit the quantity of any selected row. Is there a way to get the information of the row user has tapped? Following is complete code of my DataTable: class…
Zain SMJ
  • 1,492
  • 7
  • 19
  • 33
24
votes
2 answers

Flutter: how to avoid special characters in validator

I have this validation function: class FormFieldValidator{ static String validate(String value, String message){ return (value.isEmpty || (value.contains(**SPECIAL CHARACTERS**))) ? message : null; } } I would like to indicate that doesn't…
Little Monkey
  • 5,395
  • 14
  • 45
  • 83
24
votes
3 answers

Flutter - Displaying two ListViews on one screen

I'm trying to add a horizontal listView.builder on top of another vertical listView.builder. Both listViews should have text on top of both. This is what I've made so far, only the top horizontal listView.builder is drawn, when I try to click where…
Jake
  • 1,906
  • 9
  • 32
  • 60
24
votes
3 answers

How to return Future or any other types from a function in dart

I need to handle the back button press on one of my Form entry widgets. This is how I implemented the WillPopScope's onWillPop method : Future _onWillPop() { if (changed) { return showDialog( context: context, …
krishnakumarcn
  • 3,959
  • 6
  • 39
  • 69
24
votes
7 answers

How to give a "Dashed Border" in flutter?

I try to give dashed border in flutter but there is no option for dashed border in flutter. so any another way to create dashed border in futter. new Container( decoration: new BoxDecoration( border: Border( …
Ravindra Bhanderi
  • 2,478
  • 4
  • 17
  • 29
24
votes
6 answers

Fading Edge ListView - Flutter

has anyone come across something like fadingEdgeLength in Android for Flutter so that when you scroll up items start fading into the top of the screen? Below is my interface built up of the Widgets. If it helps these are the properties I'm…
Dan530c
  • 377
  • 1
  • 4
  • 13
24
votes
4 answers

how to get a list of files from the directory and pass it to the ListView?

I get the list of files from the user's folder. The names of the files I transfer to the ListView.builder. It's work, but I think, this is bad architecture. A method _getFilesFromDir() call with a high frequency. How to make the correct list…
Вячеслав
  • 707
  • 1
  • 12
  • 21
24
votes
3 answers

Pick main color from picture

I'm new to Dart/Flutter framework and I'm still exploring their possibilities. I know in Android it's possible to take a picture and extract the main color value from it programmatically. (Android example) I wonder, how would this be achieved in…
Andrea
  • 369
  • 1
  • 3
  • 10
24
votes
1 answer

Why an explicit ".cast<>()" function in Dart instead of "as <>"

In my question Dart 2.X List.cast() does not compose the answer requires converting a List to a List as such: List ls = (json['data'] as List).cast().map((s) => s.toUpperCase()).toList(); My experience from other…
Richard Johnson
  • 502
  • 1
  • 6
  • 14
24
votes
10 answers

Flutter save a network image to local directory

In Flutter how to save an image from network to the local directory. I am new to encoding and decoding images. Can anyone point me in the right direction?
Aritra Dattagupta
  • 760
  • 1
  • 7
  • 22
24
votes
2 answers

Flutter - How to prevent BouncingScrollPhysys from bouncing when it reach the end of a CustomScrollView?

BouncingScrollPhysics by default bounce at the start and end of a ScrollView but I would like to over ride that. How can I accomplish that?
braulio.cassule
  • 1,322
  • 4
  • 14
  • 23
24
votes
1 answer

How to access Flutter Back button functionality?

I would like to present an AdWords interstitial before the user returns to the previous page. How can I do this when the return button is pressed?
Charles Jr
  • 8,333
  • 15
  • 53
  • 74
24
votes
11 answers

How can I customize the TabBar indicator width and height?

I'm using a TabBar widget and I'd like to customize the height and width of the indicator. I can't see any other property besides color I can modify.
Albert Lardizabal
  • 6,548
  • 7
  • 34
  • 34