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

Smart/Dump components, Functions and\or Providers
I'm a long term developer who just got into Flutter for a side project I'm working on. I've made a ton of progress with an app that a customer is ordering, but I'm kinda struggling with what should hold my application logic ie. executes a series of steps to maintain state for better user experience. Do note that I'm not talking about business logic. That resides somewhere else.I'm curious to know what is your preferred method of working in regards to what block in your Flutter app is the smart one? Is it the components, the provider or some other class\function. I'd love to have some reading material in regards to this. An example:Let's assume you're working on an app that needs to connect to some other device via a WebSocket connection. So you have a button that when pressed initiates the connection. You also have to let the user know that now you have a connection (flip button from red to green). You also have a requirement to auto connect to that device when the app starts, if it was previously connected to. So that means holding information about having to auto-connect or not, somewhere in a local database of sorts, let's say SQLite or Hive.So, what is your preferred solution here?Do you have your component do the connecting, putting that connection in a Provider and putting that connection information (like a device ID or smth) into a local database for auto-connect, ie. your component holds all the cards like WebSocket, Provider and SQLite or Hive?Does your component call a Provider to do all of that stuff for you and the component just listens to changes there and maybe flips a "Connect" button to "Disconnect"Do you create a class or a function that holds application logic and handles orchestration (as small as it is?)Do you just put that stuff all over the place and pull out your hair trying to find it later on.

November 12, 2021 at 08:10AM by rcls0053
https://ift.tt/3F8BVyX
New post on /r/flutterdev subreddit:

Your view on using 3rd party library for responsiveness in flutter application
Is it professional to use 3rd party library like flutter_screenutils for responsive app design?AS IN:Text responsiveness throughout different devices.UI responsiveness throughout the different layoutHandling flutter font size issue, where 20 px will be something else on another device's screenIt's confusing.#Flutter

November 12, 2021 at 10:16AM by Lucky_Looper
https://ift.tt/30jcjAt
New post on /r/flutterdev subreddit:

Tip: How to avoid badly cropped rounded avatars: round your animation values
I've been noticing that in certain cases the avatars of my app tend to be slightly cropped. Although I made sure that all dimensions match from PSD to Widget sometimes this crop shows up. After brainstorming a bit I've figured out that this is due to the animation that I apply to this particular sidebar (Container). Due to the way the numbers are computed the final animation ends up in a state where the position includes a decimal value. This slight missalignment is enough to trick the the image rastering algo to "skip a row of pixels". That is just enough to make the avatar look clipped. The solution was to round the final value thus eliminating the subpixel missalignment.Here's a little demo image to compare the results: https://imgur.com/a/ZfOdjvO

November 12, 2021 at 01:08PM by SpaceInstructor
https://ift.tt/3naGfYy
New post on /r/flutterdev subreddit:

App Feedback Thread - November 12, 2021
This thread is for getting feedback on your own apps.Developers:must provide feedback for othersmust include Play Store, App Store, GitHub, GitLab, or BitBucket linkmust make top level commentmust make effort to respond to questions and feedback from commentersmay be open or closed sourceCommenters:must give constructive feedback in replies to top level commentsmust not include links to other appsTo cut down on spam, accounts who are too young or do not have enough karma to post will be removed. Please make an effort to contribute to the community before asking for feedback.As always, the mod team is only a small group of people, and we rely on the readers to help us maintain this subreddit. Please report any rule breakers. Thank you.- r/FlutterDev Mods

November 12, 2021 at 03:00PM by AutoModerator
https://ift.tt/3c7XoeQ
New post on /r/flutterdev subreddit:

flutter how to install?
/r/archlinux/comments/qsgu9s/flutter_how_to_install/

November 12, 2021 at 06:59PM by infinitecoolname
https://ift.tt/3or5KUz
New post on /r/flutterdev subreddit:

How do you comprehend abstraction
Hey all, I have been learning Bloc and I thought I was at a decent level enough to dive deeper into the tutorials but I don't understand why some things are done at this point. I know that Bloc is famous for its boilerplate but that's not at all the issue here. It's everything else.I know you are supposed to abstract certain details in your app so that they are reusable or can be changed without affecting other components too much but it gets to a point where I'm lost and I don't understand what does what and why we are separating it into its own module.It was a simple weather app that I got lost with and I don't know how anyone can understand production level code. I've only built apps for myself and only recently started collaborating on GitHub so that might be it but the confusion I get from reading some code and not immediately understanding what it does makes me want to give up sometimes.I do understand the code I see in front of me but conceptualizing how everything comes together seems too much for my head. It's strange to look like a chore especially when it comes to testing large swaths of code.

November 12, 2021 at 09:39PM by HenryNanaAdu
https://ift.tt/3FhmS6l
New tweet from FlutterDev:

D. UI whitespace is the correct answer! 🥳— Flutter (@FlutterDev) Nov 12, 2021

November 12, 2021 at 10:30PM
https://twitter.com/FlutterDev/status/1459272312721604610
New post on /r/flutterdev subreddit:

ListView Render Behaviour
I am creating a chat page as part of a project I'm working on. In a demo, I run a bit of logic in the ListView.builder to obtain the details of the next chat message to inform specific UI rendering. To be precise, the structure of the message widget should change if it was the last of its "kind" like WhatsApp does.To test this, I passed two arguments to the message widget; <message> the actual message, and <next>, the one after. If the message was the last in the list, then <next> would be null.I gave it a test run with some dummy data. The messages would not render a date unless they were the last from either myself or someone else. All was well.At least, until I tried to update the dummy message list with new data. The previous "last" message widgets seem to maintain the "null" value of <next> even though they are no longer the last. It's quite an interesting situation because values like the index and message list length were refreshing predictably when I chose to display them. InitState was also being called for each widget.Does anyone have an idea of what is happening behind the scenes?PS: I plan to achieve this differently, in practice. The chat pages are ephemeral, so I assume I can get away with some stuff, but any advice is still welcome.

November 13, 2021 at 01:27AM by GingsWife
https://ift.tt/2YFJzBi
New post on /r/flutterdev subreddit:

Have you switched from stream-based state management to any other and why?
I've been developing Flutter apps since the early 2018, and what got me in love with streams was a 2018 I/O talk by Matt and Filip from the Flutter team, which looks like it has since been deleted.I've lucked out at my current job and got to decide on the state management approach, obviously I've went for something I'm well familiar with, and that's using StreamBuilder, StreamSubscription and Stream objects to handle state management (alongside some setState and StatefulBuilder widgets here and there). We've built a functionally very large webshop, and are on the track to release it! I'm actually surprised by how little bugs we've encountered, so I don't think complexity is an issue.My question is: have you used stream-based solutions in a professional capacity, and have you switched from it to any other solution and why? If it means anything, my colleagues seem to have gotten a good grip on streams, so that's not a concern.Many thanks.EDIT: Any issues you've noticed that resulted in you not choosing stream-based state management?

November 13, 2021 at 01:24AM by No_Appearance4886
https://ift.tt/3C9Hnjd
New post on /r/flutterdev subreddit:

First Flutter-Powered Mobile Banking App in Europe
https://ift.tt/3C6ZuXb

November 13, 2021 at 10:10AM by smbale
https://ift.tt/3FcFgx3
New post on /r/flutterdev subreddit:

What are common ways to do application structure and architecture in Flutter?
I would like to decide on an application structure and architecture for the app I'm building that will be scalable and easily readable for other people in the future.There is supprisingly little information online on how to approach those things in Flutter. What are some common ways to do that? Should I go for architectures like MVC or MVVM or are there other viable options for Flutter? And are there some good tutorials by example available for that?

November 13, 2021 at 10:00AM by Rebound870
https://ift.tt/3FdKLM4
New post on /r/flutterdev subreddit:

BLoC vs Riverpod
It seems commercial programming requires BLoC. Maybe this is more a legacy of older Flutter. For those who've used both, do you think BLoC has enough to offer over Riverpod to be as necessary as the commercial market has made it, or should it fade away for being so complex?Obviously there are those who will say "use both" or "it depends" but what I'm trying to get to the bottom of is: really how valuable is BLoC that new developers have to get their minds around it in addition to the complexities already in Flutter.View Poll

November 13, 2021 at 03:32PM by itsastickup
https://ift.tt/3wJYWFi
New post on /r/flutterdev subreddit:

State Management Example Using Riverpod
An example how I use immutable models with Riverpod.I have an immutable Game. I also have a bunch of update functions to transform one Game state into the next state, for example to move something forward, there is a moveForward function that returns an Update<Game> function that does whatever is required by the rules:
typedef Update<T> = T Function(T); Update<Game> moveForward() => (game) { final nposition = game.position.step(); if (!game.map.isValid(nposition)) return game; return game.update(position: nposition); }; 
Now I want to combine this approach with Riverpod.I have to create a subclass of StateNotifier to store my Game (or any other updateable value because I'm doing this is the most generic way of course):
class UpdateableStateNotifier<T> extends StateNotifier<T> { UpdateableStateNotifier(T initialState) : super(initialState); void apply(Update<T> update) => state = update(state); ... 
To make creating a provider look nicer and to omit all the explicit types otherwise required, I also provide this utility factory function:
 ... static StateNotifierProvider<UpdateableStateNotifier<T>, T> provider<T>(T initialState) => StateNotifierProvider((_) => UpdateableStateNotifier(initialState)); } 
Then I can setup my gameProvider like so:
final gameProvider = UpdateableStateNotifier.provider(initialGame); 
Later, I can access the current game state as usual:
Widget build(BuildContext context, WidgetRef ref) { final game = ref.watch(gameProvider); ... 
To easily apply updates, I extended WidgetRef:
extension UpdateableStateNotifierExtension on WidgetRef { void apply<S>(StateNotifierProvider<UpdateableStateNotifier<S>, S> provider, Update<S> update) { read(provider.notifier).apply(update); } } 
Now, my UI can do this in callbacks or other actions:
ref.apply(gameProvider, moveForward()); 
There is a bit more work involved because I also support undo (and redo, because why not) and Update actually returns a FutureOr<T>, but the principle stays the same.

November 13, 2021 at 04:15PM by eibaan
https://ift.tt/3F4p1SG
New post on /r/flutterdev subreddit:

Flutter Devs: Problems & Pain Points
Hey All!Hope everyone is doing well. I created a short survey to understand what the largest pain points for flutter devs are. It should only take a minute or two to complete. I would really appreciate if some of you would fill it out.https://forms.gle/qyEefi7n67eLzzsF8Thanks!

November 13, 2021 at 05:34PM by gfroski1321
https://ift.tt/3DdkkW7
New post on /r/flutterdev subreddit:

What was your favorite flutter project you've made/contributed to and why?
Please leave a repository link if you can; Mine is Corona Spectator, and it's my favorite because it was one of the first times I actually felt like I was solving a real world problem with my programming skills.

November 13, 2021 at 08:52PM by 31Carlton7
https://ift.tt/3HcOYRM
New post on /r/flutterdev subreddit:

Best way to ramp up senior dev to Flutter?
I’m currently researching some options for the company I work for to start building some basic mobile apps. We’re a small team, so I’m trying to avoid the traditional approach of building out Android and iOS apps separately. I tried React Native a few years ago, and wasn’t impressed with it.I have 11 years of professional experience as a software engineer, but it’s been mostly C# MVC patterned web applications, short stent with C#, Xamarin Ruby on Rails, SQL Server (maintained some nasty stored procedures), few years of Swift (mostly api and service layers, someone else did the storyboard designs/UI), restful and graphql API creation/maintenance/consumption.With all that said, what’s the best way for me to jump into Flutter/Dart? I don’t mind “Drinking from the fire hose”, but I want the good quality water. I’m looking for some great videos, tutorials, weekly series (I love gorails), VS Code tips, flutter design patterns, garbage collection advice, “must have” flutter tools/components/plugins, or anything else that you wish you had known when you first started with Flutter!I don’t want to have to sit in front of our CIO in a year explaining why we have to rewrite our app(s) in Swift and Java because we decided to go with Flutter.Thanks in advance!

November 13, 2021 at 11:58PM by AlarmingNectarine
https://ift.tt/3Dh85ro
New post on /r/flutterdev subreddit:

how do you make sure that you receive your payment when doing a project for someone that you find online, because i think i just got screwed and handed over a project without getting the money back
Title

November 14, 2021 at 01:06AM by peace___99
https://ift.tt/3ndNkY5