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.

0
votes
0answers
7 views

how to set initial(default) value in dropdownButton?

How to set initial value from cache to dropdown button? have submitted button, if click submits button should add to drop-down button value. Now it's working. I need to add initial value to the drop-...
0
votes
0answers
9 views

SQFlite slow transactions

Is there something wrong with my code below? Cause transaction takes 5x to 10x more time than without transaction. If I compare to Kotlin, the no transaction time is much closer to what it should be. ...
0
votes
0answers
5 views

How can I create a zip file from a Json in Dart?

I've downloaded the Dart archive package, but the documentation is kinda empty. I've got an object that I need to serialize in a File format, and compress it in a zip. This is what I've managed to ...
0
votes
1answer
8 views

Getting Uncaught Error: Invalid argument: null. in Dart

I'm trying to draw a bouncing ball on a canvas created using dart and html bu I keep getting the error Uncaught Error: Invalid argument: null. What do I need to change? I'm pretty new to dart and I'm ...
-4
votes
0answers
20 views

How to implement post api in flutter

I am implementing post API in flutter for login with parameters like G mail and Phone Number. I have confused to make that. I need a complete solution of calling a Post API. Will anyone help me ...
0
votes
0answers
8 views

does buildSuggestions of showSearch method run continuously?

I'm new in flutter and I have a function to search working with API,and i have created a function called _fetchData() inside StatefulWidget: _fetchData() async { print("fetchData Run"); print(...
0
votes
0answers
11 views

Deep Linking: Refresh leads to crash

I have developed a angular-dart app and deployed it to domain.tld/subdirectory/ on my apache2 server. I have created a .htaccess file and configured the index.html with a base href="/subdirectory/". ...
-1
votes
0answers
14 views

How do I get the phone number when there is an incoming call in flutter?

How do I get the phone number of an incoming call and SMS in flutter?
0
votes
1answer
16 views

Flutter : Custom TextFormField is not saving values onSaved

onSaved is not saving my values in the main class from where i am calling this class i want to generate custom form as per api return data and bind the data in form and then it should validate as ...
1
vote
1answer
27 views

The method 'add' was called on null

I try to parse my firebase collection and return a list of Service type. Here I have replaced my firebase call and parsing with a hard code for simplify it. Future<List<Service>> ...
0
votes
0answers
13 views

How to get Firestore fields and update local variables for widgets

I can't get Firestore to look up items with a document ID and obtain the fields from those documents to update my local variables. I am attempting to use QR codes for a library checkout system ...
0
votes
0answers
11 views

Static Final Firestore and CollectionReference

I'm using Flutter and created a "util class" (abstract) for Firebase, something like this: abstract class FirebaseUtil { static final Firestore _firebaseRef = Firestore.instance; static ...
0
votes
0answers
9 views

How to get the values of a mergeWith stream using RxDart?

I have many streams that I would like to combine into one stream. I'm trying to use mergeWith and it seems to be working but I'm not exactly sure how to get the values of the returned Observable. I ...
0
votes
1answer
25 views

How to write chain functions DART?

I'm writing the flutter application and need a chain function. I found some solutions but it didn't work for me. How it's written? For example.(i written custom get function) get().addHeader(value:...
0
votes
0answers
8 views

Live-streaming via camera for firebase with flutter/dart

Is it possible to add live-streaming via flutter/dart? Is the camera on dartpub good enough? I want the livestream to be able to connect to firebase.
0
votes
0answers
18 views

get the contents of my dropdownbutton in a variable

Hello I'm a student and a flutter apprentice, I'm trynna get the contents of my dropdownbutton in a variable in order to fetch all the informations on my showDialog (_showDialogVerif) as you can see ...
0
votes
0answers
12 views

PlatformException throw unexpected

I call method in ScopedModel from outside ScopedModel (on button press). But PlatformException is not catch as I expect. PlatformException is only catch in ScopedModel Method try/catch. It is not ...
1
vote
1answer
16 views

How to get access scoped-model models

I am trying to get access to my models at _buildProductCard widget: Widget build(BuildContext context) { return ScopedModelDescendant<ConnectedProductModel>( builder: (...
0
votes
1answer
43 views

App store iOS app is getting rejected for Performance: App Completeness issue

After reviewing my Flutter app, it was rejected with the following information. I am not sure what the exact problem might be. Below is what apple has to say about why my app is rejected. 1 ...
1
vote
0answers
23 views

Shrink ClipRect to its content

I use a ClipRect to only show a part of a widget, but I need it to shrink to its content. Is there any way to do that? class ClipExample extends StatelessWidget { @override Widget build(...
0
votes
0answers
15 views

Flutter. Set ListView initial position on an very large ListView

I want to create an almost infinite list of element, but I want to set the initial position of the list to some specific element. Something like this image: Where index 0 would be the initial ...
0
votes
1answer
19 views

how to make row enter new line if width is filled

I have a container which contains a row .. this row has set of items .. i want when the items in the row reach the end of the container width.. to start a new row inside the container .. this is what ...
0
votes
0answers
8 views

Per platform dependencies

I need to include a dependency only for the Android version, is it possible? And if so can something similar to #if DEBUG #else be used to add it in some .dart files only for the android version of ...
0
votes
0answers
31 views

Flutter dart function skipping to end of function after await

I have a function with the keyword async and after the await is done, it skips a bunch of lines of codes and goes to the end of the function after the await is done. Does anyone know what I am doing ...
0
votes
0answers
5 views

getting _CompileTimeError while running WebViewScaffold

i am working on a flutter project which shows the details of a selected news and uses the url of its source information, i want to show that website on my flutter app using WebViewScaffold. this is my ...
0
votes
0answers
11 views

Accessing multiple calendars in flutter

We need the ability to access multiple google / Apple calendars from flutter. We are using the plugin "device_calendar: ^0.0.7". It works great but now the requirement is the ability to connect to ...
0
votes
0answers
15 views

How to have persistent badge icon on iOS using Flutter

Is it possible to use flutter to keep the notification badge on the app icon even after opening and closing the app? Ex.: user has a badge of value 6, opens app to read one message, closes app, badge ...
0
votes
0answers
14 views

How to get SHA256 code for object in dart?

I need to get sha256 code (hex string) for Object. I can get this for String - the result will be equal (verified on some online sites); But I dont know how to get sha256 for dart Object, not for ...
0
votes
1answer
37 views

How to use timer in flutter app for changing data?

I am using shared preferences to store the token, email, username and other user details when a user logs in using firebase authentication. The firebase token expires in every one hour so I need to ...
0
votes
0answers
15 views

How to enable TabBarView swiping between tabs, only in one direction from a particular tab?

I mean the user can swipe backwards but not forward from a particular tab, is there any way this can be achieved? any help is very much appreciated.Thanks.
0
votes
1answer
26 views

unable to open a browser URL through flutter app

I am making a news app, which shows a list of news with title, description and url of its source website. this is my newsDetail.dart page import 'package:flutter/material.dart'; import 'package:...
0
votes
0answers
12 views

How to set project environment on Ubuntu to interact with soap web services?

I need to use ubuntu (my dart server is there) to call soap web services wsdl and convert to data to json. For this I was planing to use monodevelop on ubuntu 18.04. My main aim is to allow my ...
0
votes
0answers
16 views

Scrolling issue in Iphone

The slider is giving me an error due to iPhone offset scrolling. How to disable offset scrolling in the flutter for iPhone. ` Slider( key: ValueKey('slider'), label: "time", activeColor: Colors....
0
votes
1answer
14 views

OverlayEntry.remove() doesn't remove the entry from the overlayState

I'm writing a flutter app using Flutter 1.2.1. inside the initState() of my StatefulWidget I call a showOverlay() function that I created with the following code: void showOverlay(BuildContext ...
0
votes
0answers
15 views

Dynamic Link not found with Flutter Firebase Auth Passwordless SignIn (SignInWithEmailAndLink) in Android

I'm trying to use the new passwordless sign-in method implemented in the Flutter firebase_auth package. I already followed the steps in order to receive the verification email, but after pressing on ...
0
votes
0answers
10 views

In dart, how to use DES/ECB/PKCS5Padding to decrypt?

This is the code in Android : val sr = SecureRandom() val dks= DESKeySpec(KEY.toByteArray()) val keyFactory = SecretKeyFactory.getInstance("DES") val ...
1
vote
1answer
16 views

How to properly override operator [] of MapBase

I created a simple class, extending MapBase<String, String>. All looks well, except the operator [] override. This is the code: class MyMap extends MapBase<String, String> { Map<...
0
votes
1answer
16 views

How to customize json_serializable library code generation?

I use json_serializable library and firebase for database. I need to serialize and deserialize my data class to/from JSON. But firebase json format looks like this { 'some_id_here': { 'title': ...
0
votes
0answers
10 views

Keypress on Enter trouble finding a solution

I'm looking for a way to change this line of code, instead of getting my search result onChange, I want to get them on Enter keypress in an input field. onKeyPress seems like the best option to ...
0
votes
0answers
16 views

Firebase get call works on android, but has a strange behaviour on iOS

I have a flutter application that is already used by my client for almost 2 months on android and now I have to make the iOS version as well. When I try to run a get call with the userAccount.id, I ...
-2
votes
0answers
40 views

How to make a background listener like “OK GOOGLE”? [on hold]

let me tell you about my idea, I need to make a background listener like " OK GOOGLE" in order to launch my app automatically without looking for it on the menu.
0
votes
0answers
14 views

How to fix firestore reading/writing data continuously even when no write/read operations have been invoked

I am using bloc pattern as described in https://github.com/boeledi/blocs for my application. In the application, I am basically fetching and writing data to and from firestore. Recently I noticed that ...
0
votes
1answer
48 views

How to get same result with Dart sha256 and C# sha256?

I have to convert string to sha256 in dart. For example I use String a = "2424242401224672"; In my code below I get an result as; digest: ...
0
votes
1answer
27 views

How to load all images on assets folder once?

Error message The method 'add' was called on null. I/flutter (10160): Receiver: null I/flutter (10160): Tried calling: add(Instance of 'SvgPicture') I/flutter (10160): I need to add all SVG ...
0
votes
2answers
39 views

“as” keyword do in Dart language

I'm confused as to the uses of "as" keyword. Is it a cast operator or alias operator ? I encountered the following code on the internet which looked like a cast operator: var list = json['images'] ...
0
votes
0answers
18 views

RenderAspectRatio has unbounded constraints

I'm trying to build a scroll slider in a flutter app using this code to give to build the constraints: var cardAspectRatio = 12.0 / 16.0; var widgetAspectRatio = cardAspectRatio * 1.2; AspectRatio ( ...
1
vote
0answers
18 views

How to enable --control-flow-collections

Trying to use Dart 2.3's new for() syntax in Flutter and the IDE provides an error stating: "This requires the --control-flow-collections experiment to be enabled". How do I enable this?
0
votes
0answers
25 views

Detect vertical swipe direction in Flutter

How to detect when the user swipe vertically either upward on downward? I have been using swipedetector package, but now, it gives me exceptions like The getter 'globalPosition' was called on null.
0
votes
1answer
29 views

How can I wait until widget is built before pushing a route?

New flutter dev here. In my testing I've noticed that pushing and popping embedded platform views can cause a Flutter app to drop frames. Is there a way that I can wait until a widget is built before ...
1
vote
0answers
31 views

Is there a way of getting feedback from a Future function in Flutter

I have this Future function that takes a lot of time to load, and it works basically like a video render (it executes some steps 100 times). Is there a way I could display the progress in a widget? I ...