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
23
votes
5 answers

Do I need a StatefulWidget if my app is using bloc?

I'm missing something. I recently watched the talk here, where the flutter devs are going through using the bloc development method with reactivex in Dart. If I'm using these streams and streamBuilders to manage data flowing through my app, and…
Academiphile
  • 1,434
  • 2
  • 13
  • 21
23
votes
2 answers

Flutter – two text in a row with left one overflowing gracefully

How do I get two side-by-side Text widgets to only allow the left-most one to overflow gracefully? One text widget in a column is easy to overflow gracefully. Two text widgets side-by-side in a row is problematic. Stack overflow wants more details…
Luke Pighetti
  • 4,541
  • 7
  • 32
  • 57
23
votes
4 answers

How to rebuild widget in Flutter when a change occurs

Edit: I've edited the code below to feature the method that fetches the data along with the widgets that build the train estimates (replacing any API information along the way with "API_URL" and "API_STOP_ID"). I hope this even better helps us…
ctrinh
  • 375
  • 1
  • 4
  • 14
23
votes
3 answers

Use dynamic (variable) string as regex pattern in dart

i am trying to pass variable in regex language DART `betweenLenth(val, field, [min = 4, max = 20]) { final RegExp nameExp = new RegExp(r'^\w{" + min + "," + max + "}$'); if (!nameExp.hasMatch(val)) return field + " must be between…
user5084949
  • 267
  • 3
  • 10
23
votes
5 answers

Flutter: Shared Preferences null on Startup

Problem: Shared preference bool value is null on startup even though I have given it a value if prefs.getBool('myBool') returns null (though my shared preferences value should already be set and saved). It does, however, work by the time I press a…
PityTheFool
  • 298
  • 1
  • 3
  • 11
23
votes
3 answers

Flutter : how to use focusNode property on TextField

I want to control the TextField widget when f user taps on it. How can I implement the focusNode property? There's no detailed explanation in the description.
23
votes
5 answers

Android Studio With Flutter Update Has Caused an Indexing Loop

I did an android studio update and updated flutter and now the IDE is stuck in an indexing loop. At the bottom center it keeps flashing 'Updating Indexes...' and my projects projectName.iml file keeps flashing between being a file icon and a folder…
SeaFuzz
  • 1,177
  • 9
  • 28
23
votes
12 answers

How to get day of year, week of year from a DateTime Dart object

I need to get day of year (day1 is 1rst of january), week of year, and month of year from a dart DateTime object. I did not find any available library for this. Any idea ?
fvisticot
  • 7,936
  • 14
  • 49
  • 79
23
votes
6 answers

How can I display buttons side-by-side in Flutter?

I would like to display both of my buttons next to each other horizontally. So far I can only display them from top to bottom. With the following code, what would I have to change ? new Container( child: new Column( children: [ …
DESH
  • 530
  • 2
  • 11
  • 29
23
votes
18 answers

Get Download URL from Firebase Storage in Flutter

I'm currently exploring Flutter, I found there is an official Firebase Storage plugin in Flutter firebase_storage I have storage reference like this one: final StorageReference ref = FirebaseStorage.instance.ref().child("default.png"); But there is…
Putra Ardiansyah
  • 5,249
  • 4
  • 25
  • 37
23
votes
4 answers

Observer for Navigator route changes in Flutter

Is there a way to listen to route changes of the Navigator in Flutter? Basically, I'd like to be notified when a route is pushed or popped, and have the current route on display on screen be returned from the notification
user3217522
  • 5,786
  • 7
  • 26
  • 34
23
votes
1 answer

Dart convert every element of list

I have a List stringValues; that are actually numbers in quotes. I want to convert this list to List intValues. What's an elegant way to do this? There is list.forEach() that does not return anything, there is iterable.expand() that…
Gazihan Alankus
  • 11,256
  • 7
  • 46
  • 57
23
votes
10 answers

Package import - Target of URI does not exists

Please check my project: https://github.com/MaximGo/WebTech_Projekt.git In the file 'tetrisclient.dart' I want to import the generated package from the lib-folder. import 'package:tetris/tetris.dart'; But I get the Erro 'Target of URI does not…
PeterP
  • 241
  • 1
  • 2
  • 3
23
votes
5 answers

How to install pub (command line usage) for Dart on Ubuntu web-server

I've followed the instructions here (under the Linux tab) on installing Dart onto a Ubuntu web-server. Dart itself works fine, but I can't use Pub commands (only Dart commands). How can I install Pub for the server?
Will Squire
  • 6,127
  • 7
  • 45
  • 57
23
votes
3 answers

How to build a complex Web UI application with multiple views?

I am going to build complex application having many different views. Imagine for example eshop solution. There can be a lot of different views: Contact page with some static information Registration form for new customers View of your order List of…
Samuel Hapak
  • 6,950
  • 3
  • 35
  • 58
1 2 3
99
100