plex 0.0.6 plex: ^0.0.6 copied to clipboard
A UI Framework for the Flutter
Features #
- Create boilerplate code for an Application
- Built in login screen
- Built in User session manager
- Free useful widgets
- Free useful utilities
- Built in screens and pages
- Builtin form builder from model class
Getting started #
Install the plex
in your application.
Usage #
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(PlexApp(
themeFromColor: const Color(0xFF26A9E1),
//themeFromImage: const AssetImage('assets/images/logo.png'),
//You can also use image to load theme by image color pallets but dont use both at the same time
appLogo: Image.asset(Assets.assetsLogo),
title: 'Application Name',
initialRoute: '/dashboard',
//Optional
useAuthorization: true,
//Optional Note: But required when useAuthorization is true
loginConfig: PlexLoginConfig(
additionalWidgets: Container(),
onLogin: (email, password) async {
//Chek user credentials
//If anything wrong return null
//If authentication is successfull return a PlexUser object
//or subclass of PlexUser
return PlexUser({
"Key": "Value",
});
}),
routes: [
//Use plex Route to add another screen in the application
PlexRoute(
route: '/dashboard',
category: "Tables",
title: "Data Table",
logo: const Icon(Icons.account_balance_outlined),
//Return a widget that will be diaplayed when this page or route is called
screen: (key, context) => Container(
//This PlexDataTable usage will show how you can show a data table using plex
child: PlexDataTable(
onRefresh: () {},
columns: const ["Id", "First Name", "Last Name", "Emp Code", "Designation", "Grade", "Company"],
rows: const [
["1", "First Name", "Last Name", "0003001", "Designation", "Grade", "Company Pvt. Ltd"],
["1", "First Name", "Last Name", "0003001", "Designation", "Grade", "Company Pvt. Ltd"],
["1", "First Name", "Last Name", "0003001", "Designation", "Grade", "Company Pvt. Ltd"],
["1", "First Name", "Last Name", "0003001", "Designation", "Grade", "Company Pvt. Ltd"],
["1", "First Name", "Last Name", "0003001", "Designation", "Grade", "Company Pvt. Ltd"],
["1", "First Name", "Last Name", "0003001", "Designation", "Grade", "Company Pvt. Ltd"],
],
),
),
),
//Other Screens
PlexRoute(
route: '/settings,
category: "Settings",
title: "Settings",
logo: const Icon(Icons.settings),
screen: (key, context) => Container(),
),
],
));
}