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
25
votes
2 answers

calling javascript from Dart

i was able to fire off an alert message from dart, but couldn't figure out how to call a function I wrote in another js file from dart. This would have been a great selling point if it was straight forward. I did see this post, which got me…
BraveNewMath
  • 8,090
  • 5
  • 46
  • 51
25
votes
6 answers

Calculate number of a letter in a string using Dart

I try to calculate how many letter "a" i have in the sentence: "Hello Jordania". I find the function contains. I using it like this: var phrase = "Hello Jordania; var comptenbrdea = phrase.contains('a'); print(comptenbrdea); I get "True" as…
Peter
  • 1,719
  • 4
  • 22
  • 31
25
votes
3 answers

How do I convert a UTF-8 String into an array of bytes in Dart?

I'm creating a Redis client and would like to create a byte array for sending to the Redis server. To issue commands to the server, I need to convert Dart's UTF-8 strings into a bytes which can be written to a socket. How can I do this?
Mark B
  • 2,870
  • 3
  • 20
  • 18
24
votes
13 answers

How to fix this Flutter Doctor "Warning: `dart` on your path resolves to " macos?

I'm getting this warning after using "Flutter Doctor" command after the installation of Dart using brew tap dart-lang/dart on MacOS Big Sur Flutter (Channel stable, 3.7.0, on macOS 11.7.2 20G1020 darwin-x64, locale en-GB) ! Warning: dart on your…
Puneetpal Singh
  • 251
  • 1
  • 1
  • 4
24
votes
4 answers

Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null

After updating Flutter 3.0 below compile error occured. This error has no ref to my code. It refers to framework. Launching lib/main.dart on Chrome in debug mode... lib/main.dart:1 : Warning: Operand of null-aware operation '!' has type…
isa
  • 398
  • 1
  • 3
  • 13
24
votes
10 answers

Flutter go_router how to return result to previous page?

I'm trying to open a page and get returned result with go_router package. In Navigation 1.0 I use this: final result = await Navigator.push( context, MaterialPageRoute(builder: (context) => const SecondRoute()), ); // handle result But I can't…
dante
  • 984
  • 3
  • 10
  • 24
24
votes
6 answers

Flutter iOS Error Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130)

Hi am facing an issue while running flutter project in MacBook Air M1 chip Lap. Tried all possibilities couldn't find where is the exact problem. All basic solutions like flutter clean, flutter pub get, pod deintegrate & install, flutter build ios,…
Jai Techie
  • 1,657
  • 3
  • 14
  • 36
24
votes
4 answers

Don't put any logic in createState after installing flutter_lints in Flutter

I installed flutter_lints plugin in my project, after installing then it shows a warning message "Don't put any logic in createState". How to solve this issue? class OverviewPage extends StatefulWidget { final int id; const OverviewPage({Key?…
Mohammed Nabil
  • 662
  • 1
  • 8
  • 36
24
votes
14 answers

I/UrlLauncher(17669): component name for (url) is null

Why does it throw an error and give me the link is empty even though the link exists? And when I use launch (url) alone, the link opens without any problems. String StateUrl = 'View App' ; var url = 'https://www.youtube.com/watch?v=-k0IXjCHObw'…
Mohammad alqannas
  • 335
  • 1
  • 6
  • 12
24
votes
12 answers

Flutter Gradle task assembleDebug failed with exit code 1 zip END header not found

Hello I am new to Flutter I have setup flutter with android studio 4.2.1, and every thing is fine. When I try to run it; it show me following error I see too much questions but it is not helpfull for me flutter doctor run no issue found Hers is…
24
votes
2 answers

Flutter Tooltip on One Tap

I want to show a tooltip on a single tap, not a long tap. Can anyone help me with this? Tooltip( message: e.title, child: Card( semanticContainer: true, child: Padding( padding: EdgeInsets.symmetric( vertical: 12, …
Moiz Travadi
  • 251
  • 1
  • 2
  • 6
24
votes
7 answers

How to get network DateTime.Now()?

In flutter DateTime.now()returns the device date and time. Users sometimes change their internal clock and using DateTime.now() can give the wrong results. How can I get Network/Server Current DateTime in flutter? Is it possible to get…
Jai Techie
  • 1,657
  • 3
  • 14
  • 36
24
votes
2 answers

Why does dart not allow method overloading?

I tried to use method overloading in some dart code and quickly learned that overloading is not offered in dart. My questions are: why is it not offered, and what is the recommended alternative? Is there a standard naming convention since methods…
loganrussell48
  • 1,656
  • 3
  • 15
  • 23
24
votes
4 answers

How to use preCachePicture() in flutter_svg

I'm using flutter_svg package to render SVG images in my app, as flutter does not officially supports SVG yet.I'm having a delay of probably few seconds while trying to load SVG images in my app and while looking for the solution I found out that I…
Shubhamhackz
  • 7,333
  • 7
  • 50
  • 71
24
votes
5 answers

how to get flavor name on Flutter?

Is it possible to get flavor name Flutter side? for both android and ios build.gradle flavorDimensions "app" productFlavors { dev { dimension "app" versionCode 2 versionName "1.0.0" } qa { dimension…
BIS Tech
  • 17,000
  • 12
  • 99
  • 148