Flutter Heroes
26.1K subscribers
272 photos
2 videos
31.1K links
Download Telegram
New post on /r/flutterdev subreddit:

After Flutter Windows stable release, what's next ?
Does anyone know what should we expect after the recent update on Flutter Windows ? Are similar updates planned for MacOS, Linux or maybe Web ?

February 14, 2022 at 09:24PM by pepperoni210
https://ift.tt/ztefh6A
New post on /r/flutterdev subreddit:

Build simple and readable apps with Super Responsive
https://ift.tt/SfKtHMh

February 14, 2022 at 11:19PM by namzug__16
https://ift.tt/GErbUKp
New post on /r/flutterdev subreddit:

Floating Bottom Bar package will animate a floating action button at the center and icons at the bottom Navigation Bar using AnimatedContainer and SlideTransition respectively.
https://ift.tt/kfypxcR

February 15, 2022 at 05:45AM by connectsteven
https://ift.tt/qKThVZd
New post on /r/flutterdev subreddit:

How hard is it to migrate a larger production app from Xamarin.Forms to Flutter?
Hey guys,I know there are some more posts about the migration from Xamarin.Forms to Flutter and i also know there is a great section in the flutter docs that show how you can migrate your UI and code to Flutter. I've been building a production iOS/Android app for the past 3-4 years in Xamarin.Forms and i have to say i really love C# but the struggles i had with bugs and somehow, in my opinion, weird concepts for layouts (e.g. making your layout responsive for multiple devices which is a pain in the a$$ in Xamarin.Forms) really cost me a lot of time. Additionally our app clients ask for desktop support for the app and i feel like waiting for .NET MAUI is a bit too risky as i have no idea when it will be released.I'm ready to invest some time in the Migration but i want to make it as easy as possible. I'd like to copy all the app logic classes (network, data handling, etc) one to one as it works fine in C# and I'm happy to rebuild a lot of the UI anyways, as i think it has some potential to be better. Is there actually a way to transpile C# .NET code to Dart or do i need to do this manually line by line? I'm using so much Linq and for example i have a customized TCP socket which I have no idea if i can migrate it to Dart or not? Excuse me if these questions are quite basic, i have migrated projects before but never from one programming language to another.For the end user i want a seamingless transition to the new app. In the appstore it should basically be a new big update for the old app and that's about it. From what i read that should be possible anyways.Thanks in advance and I'm happy to hear your Migration stories!

February 15, 2022 at 09:08AM by Ely_oaks
https://ift.tt/MJQGSbz
New post on /r/flutterdev subreddit:

Hot Reload Not Working in VScode
In VScode hot Reload is not working when I press bolt icon nor when i press r in terminal but it's working when i press ctrl + s . In android studio it's working fine in all the way.Does anyone knows the fix !?

February 15, 2022 at 09:04AM by jaiswal16
https://ift.tt/Br2bLTF
New post on /r/flutterdev subreddit:

Experience of the Flutter community
What is the depth of experience of developers in the Flutter community above and beyond Flutter?How many years of experience do you have in IT.View Poll

February 15, 2022 at 09:22AM by bsutto
https://ift.tt/FVOwMSf
New post on /r/flutterdev subreddit:

Feedback needed on in-app purchase implementation
Hey everyone! I implemented in-app purchases in Flutter. I used the official plugin in_app_purchase. I would like to be sure that I did everything correctly. Any feedback is very much appreciated! Following is what I did:1) I load all products from store:
final isAvailable = InAppPurchase.instance.isAvailable(); if(isAvailable){ final response = await IAPInstance.queryProductDetails(skis.toSet()); products.value = response.productDetails; } 
2) Then I start listening to the purchaseUpdated stream
 void _listenToPurchaseUpdated( List<PurchaseDetails> purchaseDetailsList, ) async { if (purchaseDetailsList.isEmpty) { return; } final purchaseDetails = purchaseDetailsList.first; if (purchaseDetails.status == PurchaseStatus.pending) { // PENDING } else { if (purchaseDetails.status == PurchaseStatus.error) { // HANDLE ERROR } else if (purchaseDetails.status == PurchaseStatus.purchased || purchaseDetails.status == PurchaseStatus.restored) { final token = purchaseDetails.verificationData.serverVerificationData; final productId = purchaseDetails.productID; // Here I check if token is valid, and if it is, I update user data in DB final isValid = await checkIsTokenValid(productId, token); if (isValid) { // Show dialog, that purchase was completed successfully if (purchaseDetails.pendingCompletePurchase) { // QUESTION_1: when purchase status is restored, pendingCompletePurchase is always "false". I don't need it to call when purchase is autorenewed? await IAPInstance.completePurchase(purchaseDetails); } } else { // HANDLE ERROR } } } } final Stream purchaseUpdated = IAPInstance.purchaseStream; _subscription = purchaseUpdated.listen((purchaseDetailsList) { _listenToPurchaseUpdated(purchaseDetailsList); }, onDone: () { print('On done callback called'); _subscription.cancel(); // QUESTION_2: Why I cancel subscription here? Is it necessary? }, onError: (error) { // handle error here. print('Error callback called: $error'); }); 
3) When the user wants to buy a subscription, I do this:
final PurchaseParam purchaseParam = PurchaseParam(productDetails: details); await IAPInstance.buyNonConsumable(purchaseParam: purchaseParam); 
It will fire an event and the stream callback will be executed.4) The biggest question is about auto-renewal:4.1) When user is outside of app, and the subscription is renewed, how can I detect it and update in my DB? (Both for iOS and Android). My solution is to call IAPInstance.restorePurchase() when app is opened the first time. This will fire purchaseUpdated callback with "restored" purchase status, and then I do my validation with backend, which will check the token and then change user subscription expiration date in my DB. But when I check purchaseDetails.pendingCompletePurchase, it always returns false, when status is restored. Shouldn't I call completePurchase() when purchase is restored? Am I doing it correctly?4.2) When the user is in foreground, i.e. in the application, and subscription expires and renewed, purchaseUpdated callback is not called :(( What to do here? Check expiration time on app open and set timer for calling IAPInstance.restorePurchase()? I think this will also fire the purchaseUpdated callback with "restored" purchase status.P.S. In testing mode, monthly subscription duration is 5 minute, and when I don't open app long time, when I come back, there is no subscription. Is it OK? Is it only because of my test card?Thank you very much!

February 15, 2022 at 11:59AM by hmarat
https://ift.tt/ugOl8PX
New post on /r/flutterdev subreddit:

How to my alarm clock app functioning/working?
Hi, I'm a beginner and want to ask how to make an alarm app functioning? I'hv made the UI with canvas. But I'm still not able to find how to make it working, how to trigger the alarm at a set time.How to write the backend? can we do it in dart? or I'll need to learn kotlin?Thanks

February 15, 2022 at 12:53PM by Logical_Clothes_1089
https://ift.tt/TGNHOqB
New post on /r/flutterdev subreddit:

Any thoughts on the WidgetView pattern ?
Hi,I have been using Provider + change notifier for state management for a while and it was great. Now that I started making biggers projects I think separating the UI from the logic has become a little bit harder since provider always require to have a context.I recently found this article about WidgetView pattern and it seems to work well with provider, although I haven't found much documentation/videos about it.https://blog.gskinner.com/archives/2020/02/flutter-widgetview-a-simple-separation-of-layout-and-logic.htmlI have tried Bloc in the past and I didn't really understand his full potential because I was applying it to small projects. Now I dont know if I should start using bloc or keep provider + change notifier + widgetview.The main advantage of bloc would be to have a lot of documentation and lots of people using it while the advantage of widgetview would be being able to still using provider and reduce the boilerplate.Do you guys have any thought about this? have anyone tried to use widgetview ?Thank you so much

February 15, 2022 at 01:23PM by ZuppaSalata
https://ift.tt/dXBqRyN
New post on /r/flutterdev subreddit:

<b>Pass File from child back to parent</b>
I'm using Image Picker on a file that looks like this `import 'dart:io';` class EditImage extends StatefulWidget { const EditImage({Key? key}) : super(key: key);@override State<EditImage> createState() => _EditImageState(); }class _EditImageState extends State<EditImage> { File? image; Future pickImage() async { try { final image = await ImagePicker().pickImage(source: ImageSource.gallery); if (image == null) return;<pre> final imageTemporary = File(image.path); setState(() { this.image = imageTemporary; }); } on PlatformException catch (e) { // ignore: avoid_print print("Failed to pick image:$e"); } </pre>}Future pickCamera() async { try { final image = await ImagePicker().pickImage(source: ImageSource.camera); if (image == null) return;<pre> final imageTemporary = File(image.path); setState(() { this.image = imageTemporary; }); } on PlatformException catch (e) { // ignore: avoid_print print("Failed to pick image:$e"); } </pre>}@override Widget build(BuildContext context) { return Padding( padding: EdgeInsets.only(left: 0.15.sw), child: GestureDetector( onTap: () { if (image == null) { showDialog<void>( context: context, barrierDismissible: false, // user must tap button! builder: (BuildContext context) { return AlertDialog( title: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, // ignore: prefer_const_literals_to_create_immutables children: [ const Text( 'Choose Image', style: TextStyle(), ), IconButton( onPressed: () { Navigator.pop(context); }, icon: Icon( Icons.close, size: 20.sp, color: const Color(0xFF000000), ), ) ], ), content: SingleChildScrollView( child: ListBody( children: const <Widget>[ Text( 'Choose a profile Picture to upload', style: TextStyle(), ), ], ), ), actions: <Widget>[ TextButton( child: const Text( 'Camera', style: TextStyle( fontSize: 12, color: Colors.black, fontWeight: FontWeight.bold, ), ), onPressed: () { pickCamera(); Navigator.pop(context); }, ), TextButton( child: const Text( 'Gallery', style: TextStyle( fontSize: 12, color: Colors.black, fontWeight: FontWeight.bold, ), ), onPressed: () { pickImage(); Navigator.pop(context); }, ), ], ); }, ); } }, child: SizedBox( width: 190.w, height: 125.h, child: Stack( children: [ Positioned( bottom: 0, right: 5, child: ConstrainedBox( constraints: BoxConstraints.tightFor(width: 70.w, height: 15.h), child: ElevatedButton( style: ElevatedButton.styleFrom( elevation: 0, primary: Colors.green[700], ), onPressed: () { if (image != null) { showDialog<void>( context: context, barrierDismissible: false, // user must tap button! builder: (BuildContext context) { return AlertDialog( title: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, // ignore: prefer_const_literals_to_create_immutables children: [ const Text( 'Choose Image', style: TextStyle(), ), IconButton( onPressed: () { Navigator.pop(context); }, icon: Icon( Icons.close, size: 20.sp, color: const Color(0xFF000000), ), ) ], ), content: SingleChildScrollView( child: ListBody( children: const <Widget>[ Text( 'Choose a profile Picture to upload', style: TextStyle(), ), ], ), ), actions: <Widget>[ TextButton( child: const Text( 'Camera', style: TextStyle( fontSize: 12, color: Colors.black, fontWeight: FontWeight.bold, ), ), onPressed: () { pickCamera(); Navigator.pop(context); }, ), TextButton( child: const Text( 'Gallery', style: TextStyle( fontSize: 12, color: Colors.black, fontWeight: FontWeight.bold, ), ), onPressed: () { pickImage(); Navigator.pop(context); }, ), ], ); }, ); } }, child: const Align( alignment: Alignment.topRight, child: Text( '+EDIT', textAlign: TextAlign.right, style: TextStyle( fontSize: 12, color: Color(0xff0ced10), fontWeight: FontWeight.bold), ), ), ), ), ), Container( height: 125.h, width: 125.w, clipBehavior: Clip.antiAlias, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(15.r), border: Border.all(color: const Color(0xff0ced10), width: 2), boxShadow: [ BoxShadow( color: Colors.black, offset: const…
New post on /r/flutterdev subreddit:

Why is immutability important? (Riverpod versus Provider)
Sorry, I am coming from C, so declarative programming is new to me. I don't understand why we have to make the class immutable for Riverpod. Everyone says imutablity is important, but I am confused on exactly why if we could just have read-only variables to enforce changes from the interface only. Having a separate notifier and class declaration seems very boilerplate to me and inefficient with the copy. Sorry, I really know very little about this because, at my job, I use C for simple embedded systems that control via a while(1). The only threading I understand is an interrupt of 2 levels of priority.Please let me know where I should move this question if it is inappropriate for this subreddit.

February 15, 2022 at 05:14PM by whitemagehealing
https://ift.tt/LovMaC9