sura_flutter
A flutter package from AsurRaa for widgets and utility functions.
Migrate from 2.x to 3.x
-
BREAKING CHANGE:
- remove FutureManager, AsyncSubjectManager, FutureManagerBuilder
- All manager class now has a separate package
Installation
Add this to pubspec.yaml
Widgets
Widget | Description |
---|---|
SuraRaisedButton | Custom ElevatedButton with loading notifier |
SuraBadge | Small badge like notification |
SuraActionSheet | Custom CupertinoActionSheet for option selector |
ConditionalWidget | Build a widget base on a boolean condition |
SuraToolbar | Custom ToolBar or AppBar |
SuraFutureHandler | FutureBuilder with less boilerplate code |
SuraAccordian | Custom ExpansionTile |
SuraExpandable | Similar to SuraAccordion but with different use case |
SuraConfirmationDialog | Platform adaptive AlertDialog with cancel and confirm action |
SuraAsyncButton | Fully customize Material ElevatedButton for asynchronus onPressed callback |
SuraLoadingDialog | Create and manage Loading Dialog |
SuraPlatformChecker | Platform adaptive widget |
SuraSimpleDialog | Simple platform adaptive AlertDialog |
SuraListTile | Custom ListTile |
SuraPaginatedList | ListView with pagination support |
SuraPaginatedGridBuilder | Gridview with pagination support |
SuraIconButton | Custom IconButton |
SuraFlatButton | Cusztom TextButton or FlatButton |
SpaceX | SizedBox with only width |
SpaceY | SizedBox with only height |
SuraStreamHandler | A Streambuilder with less boilerplate code |
SuraNotifier | A ValueListenableBuilder with less boilerplate code |
Mixin
AfterBuildMixin
Create an override method that will call after the build method has been called
SuraFormMixin
Provide some property and method when working with Form
field and attribute
- formKey: a key for form
- loadingNotifier: a bool ValueNotifier
- passwordObsecureNotifier: a bool ValueNotitifer for toggling password obsecure field
- isFormValidated: a bool return by validate formKey
method
- toggleLoading: toggle loadingNotifier
- togglePasswordObsecure: toggle passwordObsecureNotifier
BoolNotifierMixin
Provider a ValueNotifier<bool>
and a value toggle function
- boolNotifier: a bool ValueNotifier
method
- toggleValue: toggle loadingNotifier
Widget's Extension
padding, margin
cssSpacing
rotate (in degree)
flexible, expanded, clipOval, opacity
TextStyle Extention
Other Extension
BuildContext extension
DateTime extension
String extension
Utility and Style
DotTabIndicator
SmallUnderlineTabIndicator
ShadowInputBorder
This input border solve a problem thath TextField doesn't have a default elevation.
SuraColor
SuraUtils
SuraFormValidator
Provide some field validation
PageNavigator and SuraNavigator
PageNavigator support push, pushReplacement and pushAndRemove method
SuraNavigator also support push, pushReplacement, pushAndRemove without providing a context but you need to add SuraNavigator.navigatorKey to MaterialApp
SuraNavigator also can show dialog without providing a context