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
9 answers

flutter - android back button does not call onWillPop of WillPopScope

I would like to exit my application. I have implemented a WillPopScope, but it looks like the onWillPop function is not being called at all. I tried many things like swap WillPopScope with Scaffold, changing the return value of the function, but it…
Gicminos
  • 912
  • 3
  • 10
  • 32
24
votes
8 answers

How to fix wrong rotation of photo from camera in flutter?

I'm taking a photo with the newest camera plugin version and I'm using code from flutter example. This is how I pick a camera: final cameras = await availableCameras(); final firstCamera = cameras.first; This is inside init: _cameraController =…
Sprowk
  • 355
  • 1
  • 6
  • 15
24
votes
3 answers

How to set table column size in TableRow for Flutter Table

I have no idea how to set table column size in Flutter. If I use Row, Expanded can be used, but TableRow does not allow it. Please tell me some advice how to set table column size. The best solution for me is adjust to size of text length in…
tajihiro
  • 2,293
  • 7
  • 39
  • 60
24
votes
5 answers

Flutter ChangeNotifierProvider builder is deprecated

I have this code in my main.dart: main() { runApp( MultiProvider( providers: [ ChangeNotifierProvider(builder: (context) => Auth()), // /**problem here. builder displayed with strikethrough line**/ ], child: App(), …
Dika
  • 2,213
  • 4
  • 33
  • 49
24
votes
5 answers

Separator/Divider in SliverList flutter

How can we implement Separator/Divider in SliverList. ListView.separated is handy way to create separators in list but i do not see any docs or examples about SliverList
inval
  • 380
  • 1
  • 4
  • 11
24
votes
6 answers

Validator error message changes TextFormField's height

When the error message shows up, it reduces the height of the TextFormField. If I understood correctly, that's because the height of the error message is taking into account in the height specified. Here's a screen before : and after : Tried to…
user54517
  • 2,020
  • 5
  • 30
  • 47
24
votes
6 answers

Flutter Zoomable Widget

What I want to build is a widget that can make its child widget zoomable similar to the zoomable behavior. Gestures I want to cover are Pinch To Zoom Double Tap to Zoom Tap to get the local Position of the widget Here is my widget…
Aawaz Gyawali
  • 3,244
  • 5
  • 28
  • 48
24
votes
12 answers

A non-null String must be provided to a Text widget

I'm trying to add the option for the quantity to be adjusted but I get an error saying "A non-null String must be provided to a Text widget" How do I provide this, to this code? trailing: Container( height: 60, width: 60, …
Mm Victory
  • 372
  • 1
  • 4
  • 18
24
votes
1 answer

Why Flutter copies the src of standard libraries to sky_engine?

Since dart:ffi is available from Dart 2.2.0-dev.2.0, I've been trying to use that library. The sample app works fine for me and I also tried to use it for my Flutter app but I couldn't call it with import "dart:ffi", although Flutter on my machine…
Manabu Nakazawa
  • 1,983
  • 22
  • 23
24
votes
7 answers

Overflow Error in Flutter when keyboard open

I am designing a login page it overflowed when I click on any text form field it open keyboard and through overflow warning like this see attached image. I also want a Raised button icon should be on the right side of the button. Widget…
Muhammad Usman
  • 242
  • 1
  • 3
  • 11
24
votes
5 answers

Flutter: How to fix "A RenderFlex overflowed by pixels " error?

I am using GridView in my Flutter app to display images and their titles. Please check the below code. import 'package:flutter/material.dart'; import '../common_ui/search_bar.dart'; class PurchaseProductsPage extends StatelessWidget { @override …
PeakGen
  • 21,894
  • 86
  • 261
  • 463
24
votes
9 answers

Flutter Showing Snackbar On Top of Bottom Sheet

In my code I call a bottom sheet to display a list of tiles. These tiles contain buttons that display a snackbar. That functionality works fine, the only issue is that the snackbar is displayed behind the bottom sheet so you can only see it if you…
24
votes
2 answers

Flutter - Detect content overflow and clip it

I'm trying to use ClipRect with a Column inside it, but it doesn't seem to work well. What I'd like to achieve is to clip the column's content and to show a text message if there is an overflow (if the column's content cannot be displayed within the…
pasul
  • 1,182
  • 2
  • 12
  • 20
24
votes
4 answers

Is it possible to use ListView.builder inside of CustomScrollView?

Is it possible to use ListView.builder (or something similar) inside of a CustomScrollView? I have a CustomScrollView like this: return Scaffold( body: CustomScrollView( slivers: [ SliverAppBar(...), SliverList(delegate:…
Jordan Nelson
  • 1,162
  • 2
  • 8
  • 9
24
votes
6 answers

flutter Image.network not working on release apk

Getting weird issue. If I run app in simulator, works fine. If I installed app by connecting android device works fine. But if I made apk by flutter build apk and installed in device. Network image not coming? Why? any thing is going wrong? No need…
Govaadiyo
  • 5,644
  • 9
  • 43
  • 72