Flutter GearBox
Flutter Package contains common utility functions(logger, appRouter, snackBar, NetworkUtils, custom extension, UrlLauncher, Custom TextFields and ect... ) published on Pub dev.
Supported Devices
- Android
- IOS
- Linux
- Windows
- Macos
Installation
- 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,
...
)
Features
x
Custom Loggerx
printx
infox
verbosex
wtfx
debugx
warningx
error
x
Custom appRouter without BuiltContextx
pushx
pushOFFAllx
pushNamedx
pop
x
ShowSnackBar without BuildContextx
showSnackBar
x
Spacesx
VerticalSpacex
HorizontalSpace
x
NetworkUtilsx
isConnectionAvailablex
performActionx
listenConnectionStream
x
CustomTextFieldx
NameTextFieldx
SearchTextFieldx
EmailTextFieldx
PasswordTextFieldx
PhoneNumberTextField
x
Status Codesx
statusOkx
statusNotFoundx
statusInvalidRequestx
statusInternalServerError
x
UrlLauncherx
launchURL
x
Extensionx
string_extension --> capitalize
x
Custom Variablesx
isInProductionx
isDebugMode
x
Custom Screensx
NoInterNetScreen
Example
Logger
logger.error("My Error Print");
AppRouter without BuildContext
appRouter.push(HomeScreen());
ShowSnackBar without BuildContext
showSnackBar(msg: "MOM ❤");
Spacer VerticalSpace
VerticalSpace(height: 10);
Spacer HorizontalSpace
HorizontalSpace(width: 10);
NetworkUtils
final connectionStatus = await networkUtils.isConnectionAvailable();
await networkUtils.performAction();
await networkUtils.listenConnectionStream();
CustomTextField
CustomTextField(text: "Enter your name");
Status Code
if(res.status == statusOk) {
....
}
UrlLauncher
await launchURL("google.com")
String Extension
String name = username.toString().capitalize;
Custom Debug Variables
if(isInProduction){
...Report to crash analysis
}
if(isDebugMode) {
print("HELLO WORLD");
}
NoInterNetScreen
NoInterNetScreen();
Next Goals
x
Added Utility functions(extensions, logger, navigator, network, custom screen, snackbar, spaces, status_code, custom_text_field, url_launcher)
Contributions
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.