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.

-1
votes
1answer
14 views

How to remove only lines that do not have text in TextField?

I have some input text that contains multiple empty lines, and I want to remove only the lines that have no text before I put it into my TextField. Example: Hello, how are you? // empty line // ...
0
votes
0answers
12 views

How to not add the same item to cart but only Increasing the length?

I'm trying here to not add the same item to cart but only Increasing the exist item length. First i can add the meal from Meal Page by this code with shared preferences List list = []; //Load List ...
1
vote
1answer
13 views

dart + flutter: why doesn't the compiler recognize type mismatches

I'm encapsulating the data of my flutter app inside a class called AppData. It looks a bit like this: class AppData with ChangeNotifier{ List<word.Word> _words; UnmodifiableListView<word....
0
votes
0answers
15 views

How can I Add a interactive favourite Icon

I'm trying to add a favourite icon to send that field to other page. I already try other solution but nothing work for my problem. I think what I want is possible but If that is impossible say it pls ...
0
votes
2answers
17 views

Uploading Set<String> gives error in flutter

Okay, so I'm creating chips tiles that are stored in a Set, but when I try to upload it to firebase I get this error "Unhandled Exception: Invalid argument: Instance of '_CompactLinkedHashSet'" I ...
0
votes
0answers
8 views

How to catch errors in GoogleSignIn signInSilently?

I have the following code that I am using to log a user in silently try { result = await GoogleSignIn().signInSilently().catchError((x) { print(x); }); } catch (e) { print(e); } ...
0
votes
0answers
6 views

Cloud-functions: How can I configure it to call functions running on localhost

Flutter cloud_functions plugin - How do I configure it to call functions running in localhost I am trying to remove all the hardcoded cloud functions url from my app so that I don't have to different ...
0
votes
0answers
14 views

How to load multiple images from FirebaseStorage in flutter when permissions is needed?

What I'm trying to do is to show list of items as Card widget each. So each Card will contains an Image, title, text, button.. similar to this: steps are: 1- Load products-data from Firebase-Store ...
0
votes
1answer
23 views

Container decoration disappears after TextFormField click

When I click on container with child TextFormField, decoration disappears. This is the current behavior of the app: Seems like a problem with backgroundBlendMode property, but I can't figure out, ...
0
votes
1answer
9 views

If we have 3 BLoCs in the BlocProvider, Can we use 2 BLoCBuilders in the same class?

Suppose I have 3 BLoCs in the BlocProviderTree, it means that these blocs are available for the class. one of them is used as BlocListener, now I want the other two BLoCs to be used as BlocBuilders ...
0
votes
0answers
23 views

BottomNavigationBar showing overflowing warning on hide

I am hiding my bottomnavigationbar upon scroll. The hiding works as expected but the navigation bar thinks it is an issue and it's showing render overflowing warning message. How do I fix it? I am ...
1
vote
1answer
24 views

Use Navigator.push (MaterialPageRoute) instead of AlertDialog

I would like to use Navigator.push (MaterialPageRoute) instead of AlertDialog as now I think its better for my user to have a full page to post content rather than a dialog box, how would I go about ...
0
votes
0answers
20 views

Dynamic DropdownButton, when value change ui does not render

$ flutter doctor flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 6.1.7601], locale zh-CN) [√] ...
0
votes
1answer
16 views

Flutter Remove Multiple List Items In For Loop (Multiple Returns In A For Loop)

I have a list of food items. That has a category, subCategory1, subCategory2 ect. When the user unselects an category item. They are also unselecting the subCategory1, subCatategory2 items etc as ...
0
votes
3answers
17 views

How to add an Onclick event to an image which is inside CircleAvatar Widget in flutter?

I have a circular image inside circleAvatar on clicking which I want to open an alert dialog box. My question is how to add clicking event inside CircleAvatar? This is my code : Column(...
0
votes
1answer
15 views

`Thur, Aug 23` Date format with flutter

According to the documentation, it seems that it is only possible to manipulate dates with a numeric format, and not letters. Does a package exist if I want to display date with the format Thur, Aug ...
0
votes
2answers
25 views

Using Flutter and Dart, how can I get this Future to work?

I know that there are other ways of achieving this, but I want to use a Future via initState() to obtain a List using SharedPreferences. The following illustrates what I want to achieve, but it does ...
1
vote
0answers
21 views

How to pass List of Custom Objects using Dart's http?

I am trying to pass List of Custom Object to my API. Following is my code import 'package:meta/meta.dart'; import 'package:json_annotation/json_annotation.dart'; part '...
0
votes
0answers
11 views

Passing FCM subscription details to a web view

No idea if this is possible. Essentially we have a number of web apps but we have a requirement to create a native mobile app which can act as a sort of hub to access the relevant apps in one place. ...
0
votes
1answer
6 views

Can I have lambda expression that simply gets object property in Dart2?

So If I have colelction of some objects like List<QueryParameter> params=[.....] class QueryParameter { String name = null; } Is there a shorter version of lambda that simple gets property ...
-3
votes
1answer
31 views

List Item UI design with flutter

I am beginner for flutter. I have one lock icon image, that need to display half within cell and half out of cell. I want to create UI for ListItem. I already write code as below, but it not ...
0
votes
1answer
17 views

How to unit test connectivity package in Flutter

I'm using connectivity package and let's say I have the following code: _connectionSubscription = Connectivity().onConnectivityChanged.listen(( ConnectivityResult result) { if (result == ...
0
votes
1answer
17 views

removeWhere in list of files

I have a File which contains all the names of all the files I've created and I decode it into a Map which then has the following formate: {"fileList.json":"false", "testwert_0_.json":"false", "...
0
votes
2answers
18 views

How to pass variables inside bottomNavigationBar tabs

I'm trying to implement bottomNavigationBar, but I need to pass a variable that i get from another page, to one of the tabs. I tired access via widget, but it didn't work. How can i solve it? ...
0
votes
1answer
29 views

type 'String' is not a subtype of type 'int' of 'index' after firebase rule change

I'm working with flutter and firebase. I want to be able to read part of the firebase database before the authentication process to fetch a whitelist of users, but as soon as I change the firebase ...
1
vote
2answers
24 views

Flutter: Block Gestures to underneath widgets

I have a stack with some widget, and I want tat the most in top widget blocks all the gestures to the underneath widgets. I've tried with a GestureDetector and opaque behaviour but does not work. ...
0
votes
0answers
23 views

How can I remove object from object that contains list of objects?

I have flight and price data. As you can see from bellow, I have created Flight and Price classes to hold this data. The Search result class is used as container(result) to hold the price for ...
-2
votes
4answers
31 views

Parse JSON to Map in flutter

I get response from backend: {"measurements": { "pm10": { "name": "pm10", "value": 20.8647, "unit": "µg/m³" }, "pm25":...
0
votes
2answers
19 views

Convert Stream<Stream<T>> to Stream<T>

I am using rxdart package to handle stream in dart. I am stuck in handling a peculiar problem. Please have a look at this dummy code: final userId = BehaviorSubject<String>(); Stream<T> ...
0
votes
0answers
11 views

Is there any reasonable way of mixing json_serializable and built_value models in a project?

The problem is as follows, I have a flutter project with some classes using built_value and some classes using json_serializable. Both work fine separately but use very different ways of serializing/...
0
votes
0answers
7 views

Flutter: Using texture from flutter_webrtc for image processing in firebase_ml_vision

We're using the flutter_webrtc package to make peer-to-peer video calls. However we need to do some image processing on the camera image using firebase_ml_vision. There are lots of examples on how to ...
0
votes
0answers
28 views

How to avoid Textfield validation causing overflow in column

There is a validation in the Textfield and it causes render overflow whenever it is triggered on small devices. I believe the Textfield with error message larger than its parent(a column widget inside ...
0
votes
1answer
33 views

Fetching data from DB and populate a partitioned List

I am confused about this both from front end point of view as well as querying the data from SQLite Database. If you have any idea how to solve either of these please do answer. SQLite Database I ...
0
votes
1answer
18 views

Flutter - How to make lazy loading on PageView?

As part of my screen, I have series of item that need to swipe ("Horizontal ListView"), there's one class, PageView but i dont want to load all of them in one time. Instead, i want it need to be lazy ...
0
votes
1answer
17 views

How to get “Apps Instance Id” in Flutter

i want to setup firebase inapp messaging on my flutter apps. first, it need FirebaseInstanceId as explained here, so i can test send message to my device. However the document does not tell more ...
1
vote
1answer
24 views

How to create a matrix in Dart?

I have a List<String> and I want to create a square matrix (2-dimensional array/list) of Set<String> with the same dimensions as the length of the List<String>. I tried using List....
0
votes
2answers
30 views

How to pass the widget as a parameter to the function

I want to pass some widgets as a parameter to function, does flutter support that? Below is my code. Should I pass a widget as a parameter to function? This is the widget that I want to pass as a ...
0
votes
1answer
20 views

invokes a class that contains static getUser () in the future

I have a API controller named user_controller.dart static getCompany() async { return await Http.get("user/getCompany"); } how to call user/getCompany in future if this is the code I have ...
0
votes
1answer
15 views

Proper syntax for directly printing instance properties to console in Dart (not simply printing a variable that is in scope)

In Dart/Flutter, suppose you have an instance a of Class Y. Class Y has a property, property1. You want to print that property using string interpolation like so: print('the thing I want to see ...
0
votes
0answers
10 views

Which Flutter package to use for communicating with apache-kafka?

I am building a new application which includes Apache Kafka at the back end. Front end I am planning to use Flutter and do not see any packages / libraries which I can use to connect both.
0
votes
0answers
23 views

Flutter throws Invalid arguments(s) error when starting the app after upgrade

I upgraded flutter and and run my app, but it won't start and throws invalid arguments error. I tried switching from dev and master channels and run flutter doctor on the terminal, but problem ...
0
votes
0answers
19 views

FLUTTER: How to listen to Firestore's Collections changes ? ( Document Creation / Deletion )

I use STREAMBUILDER in Flutter to update my App according to documents values changes inside my Firestore Database Collections. Everything works perfectly and my App's UI gets updated accordingly to ...
0
votes
1answer
30 views

Using tabs to navigate screens in flutter

The tabs page have three tabs- Nearby,Recent and Notice tabs. Tabs.dart- class Tabs extends StatelessWidget { @override Widget build(BuildContext context) { return Row( ...
0
votes
1answer
27 views

Error when trying to make portion of page scroll

I keep getting errors when I try to make a portion of the page be able to scroll by adding SingleChildScrollView. So this is how it looks like now: So the portion in between the red lines is what I ...
0
votes
0answers
26 views

Flutter Gradle failure cause by AndroidX incompatibilities

I just add firebase_messaging to pubspec.yaml and run the app. After that, I got error that describe it might be some issue with the gradle because of AndroidX incompatibilities. What seems to be the ...
1
vote
1answer
27 views

Dart 2.1.0 smart cast using 'is' not working

I'm using the Bloc pattern and have the following code to define my states: import 'package:meta/meta.dart' @immutable abstract class UiState {} class Loading extends UiState {} class Success ...
0
votes
2answers
34 views

convert array to be displayed in the list

I tried to display the output of this data into a list but it can't this is my data output {activity: {"project":" Distributions","code":2000,"code_name":"OpenProcessSnapshot","activity":{"...
1
vote
0answers
22 views

calculate the space time complexity of dart and flutter programs

do we have a dart lib readily available to calculate the space-time complexity of dart programs? I am building an automated CI CD pipeline, and to do code quality control we need to implemented ...
0
votes
3answers
38 views

how to get the TextFiled value outside the widget

the TextFiled class class InputContainer extends StatefulWidget{ final _InputContainerInner input = new _InputContainerInner(); @override State<StatefulWidget> createState() { return ...
0
votes
0answers
16 views

How to fix api key issue flutter/firebase [on hold]

I keep on receiving the following error when I attempt to authenticate through my android emulator/physical device. An internal error has occurred. I have not found any solutions to this problem. I ...