commons 0.3.6 commons: ^0.3.6 copied to clipboard
Commons Flutter package includes alert dialogs, extension functions and much more... Written by 'Ch Arbaz Mateen'
Commons #
Commons Flutter package can used for Flutter Android and IOS applications.
Includes
- Alert dialog
- Toast messages
- Loading screen
- Extensions functions
- Strack trace dialog
- Shared Preferences functions
- Value validators
- Date and Time functions
How to use #
1. Depend on it #
Add this to your package's pubspec.yaml file:
dependencies:
commons: ^0.3.6
2. Install it #
You can install packages from the command line:
with Flutter:
$ flutter pub get
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
3. Import it #
Now in your Dart code, you can use:
import 'package:commons/commons.dart';
Dialogs #
- Success Dialog
- Error Dialog
- Warning Dialog
- Info Dialog
- Confirmation Dialog
- Wait Dialog
How to use #
Success Dialog #
successDialog(
context,
"Success message",
negativeText: "Try Again",
negativeAction: () {},
positiveText: "Details",
positiveAction: () {},
);
Confirm Dialog #
confirmationDialog(
context,
"Confirm demo dialog",
positiveText: "Delete",
positiveAction: () {}
);
Toasts #
- Success Toast
- Error Toast
- Warning Toast
- Info Toast
How to use #
Commons used OKToast dart package please check OKToast requirements first.
successToast("Success toast");
Loading screen #
loadingScreen(
context,
duration: Duration(
seconds: 5,
),
loadingType: LoadingType.JUMPING,
),
Documentation #
-
For help getting started with Commons, view our online Documentation
-
Get complete code from Github