Category "dart"

How to set data to TextEditingController using StreamBuilder?

I'm loading some data from database (data that user previously saved, for editing). I used StreamBuilder to set data. I have form , which i used to display data

How to update a single item in flutter list, as a best way

How to update a single item in flutter list? I need best way. Why I am saying best way? I need to update a single item and dont want when update a single ite

Combine/merge multiple maps into 1 map

How can I combine/merge 2 or more maps in dart into 1 map? for example I have something like: var firstMap = {"1":"2"}; var secondMap = {"1":"2"}; var third

Listen to real-time change in Flutter from node.js api (mysql database)

I created my own api for (get/post/put/delete) methods using node js.....and implemented in flutter....how can i get real time change (change state without ref

In Dart, is it possible to pass an argument in a singleton?

class Peoples { late int id; late String name; static final Peoples _inst = Peoples._internal(); Peoples._internal(); factory Peoples() { retur

dart modulo operator circular list

I want to use the modulo (%) operator in order to access to list items in a circular way. But the code below doesn't work: void main() { List<String> my

How to get the snapshot.error in Flutter 2?

I updated my Flutter app to Flutter 2, and now when I try to get the snapshot.error in my StreamBuider I get this These are validators with Streams. class Logi

Dart InternetAddress.lookup failed for the local network, but works for google.com

Dart unable to connect the server running on the local network. In below code I am trying to find weather or not my host is reachable before making the API requ

Flutter - FloatingActionButton in the center

Is it possible to make the FloatingActionButton in the centre instead of the right side? import 'package:flutter/material.dart'; import 'number.dart'; import '

Flutter - Wrap text on overflow, like insert ellipsis or fade

I'm trying to create a line in which center text has a maximum size, and if the text content is too large, it fits in size. I insert the TextOverflow.ellipsis

How to check if the user is logged in, if so show other screen?

My first screen is a login screen and it needs to check if the user is logged in to open the home screen directly but I get an error using this check. I'm doin

Dart, Nested classes, how to access child class variables

I am new to Dart/Flutter. So forgive me. I am trying to create a Object class mentioned as TestData below. And one of the variables in TestData is a Map of Test

Flutter - How does it work behind the scenes?

Obviously, flutter is a framework for running apps on iOS and Android using one codebase. But how does it manage to do so? Will it compile to native code, or is

MissingPluginException for Linux desktop app

Just added desktop support to my flutter app, it runs fine in the android emulator, but wont render any element in neither browser nor desktop, just a simple bl

Trailing widget consumes entire tile width. Please use a sized widget, or consider replacing ListTile with a custom widget

I am making a basic shopping app .My idea is to make a list tile of my products so that I could edit or delete the products . So when i navigated to that page

Send notifications using REST api

I want to use the http package to send notifications to topics through the flutter app using the docs as in https://firebase.google.com/docs/cloud-messaging/sen

Flutter: json_serializable ignore nullable fields instead of throwing an error

Suppose there are two models User and City @JsonSerializable() class User { int id; String name; City? city; List<Map<String, City>>

RangeError (index): Invalid value: Valid value range is empty: 0

I am trying to fetch a list from API that is two methods fetchImages and fetchCategories. the first time it is showing a red screen error and then after 2 secon

RangeError (index): Invalid value: Valid value range is empty: 0

I am trying to fetch a list from API that is two methods fetchImages and fetchCategories. the first time it is showing a red screen error and then after 2 secon

How do you round a double in Dart to a given degree of precision AFTER the decimal point?

Given a double, I want to round it to a given number of points of precision after the decimal point, similar to PHP's round() function. The closest thing I can