Flutter

Flutter & Firebase : How to check if my picture is uploaded to Firebase Storage Successfully?

拈花ヽ惹草 提交于 2021-02-10 20:04:27
问题 Flutter & Firebase : How to check if my picture is uploaded to Firebase Storage Successfully? I am trying to find a way to see if the picture was upload successful so that I can start and stop my LoadingScreen() . final StorageReference firebaseStorageRef = FirebaseStorage.instance .ref() .child('$path/${userID}_${timeStamp}_${number}_${tag}.jpg'); final StorageUploadTask uploadTask = firebaseStorageRef.putFile(image); I am looking forward to hearing from all of you. Thank you in advance! 回答1

How do I add a container at the end of my grid view in Flutter?

ε祈祈猫儿з 提交于 2021-02-10 19:53:53
问题 I have a GridView and I want to add a bannerAd after the gridview scroll ends. The bannerAd is called from the dependency https://github.com/kmcgill88/admob_flutter. The code for the GridView is as follows Widget build(BuildContext context) { SystemChrome.setEnabledSystemUIOverlays([]); return WillPopScope( onWillPop: () async { return true; }, child: Scaffold( body: Container( decoration: BoxDecoration( gradient: LinearGradient( colors: [const Color(0xFFFEFEFE), const Color(0xFFFEFEFE)],

Flutter - Dynamically adding widget that needs to change state as well

不羁的心 提交于 2021-02-10 19:52:27
问题 What I want to achieve is explained below:- To show several widgets by clicking a button. The dynamically displayed widgets are basically FlatButtons with Icons as child. So when I click these buttons, I want the icon to change. However, on testing it - I found that their state doesn't change. Below is a sample code import 'package:flutter/material.dart'; class Test extends StatefulWidget { @override _TestState createState() => _TestState(); } class _TestState extends State<Test> { IconData

i want to display data in DropDownButton From rest api using flutter

断了今生、忘了曾经 提交于 2021-02-10 19:51:36
问题 I was trying to get data from api and display it into DropDownButton I want to get country name and country id from api My code is: My get function List country_data = List(); String countryid; Future<String> country() async { final prefs = await SharedPreferences.getInstance(); final key = 'session_id'; final value = prefs.get(key ) ?? 0; var res = await http.get( Uri.encodeFull("http://husam.from-ar.com/api/api-ad/en/1"), headers: {"Accept": "application/json", "Authorization" : "$value", }

i want to display data in DropDownButton From rest api using flutter

若如初见. 提交于 2021-02-10 19:51:08
问题 I was trying to get data from api and display it into DropDownButton I want to get country name and country id from api My code is: My get function List country_data = List(); String countryid; Future<String> country() async { final prefs = await SharedPreferences.getInstance(); final key = 'session_id'; final value = prefs.get(key ) ?? 0; var res = await http.get( Uri.encodeFull("http://husam.from-ar.com/api/api-ad/en/1"), headers: {"Accept": "application/json", "Authorization" : "$value", }

Flutter - How to change state from inside another widget

爷,独闯天下 提交于 2021-02-10 19:50:38
问题 I'm trying to implement both a Drawer and the Bottom Navigation Bar. The below class NavigationHomeScreen is my home screen and when the user clicks a menu item in the Drawer the Changeindex function updates the screenView I would like to know how I can similarly update the screenView but from the BottomNavigationBarApp using the onTabTapped method. class NavigationHomeScreen extends StatefulWidget { @override _NavigationHomeScreenState createState() => _NavigationHomeScreenState(); } class

Flutter Mixed Layout - Grid with Rows

99封情书 提交于 2021-02-10 19:39:20
问题 I'm trying to create a basic Flutter app that has a a 2 by 2 grid of text inputs & a button below it. Initially, I just had the grid & no buttons with no problems: void main() => runApp(new App()); class App extends StatelessWidget { ... Widget build(BuildContext context) { return new MaterialApp( ... home: new InputWidget() ... class InputWidget extends StatefulWidget { Widget build(BuildContext context) { ... _InputWidgetState createState() => new _InputWidgetState(); ... class

How to Navigate from ChangeNotifier?

﹥>﹥吖頭↗ 提交于 2021-02-10 18:43:42
问题 I am learning about provider + ChangeNotifier for state management, but I can't find any official guidance on how to implement a Navigation from a ChangeNotifier . Let's say we improve the provider_shopper sample here, so when the user clicks BUY, the CartModel does some buying logic and then Navigates to a Order Review page. How's this navigation should be implemented? Do we provide a callback for the CartModel , so it will call it and trigger a Navigation on the UI? 回答1: There might be a

Flutter app is running on Android Emulator but not on Physical Device (OnePlus 7T)

∥☆過路亽.° 提交于 2021-02-10 18:33:44
问题 When I run my flutter app on Android Emulator it runs without errors but when I am running it on my mobile device it shows following error in Debug Console: Launching lib\main.dart on HD1901 in debug mode... FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugKotlin'. > Could not resolve all artifacts for configuration ':app:debugCompileClasspath'. > Failed to transform artifact 'arm64_v8a_debug.jar (io.flutter:arm64_v8a_debug:1.0.0

how to open a 'csv file' like 'url launcher' in Flutter

て烟熏妆下的殇ゞ 提交于 2021-02-10 18:29:38
问题 i converted list into File of .csv extension then tried OpenFile.open and ended up with error No permissions found in manifest for: 2 , tried canLaunch and ended up with error name.csv exposed beyond app through Intent.getData(), Failed to handle method call so how to open that csv file in any 3rd part application. 回答1: You can copy paste run full code below and make sure you have a file /sdcard/Download/sample.csv , see picture below You also need CSV Viewer installed in your Emulator code