Flutter

<String, dynamic>' is not a subtype of type 'List<dynamic>' flutter

微笑、不失礼 提交于 2021-02-17 07:08:31
问题 Here is my sample json response { "billing": [ { "id": 1, "add_id": 23 } ], "shipping": [ { "id": 2, "add_id": 345 }, { "id": 3, "add_id": 345 } ] } Here is my api receiving part List responseList = response.data['data'];//getting api response after decode List<AddressListGroupModel> listData = responseList.map((f) => AddressListGroupModel.fromJson(f)).toList(); return listData; Here is my model class AddressListGroupModel { List<Add> billing; List<Add> shipping; AddressListGroupModel({this

how to edit an array element present in firestore [duplicate]

杀马特。学长 韩版系。学妹 提交于 2021-02-17 07:03:49
问题 This question already has answers here : Flutter: Update specific index in list (Firestore) (1 answer) Flutter: How to update an Array within an Array in the firestore (1 answer) Closed 9 months ago . I have an array of strings present in firestore. I want to edit the string present at a particular index. How can I do this? For example, let the array be ["help","me","please"]; How can I change "help" to "don't help" in flutter? The closest I've gotten to editing the array is adding an element

Flutter: How to update an Array within an Array in the firestore

放肆的年华 提交于 2021-02-17 06:54:32
问题 banco firestore I need to update a status field in the index array [0] where time == 8:00, I need to pass this status to == "0", only that this array is inside a matrix that here in the image can be seen as a timer. How could I update this vector at index [0] by changing the status = 1 field to = 0? To update a status outside an array and passing the values by hand I am using an example like this for testing only: Firestore.instance.collection("area").document("alergia").collection("items")

Add nested data in Firestore by flutter

倖福魔咒の 提交于 2021-02-17 06:30:27
问题 I'm from following issue. How to manage add and update data in Firebase Initially I can make data in firestore following code. However I would like to add car2 inside of cars after car1 . I have no idea of it. _firestore.collection('members').document(${loginUser.uid}).setData({ 'cars': { 'car1': { 'name': name, 'img_url': 'https://www.xxx.xxx/xxx.png', 'details': { 'type': carType, } } } Please give me advice. 回答1: To add cars2 , then do the following: _firestore.collection('members')

Flutter: EasyLoading library No MediaQuery widget found error

孤街醉人 提交于 2021-02-17 06:18:37
问题 I use EasyLoading library(https://pub.dev/packages/flutter_easyloading). Everything works fine. But when I double click TextFormField this error occurs. I tried to make MaterialApp as root widget and put EasyLoading as child but this time EasyLoading not working. My code: void main() { runApp(MyApp()); configLoading(); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return FlutterEasyLoading( child: GestureDetector( onTap: () { FocusScopeNode

How To Retrieve RadioPreference, CheckPreference values in Preferences in Flutter

让人想犯罪 __ 提交于 2021-02-17 05:52:05
问题 I am having a hard time retrieving the user preference in multiple RadioPreference in a flutter project using the Preferences library https://pub.dev/packages/preferences#. I know how to use SharedPreferences in Flutter but after following the example in the preference page, I can't seems to retrieve the actual user selection. For example PreferenceDialogLink( 'Android\'s "ListPreference"', dialog: PreferenceDialog( [ RadioPreference( 'Select me!', 'select_1', 'android_listpref_selected'),

Flutter :-How to put the view in the Center and Bottom of the screen?

我与影子孤独终老i 提交于 2021-02-17 05:41:09
问题 I am creating the tutorial screen in which the two views like:- one is should be in the center of the screen and another should at the bottom of the screen. But my both view is not proper, please check the below images. I have done some lines of the code to do it but the not getting the proper solution, please check below code once import 'package:flutter/material.dart'; import 'package:page_indicator/page_indicator.dart'; import 'login_screen.dart'; class Tutorial extends StatefulWidget {

How to integrate LINE login into Firebase Auth

你。 提交于 2021-02-17 05:20:34
问题 I did some research and experiments on integrating LINE login with Firebase Auth using Flutter. I have some questions: Looks like in Firebase Auth, there are AuthProvider , and in Flutter source code, I also found an OAuthProvider . There you can create Credential to include your idToken and access token. But I don't know how to specify the providerId in that Credential . I guess it is not possible, because Firebase hasn't integrate LINE login. The client side api: logInWithCredential can

Flutter rounded rectangle border with different colours for each side

南楼画角 提交于 2021-02-17 04:47:46
问题 I'm trying to re-create a button I made with React Native that had different colours for each side giving it a kind of chiseled effect, a bit like Photoshop bevel and emboss, but also with rounded corners. At the moment I have a container outside the button which has the border on it, and inside I'm using RawMaterialButton . The code for the container is like this: Container( BoxDecoration( border: Border( left: BorderSide( color: Colors.black, width: 1.0, ), top: BorderSide( color: Colors

Flutter The Function Color isn't defined or Undefined class Color

Deadly 提交于 2021-02-17 03:35:36
问题 Okay I don't even know what to write. Everything was working fine few hours ago. Then I saw Flutter upgrade is available. So I tried to upgrade. That's when everything started to fall apart. Anyway, I used vpn to run terminal commands. I was successful. After that every single flutter project I am opening is showing this error. I tried with other projects. I can run and build apk but this errors are there. Here is output of run command: Launching lib\main.dart on POCOPHONE F1 in debug mode...