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

Review of my little helper widget called Selectable
I am very new to Flutter. At the moment I am working on a collection of re-useable widgets. I have a lot of widgets that are selectable meaning a user can tap/click on the widget and it somehow is in a selected state. This looks like this:The Button Types widget is selected in this example.You may notice that the text inside a selected widget is white whereas the text of non-selected widgets is usually black.And as I said - I have a lot of selectable widgets in my little library so I need to find a good solution for that.Initially most of my widgets simply had a selected property and if set to true the widget basically knew that it is selected. However this had some drawbacks. For example sometimes the descendant widgets need to know if it is inside a currently selected widget. So the value of selected would have to be passed from parent to all children and from all children to their children and so on. I think I found a better solution but I am unsure whether or not it is really better. I need your advice.```dart class Selectable extends InheritedWidget { const Selectable({ Key key, @required this.selected, @required Widget child, }) : assert(selected != null), assert(child != null), super(key: key, child: child);final bool selected;static Selectable of(BuildContext context) { return context.dependOnInheritedWidgetOfExactType<Selectable>(); }static bool current(BuildContext context, { bool fallback }) { final selectable = of(context); if(selectable != null) { return selectable.selected; } return fallback; }@override bool updateShouldNotify(Selectable oldWidget) => selected != oldWidget.selected; } ```Selectable is a helper widget that provides a selected-flag to descendants.You would use this widget to wrap another widget that can be selected by the user. You can then access the selected-state in any descendant like this:dart final selectable = Selectable.of(context) if(selectable != null) { if(selectable.selected) { print('selected yay'); } }Please note that selectable can be null if the widget is not wrapped with Selectable. The selected value can be determined in a more convenient way like this:dart final selected = Selectable.current(context, fallback: true) if(selected) print('selected yay');Here, selected is never null. It is either true or false. If your current widget is not wrapped by Selectable then selected will be have the same value as fallback.Is this a good idea? I mean it works and it allows all of my other widgets to change their text color (among other things) depending on whether or not they are inside something that is selected.Thanks.

April 18, 2020 at 07:56PM by flutternewbiiiii
https://ift.tt/3eAcnOE
New post on /r/flutterdev subreddit:

Flutter Bloc Experiment
Hi folks.I did some small experiment with BloC pattern and I will be glad to hear your feedback. I have read that the best is to use BloC per screen, but what if instead of it I can have tree like structured BloCs. Here is basic example.So. In the application there can be lot of blocs, and any bloc responsible for one unit like widgets.ex.
1. UserSearchBloc 2. UserUpdateBloc 3. UserUpdateBloc 4. ProjectSearchBloc ... 
And when there is a need to combine some of the blocs, I can create manager which is responsible for children states synchronization.ex.
UserProjectManagerBloc( children: [ ProjectSearchBloc()..add(ProjectSearchFilterChanged()), UserManagerBloc( children: [ UserSearchBloc()..add(UserSearchFilterChanged()), UserDeleteBloc(), UserUpdateBloc(), ], ) ], ) class UserProjectManagerBloc extends BlocNode<BlocNodeEvent, UserProjectManagerState> { ... @override void onChildStateChange(BlocNodeState state) { if (state is UserDeleteSuccess) { getChild<ProjectSearchBloc>().add(ProjectSearchUserDeleted(state.id)); } } } 
Github repository

April 18, 2020 at 07:56PM by andantonyan
https://ift.tt/2VhAo5u
New post on /r/flutterdev subreddit:

Every Flutter Beginner should know this
https://youtu.be/uhCu_sk7VKc

April 18, 2020 at 07:27PM by nishant_rai
https://ift.tt/2wPbYah
New post on /r/flutterdev subreddit:

Running a pedometer service
Hi everyone, I would like to develop a app in flutter for counting steps so that i would work with basic sensors. What i achieved now is if i start the app and walk it would count the steps but how could i improve it count steps at all times? May be a service? But how far a service can work in flutter? I couldnt see example of it. Have u guys faced similar situations? Else u have any solutions for it?Thanks in advance.

April 18, 2020 at 08:47PM by imsharath
https://ift.tt/2wUn5Pi
New post on /r/flutterdev subreddit:

Contributing to Flutter
Hi all​I have some spare time and I want to start with small contribution to the Flutter pluginsHere is the issue that I picked https://github.com/flutter/flutter/issues/52544I am planning toadd this support for `_prefix`
write testsupdate the docsAm I on the right path? any advice before I start?Thanks

April 18, 2020 at 11:00PM by agent3bood
https://ift.tt/3bqwBsw
New post on Flutter Dev Google group:

Native Contact
Hello guys, has anyone accessed the contact book natively? I have tried with native_contact_picker and easy_contact_picker plugin, being able to open the agenda but without being able to get the contact when I select it. Regards

April 19, 2020 at 01:07AM by Saul Palenzuela Hdez
https://ift.tt/3bwCuUI
New post on /r/flutterdev subreddit:

Tips 8 -14 of 100DaysOfFlutter
Here I have published post 8 to 14 for my journey of #100daysFfFlutterhttps://erluxman.com/00004-week-2-100days-of-flutter/​For daily updates, follow this twitter thread:https://twitter.com/erluxman/status/1246608678486065152

April 19, 2020 at 03:32AM by erluxman
https://ift.tt/3bwON3L
New post on Flutter Dev Google group:

Fwd: i was unable to setstate my text widget and button widget when selected according to the dropdown menu
Here is my code in the screenshot order wise i was unable to set the state

April 19, 2020 at 07:51AM by Dindukurthi Kondiah
https://ift.tt/3ewXWuX
New post on Flutter Dev Google group:

Notification Icon
Hi, I'm using this flutter_local_notifications
New post on /r/flutterdev subreddit:

FlutterForce — Week 73
https://ift.tt/2VFx971

April 19, 2020 at 12:51PM by flutterist
https://ift.tt/3cyevF8
New post on /r/flutterdev subreddit:

Why you should build your next mobile app with Flutter
“Why You should build your next mobile app with Flutter” by Efikas https://link.medium.com/DqTR0W6fO5

April 19, 2020 at 12:47PM by latyf
https://ift.tt/3cvDI2I
New post on /r/flutterdev subreddit:

Why you should build your next mobile app with Flutter
“Why You should build your next mobile app with Flutter” by Efikas https://link.medium.com/DqTR0W6fO5

April 19, 2020 at 12:47PM by latyf
https://ift.tt/2VlsRCO
New post on /r/flutterdev subreddit:

API Development - Design first
https://ift.tt/3cvTWJf

April 19, 2020 at 05:33PM by BugSmasher93
https://ift.tt/2KjefNS
New post on Flutter Dev Google group:

After updating Android studio to 3.6.3 and flutter it will give an error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
I have updated AndroidSDKtools(obsolete). Im struck on this error from fast few days. Please help me! On stackoverflow i have posted my question Here is link < https://stackoverflow.com/questions/61307133/after-updating-android-studio-3-6-3-and-flutter-it-gives-me-an-error-that-not-fi >

April 19, 2020 at 05:59PM by Bhavna
https://ift.tt/3ahAWgd
New post on /r/flutterdev subreddit:

Beginner In Mobile dev
Hi guys ! I'v introduced myself to flutter for the past 2 days and i liked it pretty much ( preview) and decided i would want to make a Flutter App . I dont know anything about Dart , so Flutter too . And i would like to have some guidamce about it. I'v developed Websites ( php, css html js ) and i already know java . So can i learn Dart and develop an App in only 2 months ?

April 19, 2020 at 06:15PM by oussamabht
https://ift.tt/3es5Nd4
New post on /r/flutterdev subreddit:

A Flutter app for monitoring COVID 19 India stats
https://ift.tt/2ywj2sD

April 19, 2020 at 06:07PM by thepurpleproject
https://ift.tt/2VKagzv