dart

Build Flutter app in release mode for iOS

核能气质少年 提交于 2021-01-21 06:19:42
问题 I have Android Studio with Flutter plugin installed. Flutter SDK is also installed on my Mac through Android Studio and I know path to it. I want to run my app in release mode on real iOS device. Not only to hide "slow mode" banner that can be done using this code as I know new MaterialApp( debugShowCheckedModeBanner: false, ... but also to check how my app works. I found this instructions https://flutter.io/ios-release/ but still can't build app in release mode. Each time I try to run

Provider to a different page not working as excpected

我怕爱的太早我们不能终老 提交于 2021-01-21 06:04:24
问题 I'm a new flutter developer, and I have a problem with passing the provider through context. If I understood correctly, the provider can be passed by context using: Provider.of<DataModel>(context); The error is: "Could not find the correct Provider above this PageMain Widget" I am using the ChangeNotifierProvider, at the top of my widget tree, so any widget could access the DataModel class, with the intent of making it a sort of a singleton that acts as subject. return ChangeNotifierProvider

Provider to a different page not working as excpected

孤街浪徒 提交于 2021-01-21 06:04:05
问题 I'm a new flutter developer, and I have a problem with passing the provider through context. If I understood correctly, the provider can be passed by context using: Provider.of<DataModel>(context); The error is: "Could not find the correct Provider above this PageMain Widget" I am using the ChangeNotifierProvider, at the top of my widget tree, so any widget could access the DataModel class, with the intent of making it a sort of a singleton that acts as subject. return ChangeNotifierProvider

How do I update a placeholder image with an async image?

偶尔善良 提交于 2021-01-21 05:22:05
问题 I'm using a manager class to either pull images from a cache or make a network request. I'm using a placeholder image. What's the best way to replace that placeholder image when the proper image is retrieved? final ItemManager _manager; final Item _item; var _itemImage = new Image.asset('assets/images/icons/ic_placeholder.png'); @override Widget build(BuildContext context) { _loadImage(); return new Container( child: _itemImage, ); } _loadImage() async { var file = await _manager

How do I update a placeholder image with an async image?

≯℡__Kan透↙ 提交于 2021-01-21 05:20:32
问题 I'm using a manager class to either pull images from a cache or make a network request. I'm using a placeholder image. What's the best way to replace that placeholder image when the proper image is retrieved? final ItemManager _manager; final Item _item; var _itemImage = new Image.asset('assets/images/icons/ic_placeholder.png'); @override Widget build(BuildContext context) { _loadImage(); return new Container( child: _itemImage, ); } _loadImage() async { var file = await _manager

Get user's birthday/gender using Google Sign-In in Flutter

≡放荡痞女 提交于 2021-01-21 04:58:31
问题 I want to get user's birthday and gender using Firebase Auth and Google Sign-In. Unfortunately, after the login happens, I am getting only the user's email, display name, photo url and phone number. I saw that I can add scopes to the GoogleSignIn object, which I do - https://www.googleapis.com/auth/user.birthday.read, https://www.googleapis.com/auth/userinfo.profile, but still, I don't see any additional data after the login. Any idea how to get the result of this? Because when these scopes

Dart how to add commas to a string number

天涯浪子 提交于 2021-01-21 00:35:13
问题 I'm trying to adapt this: Insert commas into number string to work in dart, but no luck. either one of these don't work: print("1000200".replaceAllMapped(new RegExp(r'/(\d)(?=(\d{3})+$)'), (match m) => "${m},")); print("1000300".replaceAll(new RegExp(r'/\d{1,3}(?=(\d{3})+(?!\d))/g'), (match m) => "$m,")); Is there a simpler/working way to add commas to a string number? 回答1: You just forgot get first digits into group. Use this short one: '12345kWh'.replaceAllMapped(new RegExp(r'(\d{1,3})(?=(

how to make curved app bar with custom clipper in flutter

允我心安 提交于 2021-01-20 20:40:16
问题 hi i am new to flutter, I am trying to make this app bar this is my final goal I tried to follow some tutorials to make curved app bars but i couldn't get to the same result as i want after some googling i could've do this simple curve here is the clipper code i used class CurvedClipper extends CustomClipper<Path> { @override Path getClip(Size size) { var path = Path(); path.lineTo(0, size.height - 30); path.quadraticBezierTo( size.width / 2, size.height, size.width, size.height - 30); path

how to make curved app bar with custom clipper in flutter

偶尔善良 提交于 2021-01-20 20:39:06
问题 hi i am new to flutter, I am trying to make this app bar this is my final goal I tried to follow some tutorials to make curved app bars but i couldn't get to the same result as i want after some googling i could've do this simple curve here is the clipper code i used class CurvedClipper extends CustomClipper<Path> { @override Path getClip(Size size) { var path = Path(); path.lineTo(0, size.height - 30); path.quadraticBezierTo( size.width / 2, size.height, size.width, size.height - 30); path

how to make curved app bar with custom clipper in flutter

冷暖自知 提交于 2021-01-20 20:39:01
问题 hi i am new to flutter, I am trying to make this app bar this is my final goal I tried to follow some tutorials to make curved app bars but i couldn't get to the same result as i want after some googling i could've do this simple curve here is the clipper code i used class CurvedClipper extends CustomClipper<Path> { @override Path getClip(Size size) { var path = Path(); path.lineTo(0, size.height - 30); path.quadraticBezierTo( size.width / 2, size.height, size.width, size.height - 30); path