Flutter Package contains common utility functions(logger, appRouter, snackBar, NetworkUtils, custom extension, UrlLauncher, Custom TextFields and ect... ) published on Pub dev.
- Android
- IOS
- Linux
- Windows
- Macos
- Add the latest version of package to your pubspec.yaml (and run
dart pub get
):
dependencies:
flutter_gearbox:
- Import the package and use it in your Flutter App.
import 'package:flutter_gearbox/flutter_gearbox.dart';
- Add Keys in Material App for routing and display snackbar without BuiltContext
MaterialApp(
scaffoldMessengerKey: snackbarKey,
navigatorKey: navigatorKey,
...
)
- Custom Logger
- info
- verbose
- wtf
- debug
- warning
- error
- Custom appRouter without BuiltContext
- push
- pushOFFAll
- pushNamed
- pop
- ShowSnackBar without BuildContext
- showSnackBar
- Spaces
- VerticalSpace
- HorizontalSpace
- NetworkUtils
- isConnectionAvailable
- performAction
- listenConnectionStream
- CustomTextField
- NameTextField
- SearchTextField
- EmailTextField
- PasswordTextField
- PhoneNumberTextField
- Status Codes
- statusOk
- statusNotFound
- statusInvalidRequest
- statusInternalServerError
- UrlLauncher
- launchURL
- Extension
- string_extension --> capitalize
- Custom Variables
- isInProduction
- isDebugMode
- Custom Screens
- NoInterNetScreen
logger.error("My Error Print");
appRouter.push(HomeScreen());
showSnackBar(msg: "MOM ❤");
VerticalSpace(height: 10);
HorizontalSpace(width: 10);
final connectionStatus = await networkUtils.isConnectionAvailable();
await networkUtils.performAction();
await networkUtils.listenConnectionStream();
CustomTextField(text: "Enter your name");
if(res.status == statusOk) {
....
}
await launchURL("google.com")
String name = username.toString().capitalize;
if(isInProduction){
...Report to crash analysis
}
if(isDebugMode) {
print("HELLO WORLD");
}
NoInterNetScreen();
- Added Utility functions(extensions, logger, navigator, network, custom screen, snackbar, spaces, status_code, custom_text_field, url_launcher)
- More functions to add
If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.