app_sprout 0.0.5 copy "app_sprout: ^0.0.5" to clipboard
app_sprout: ^0.0.5 copied to clipboard

Seed Project for Flutter Apps

This is a Seed Application which helps any Flutter Dev team to create a Flutter app ( Android, iOS, Web , Windows and Linux) from scratch that includes below features

  1. Left Navigation Nodes.
  2. App Bar, Botttom Tool bar, Slider Controls.
  3. Push Notification.
  4. Authentications (Face ID and Fingerprint).
  5. Build controls like Button, text field with custom styling.

Steps :

  1. Create a Flutter App :
    flutter create AppName

  2. To Run the base app flutter run

  3. Import this package : flutter pub add app_sprout

  4. Replace main.dart code

Widget build(BuildContext context) { return MaterialApp( home: SplashScreen( nextScreen: HomeScreen(), imagePath: 'assets/logo.png', ), ); } }

class HomeScreen extends StatelessWidget { HomeScreen({super.key});

@override Widget build(BuildContext context) { return Scaffold( body: Center(child: Text('Welcome to Home Screen')), ); } }

  1. Splash Screen Set up:

Create folder assets and add logo.png Add below line in pubspec assets:

  • assets/logo.png
  1. App Bar Set up:

appBar: AppBar( title: const Text('Whats New!'), ),

  1. Left Drawer Set up:

List

final toolbarItems = [ Toolbar( label: 'new', ), Toolbar(label: 'notification'), ];

drawer: DrawerWidget( drawerItems: drawerItems, onTapFunction: (context, identifier) {}),

  1. Right Drawer Set up:

endDrawer: RightDrawer( drawerItems: drawerItems, onTapFunction: (context, identifier) {}),

  1. Bottom tool bar Set up:

bottomNavigationBar: BottomToolbar( items: toolbarItems, onTapFunction: (context, identifier) {}, ),

  1. Push Notification Set up:

void initState() { super.initState(); try { NotificationServices notificationServices = NotificationServices(); notificationServices.requestNotificationPermission(); notificationServices.firebaseInit(context); notificationServices.setupInteractMessage(context); final globalData = Provider.of

    notificationServices.getDeviceToken().then((value) {
      if (value == "invalid") {
        const snackBar = SnackBar(
          content: Text('token is invalid'),
        );
        ScaffoldMessenger.of(context).showSnackBar(snackBar);
      } else {
        globalData.setDeviceId(value);
        print('device token is : $value');
      }
    });
} catch (e) {
  print('issue getting token: $e');
}

}

  1. Authentication Complete Code

import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:local_auth/local_auth.dart'; import 'package:pinaka/components/new.dart'; import 'package:pinaka/components/notification.dart';

class AuthenticateScreen extends StatefulWidget { const AuthenticateScreen({super.key}); @override State

class AuthenticateScreenState extends State

final toolbarItems = [ Toolbar(identifier: 'new', label: 'new', icon: 'activity'), Toolbar( identifier: 'notification', label: 'notification', icon: 'appointments'), ];

final List

@override void initState() { super.initState(); auth = LocalAuthentication(); auth.isDeviceSupported().then( (bool isSupported) => setState(() { _supportState = isSupported; }), ); }

void onTapFunction(BuildContext context, String identifier) { if (routes.containsKey(identifier)) { Navigator.of(context).push( PageRouteBuilder( transitionDuration: const Duration(milliseconds: 500), pageBuilder: (context, animation, secondaryAnimation) { return SlideTransition( position: Tween

Scaffold.of(context).closeEndDrawer();

}

final Map<String, Widget> routes = { 'new': const NewScreen(), 'notification': const NotificationScreen(), 'authenticate': const AuthenticateScreen(), };

@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Authentication'), ), body: Column( mainAxisAlignment: MainAxisAlignment.center, children:

Future

Future