plex 0.0.6 copy "plex: ^0.0.6" to clipboard
plex: ^0.0.6 copied to clipboard

A UI Framework for the Flutter

Features #

  1. Create boilerplate code for an Application
  2. Built in login screen
  3. Built in User session manager
  4. Free useful widgets
  5. Free useful utilities
  6. Built in screens and pages
  7. 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(),
      ),
    ],
  ));
}