Flutter

How to get ListView builder data using api response in flutter ui using provider

狂风中的少年 提交于 2021-02-11 12:35:08
问题 Im trying to get an response from provider and fetching in a ui page but when i try to add an response to ui it shows an error The getter 'data' was called on null. Receiver: null Tried calling: data In this Line: ListView.builder( physics: ClampingScrollPhysics(), shrinkWrap: true, itemCount: doctorList.data.length, primary: true, is this is correct approuch or need to change modal class or ui integration. im accessing data through doctorList.data.->datas data. My response modal class.

Flutter Save multiple forms Data, from a another widget

二次信任 提交于 2021-02-11 12:32:30
问题 I am trying to display a list of flutter forms with a list view builder. UI for which I have already done. I want to access the data now for each form and validate, can someone guide me? i tried different approaches and checking similar posts on StackOverflow, but was not able to find any solution for the same. entries_widget.dart - where the form is created class EntriesWidget extends StatefulWidget { EntriesWidget({Key key}) : super(key: key); @override EntriesWidgetState createState() =>

White bottombar only on the new ios version

旧城冷巷雨未停 提交于 2021-02-11 12:32:17
问题 Does anyone know how to get rid of the white bottom bar(aka home indicator) (see picture). It appears only on IOS 14 devices and more specific on devices without a homebutton. Thanks. Edited: It appears only when a bottombar is implemented. bottomNavigationBar: BottomAppBar( child: Container( decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [Colors.deepPurple[400], Colors.deepPurple[700]]), ), height: getBottomBarSize(),

Change bottom navigation current index and update setState() from another screen class

左心房为你撑大大i 提交于 2021-02-11 12:32:14
问题 Here is my bottom_bar screen. I want to change the bottom navigation menu from another screen button click. How can I resolve this problem?. is there any option that can navigate bottom_navigation from another class. I didn't get any accurate answers through search. [N.B: I am totally new in flutter. Please forgive me if there is any type of misconception ] @override Widget build(BuildContext context) { final themeNotifier = Provider.of<ThemeNotifier>(context); return Scaffold( key:

Use basic classes like `Offset`/`Color` in Dart without Flutter

血红的双手。 提交于 2021-02-11 12:32:06
问题 I want to use those basic classes (such as Offset , Size , and Color ), in a pure- dart program. I cannot import them in a pure dart project. How can I use them? Those classes are really fundamental and quite helpful. For example, with Color (and Colors ) the color system can be easily used. So I would appreciate it if I could use them. I have tried this, but it gives me the following error: Error: Not found: 'dart:ui' . I have also tried copying and pasting, but that is a bit ugly... 回答1:

Running flutter web app locally without android studio

岁酱吖の 提交于 2021-02-11 12:31:54
问题 I have a flutter app using Firebase's cloud firestore. I've done the web build and running it on Chrome through Android Studio works well. I would like to share my web app progress to my client but don't want to host it (because it's not finished yet). Hence I'd like to find a way to run it locally the same way you can do it with Android Studio but without needing to install Android Studio (and hopefully not requiring to install flutter either), so that I can send the build file to my client

HTTP POST request to PHP REST API using Flutter

 ̄綄美尐妖づ 提交于 2021-02-11 12:31:40
问题 So I have been at this for way way too long but I just can't figure out why this isn't working what I'm trying to do is send some JSON post data to an existing PHP REST API that I've created and then read that JSON data like $_POST["username"] and I can't really change how the API works as it's used by another application which it works perfectly with so it's something to do with my flutter code but I'm not sure what as I started learning it today. My flutter code: import 'package:http/http

How to increase Firebase Authentication Session Time using Flutter?

别说谁变了你拦得住时间么 提交于 2021-02-11 12:30:14
问题 I developed an Agro App and I have enabled offline persistence because, after logging in, operators can spend 3-4 hours recording information offline until they return to the central point where there is internet. The problem I have is that sometimes the application asks for credentials (login and password) again when they do not have internet, which means that they cannot record information offline or they have to go back to the central point to authenticate which is not efficient. I

Flutter build iOS FAILED

痴心易碎 提交于 2021-02-11 12:29:40
问题 I build a new flutter project from VSCode, and run on iOS simulator (iphone 11), it shows: Launching lib/main.dart on iPhone 11 in debug mode... Xcode build done. 11.2s Failed to build iOS app Error output from Xcode build: ↳ ** BUILD FAILED ** Xcode's output: ↳ error: unable to spawn process (No such file or directory) (in target 'Runner' from project 'Runner') error: unable to spawn process (No such file or directory) (in target 'Runner' from project 'Runner') note: Using new build system

How can I wait for data before it is available - flutter

时光怂恿深爱的人放手 提交于 2021-02-11 12:28:01
问题 @override void didChangeDependencies() async { if (_isInit) { print('First stat'); final restaurant = await Provider.of<Restaurants>(context, listen: false) .fetchAndSetRestaurants(); print('test'); } _isInit = false; super.didChangeDependencies(); } bool showFavourites = false; @override Widget build(BuildContext context) { return Scaffold( //bottomNavigationBar: BottomNavBar(), appBar: homeAppBar(context), body: SingleChildScrollView( child: showFavourites ? Padding( padding: const