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

I released a Flutter Library for Toast like Badge Message.
A flutter package (library) called `toast_badge` is live now.It can show info badge on any widget and can be called like Toast without context parameter from anywhere in the app.​To use it, wrap your widget inside ToastBadgea. Just Wrap any Widget with ToastBadge() like thischild: ToastBadge(child: SettingPage(),),​b. You can also use the extension method .enableBadge()on any Widget:child: SettingPage().enableBadge(),Finally, call ToastBadge.show() from anywhere in the app.ToastBadge.show("Hello Toast");​This was released as my day 33 of 100 Days of Flutter.You can find daily post on this thread :https://twitter.com/erluxman/status/1246608678486065152See the library here :https://github.com/erluxman/toast_badge#day33 #100DaysofFlutter #flutterdev

May 08, 2020 at 11:04AM by erluxman
https://ift.tt/2zkAvVs
New post on /r/flutterdev subreddit:

Tip #35 Implicit Interface of class
Did you know you can extend and implement a class in Dart?
No need to create `IInterface` to mock a `class`.
No need to extract `IInterface` as Contract / Protocal
Every class implicitly defines an interface containing all the instance variables, methods getter and setters.
1. extends -> must override abstract methods, other methods and variables override optional. i.e can inherit parent's behavior.
2. implements -> Every methdos and variables must be overriden. i.e. can't inherit parent behavior
 Dart has implicit Interface of every class class A { //Optional @override for 'extends' && must for 'implements'. var name; //Optional @override for 'extends' && must for 'implements'. void normalMethod() => print("B -> Normal Method"); } abstract class B{ //must @override in both 'extends' and 'implements'. void abstractMethod(); } //Non abstract class C extends A {} //  class C implements A {} // Must override name & normalMethod() class C extends B {} // Needs to override `abstractMethod()` class C implements B {} // Needs to override `abstractMethod()` //Abstract Child abstract class C extends A {} //  abstract class C implements A {} //  abstract class C implements B {} //  abstract class C extends B {} //  
See Daily posts on this threadContribute and give feedback

May 12, 2020 at 11:16AM by erluxman
https://ift.tt/2xZxGsM