Most voted "dart" questions
Dart is a web-based language developed by Google. The goal of the Dart language is to replace Javascript as the main language of browsers. Programs in this language can be either run on a virtual machine or compiled for Javascript.
Learn more…410 questions
Sort by count of
-
2
votes3
answers97
viewsHow do I know if a package is dev_dependencies or dependencies?
Taking as the example of this two packages: freezed and freezed_annotation, the installation instruction on the site pub dev. is the same for both packages: However, on video showing how to use this…
-
2
votes2
answers264
viewsInterface or instance of a Generic
Interface I wanted to use interface in Dart, but after a lot of searching, discover that there is not, so I did it this way, I created an abstract class: abstract class IModel { String _uid;…
-
2
votes1
answer115
viewsHow to remove double quotes from the beginning and end of a Dart variable?
Speak devs, all right? I am unable to remove double quotes from the beginning and end of a Dart variable. I post to my Web API and receive a JWT Object. I only need the value of the object, without…
-
2
votes0
answers34
viewsProblem using System with Where firebase
Hello, I’m trying to filter orders by the current date, but when I try to use Where in the firebase’s Collection, my Listen simply stops working. Sending no new update to the list. In a totally…
-
2
votes1
answer39
viewsMethod into classless files. Flutter
Guys I came across a code inside a flutter file (Dart) that left me with some doubts, is a classless Dart file with only one method declared. I tried to look at the documentation but I guess I…
-
2
votes1
answer54
viewsFlutter: snapshot.data does not load Json value
I’m creating a code for a Udemy course that I can’t get the answer to code that works on the teacher’s machine. I tried to change the versions, but apparently, the error is in the request response…
-
1
votes1
answer35
viewsJSON API in aqueduct doubt
I created an API in aqueduct initially. In it I created a serial model class and inside it I have information about autor, ano, idserie , blz there wanted to create a class model episodes she would…
-
1
votes1
answer1874
viewsUse of getter and Setter on Dart
I can not understand the real need to use the Get/Set for the case below, which, even if I leave the variable commotion private, I could still modify it by using methods. class casa { int comodos =…
-
1
votes1
answer714
viewsExpansion Tile and Listview
I’m trying to create this layout for an app, I used an Expansion Tile inside a Card and a listview below, but when I open the expansionTile, if hitting the bottom of the screen happened that and if…
-
1
votes1
answer9962
viewsFormat Number in Flutter
I have the following function that calculates and saves 2 data in my database, but I want to format kwhAparelho and totalAparelho in a way that does not cause periodic tithes and preferably this way…
-
1
votes2
answers1042
viewsHow to check if a file already exists in a mobile directory in Flutter?
I have a method to check certain files. pdf exist in the app folder, I used path_provider to get the path, how do I check if the file exists in the directory? Future<void> checkFile() async{…
-
1
votes2
answers450
viewsHow does the Flutter (Framework, SDK, Dart) architecture work?
In Flutter studies I often get confused, when creating an UI, after all I am using Dart/Flutter (framework) or both? Ex: children: widget.products.map((Product product) { return ShoppingListItem(…
-
1
votes1
answer624
viewsAPI request returns empty in mapped class
I have a problem trying to return the answer of a api in my class. When I try to run my list returns null instead of the api data My class Photo class Foto { final int AlbumId; final int Id; final…
-
1
votes1
answer175
viewsConcept of delegate in Flutter
I saw that there is no support for delegate in flutter, is there any way to implement something like that? I believe that a callback work, I tried to formulate some examples but I’m not able to…
-
1
votes2
answers2133
viewsHow to open another screen in Flutter?
I have an app for QRCODE scanner and I have the following check: // Executa função para o scanner Future _scan() async { String barcode = await scanner.scan(); if (barcode.contains("cx-")) { //…
-
1
votes1
answer1013
viewsTake Textformfield value in double
How can I get the value of a Textformfield in double? I’ve created a Texteditingcontroller, var controller = new TextEditingController(); but the controller.text comes in string and I can’t get it…
-
1
votes1
answer1051
viewsDart Check if a date is valid
How to check if a date is valid in Dart? Even though stating an invalid date does not return any kind of exception import 'package:intl/intl.dart'; void main() { print ('dart');…
dartasked 5 years, 1 month ago rubStackOverflow 7,372 -
1
votes2
answers213
viewsConcatenate Listview into Flutter
I’m trying to display a received list on Json, but I need to concatenate it for better visualization... First case - No concatenation Text(promocoes[index].descrprod) Second case - With…
-
1
votes1
answer2339
viewsFlutter - login screen
Good morning, I am creating a login screen with email authentication and password by firebase. Some layout rendering errors are happening. this is the code: import 'package:flutter/material.dart';…
-
1
votes2
answers482
viewsWhen is it recommended to Initialize a final property in the Class constructor?
The example below is a summary of the original (Bringing it all Together) found on the official Flutter page. On the first call, the class Cart is initialized by the constructor and in the second…
-
1
votes1
answer155
viewsWhat does the * of the reserved words Sync*, async*, Yield* mean?
What does the * of reserved words Sync*, async*, Yield*mean? What’s the difference between them and their similar Sync, async and Yield?
-
1
votes1
answer158
viewsGoogle Maps and Websocket Flutter
All right, come on... I’m developing an application using flutter (I’m new to the Dart language), so I need my application to update the markers of maps periodically along with Websocket, but when…
-
1
votes2
answers165
viewsHow does a const constructor differ from a standard constructor?
In the documentation it says that the builder const Creates an object that will never change. All vars has to be final. So it means that I will have the same result in creating the following…
-
1
votes1
answer1044
viewsHow to generate, encode and encrypt random string in Flutter
I need to generate a 32byte code and encode for Base64, then Sha256 and Base64 again But apparently this code has something wrong and I can’t understand what it is var _random = Random.secure(); var…
-
1
votes1
answer855
viewsDart/Flutter error: 'context != null': is not true
I’m trying to apply a dialog alert every time the item is duplicated but when I do the test it ends up giving this error, someone has some hint how to fix it ? void SalvarMensagem() async { //…
-
1
votes0
answers78
viewsIs there any form of app review in flutter for android that is internal, like iOS?
From what I saw, on Flutter there is no kind of review within the app for Android. I looked in other places and saw that for native there is this possibility, to ask for a review and basically what…
-
1
votes1
answer100
viewsWhat is the meaning of the operator ":" after a Builder on Dart?
I’m trying to understand and adapt a code. I’d like to know what this syntax means: EditMyModelScreen(MyModel p) : editing = p != null, mymodel = p != null ? p.clone() : MyModel(); In particular, I…
-
1
votes1
answer112
viewsHow to condition the display of a Widget list?
I tried to use a if to condition the display of a list of Widgets: children: <Widget>[ if (condicao == true) { Widget(), Widget(), } ], The element type Set < Widget > can’t be Assigned…
-
1
votes1
answer181
viewsWhat are the differences between BLOC x Cubit?
BLOC and Cubit are part of the same package (Bloc) and use the same standard (Bloc - Design Pattern Business Logic Component) which helps to separate the presentation layer from the business rule.…
-
1
votes1
answer38
viewsError printing variables of a class object in code
When executing the code ends up returning me the following: Oi, meu nome é Instance of 'Pessoa'.nome, tenho Instance of 'Pessoa'.idade anos e meu pseudônimo é Instance of 'Pessoa'.pseudonimo. The…
-
1
votes1
answer166
viewsIgnore column alignment in flutter
I’m trying to put a column inside another column, but I wonder if there’s any way to ignore the first alignment, as in the code below: class Login extends StatelessWidget { @override Widget…
-
1
votes2
answers560
viewsCheck Empty Fluttter async return
How can I check if a return async of a particular sqlite is empty? I need to check if the "resultReceita" is null before displaying it in the widget. I tried with an if however, I did not succeed.…
-
1
votes1
answer350
viewsAdd keyboard when using if in Textformfield in Flutter
I am with a plugin to select the country code and a TextFormField to enter the email/mobile. I have a variable to display or not this CountryCode. The problem is that when typing a number in the…
-
1
votes2
answers90
viewsHow to dynamically remove all the treble accents contained in a String?
How to dynamically remove all treble accents contained in a String? Example: "solid synthetic sofa". void funcao(String texto) { var resultado = ''; for (var i = texto.length - 1; i >= 0; i--) {…
dartasked 4 years ago Aprendiz DartPad 17 -
1
votes0
answers302
viewsError: type 'Playlist' is not a subtype of type 'Items'
Excerpt from the Model code: int numero; String localEntrega; String dataHora; String formaPagamento; List<Itens> itens; ListarPedido( {this.numero, this.localEntrega, this.dataHora,…
-
1
votes1
answer184
viewsFlutter Mobx+Modular Data Not Loaded
Opa I’m using mobx+modular in an app, but I’m having a problem, which I think should be a simple mistake my. I have a Controller where I want to save the seller and default customer to always be…
-
1
votes0
answers71
viewsPage Transition - Change Screen After Successful Email Submission Message - Flutter
I’m a beginner in Flutter, I need help with something that although it seems simple I can’t find a solution, not even a widget that helps me with it. Even if it was a direction it would help me! I…
-
1
votes2
answers57
viewsCan I run two flutter projects with different versions on the same machine?
I’m codifying an app in the version Flutter 2.2.2, now I received a task to help in a friend’s app, but his app is in version 2.1.3 and I want to know how I can run these two projects on my machine…
-
1
votes1
answer52
viewsNULL value before incrementing
I am passing values from one screen to another, by clicking a button on the home screen send the data to my profile. But if I do not click this button and go to my profile screen the fields…
-
1
votes1
answer280
viewsAsynchronous function with Futurebuilder returning a list of Widgets
My function was to obtain data from a system and mount the widgets. It was synchronous and works perfectly. children: _confere .obterDados(data) .map( (d) => Conferencia( dados: d, ), ) .toList()…
-
1
votes2
answers1131
viewsConvert Map to String to fill Dropdown in Flutter
I’m having a hard time filling one dropdown. Using data from a query sqflite I have already made the following codes: A Future map that returns my database categories in the following format: [ {…
-
1
votes0
answers809
views -
1
votes1
answer132
viewsDrawer all white, nothing shows up
I’m having trouble creating the SiderBar. The Drawer nothing appears. Everything is blank. My man who calls this file is: import 'package:Cardapio/consts/consts_app.dart'; import…
-
1
votes1
answer694
viewsList on the Query screen the REST API , JSON on Flutter
I’m having trouble dealing with the return of a REST request. API: Rails is working properly. my job Future <Map> _getProdPromo() async { http.Response response = await…
-
1
votes2
answers314
viewsConditional with async in flutter
I have the following function, which returns me either "FREE" or "PREMIUM". The return of the database works perfectly. Here is the code. userInfoConst() async { try { var uid = await…
-
1
votes2
answers1773
viewsHow to sort a list of objects in Dart?
Future<void> _getAllPesagens() async { List<Pesagem> pesagemFinal = List(); await pesagemHelper.getAllPesagems().then((listaP) { print(listaP); if (listaP.isNotEmpty) { for (var peso in…
-
1
votes1
answer131
viewsHow do I pass an authentication token using the signalR client in Flutter?
I have a flutter mobile app that needs to connect to a signalR hub that needs a touch of authentication. In the angular client I do as follows and function correctly: this.hubConnection = new…
-
1
votes1
answer317
viewsProblem updating a list after inserting a data from another page
I have a page that has a list of the names of "students" registered in a given course. Then, I click on a button to add. This button leads to a screen with all the names of the "students". The…
-
1
votes1
answer459
viewsFlutter Dart consuming a lot of RAM memory during build
I have installed the flutter for web, desktop and android. The problem happens in all platforms that I try to run a project, and it takes a long time to build the project, before it didn’t take that…
-
1
votes1
answer365
viewsError retrieving URL from Firebase, Flutter
Good night!!! I am developing an app in which it is possible to post photos. The user opens the camera (or picks it up from the gallery with Imagepicker) and clicks a button on the Appbar. When…