scaffold_factory 0.8.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 52

Scaffold Factory #


A Flutter plugin to build and customize the Flutter's scaffold widget with simple and flexible configurations. Also, this plugin provides various implementations of useful widgets that can be used in UI design. The scaffold is a class provides APIs for showing drawers, snack bars, and bottom sheets.

With Scaffold Factory Plugin you can:

  • Build a beautiful screen with easy steps.
  • Create and customize an App bar, Bottom navigation Bar, Floating Action Button and other materials widget using many defined methods.
  • Customize and show the Snack Bar with a simple method.
  • Launch URL in a web browser with a simple method.
  • Implement material color palette for scaffold and use it whenever you want.
  • Fire and handle any types of events using the Event Bus between widgets which use the same scaffold factory.

Also, you can pass the Scaffold Factory to your widgets or routes and, use whatever you need about context, color palette or other widgets.

How to use #

Import the package #

To use this plugin, add scaffold_factory as a dependency in your pubspec.yaml file. Also, You can use Dart packages' install instruction for this package.

Use the plugin #

1- Add the following import to your Dart code:

import 'package:scaffold_factory/scaffold_factory.dart';

2- Define these private variables inside your widget.

final _scaffoldKey = GlobalKey<ScaffoldState>();
ScaffoldFactory _scaffoldFactory;
MaterialPalette _sampleColorPalette = MaterialPalette(
  primaryColor: Colors.teal,
  accentColor: Colors.pinkAccent,

3- Your state class can Implements ScaffoldFactoryBehaviors interface:

class _ExampleScaffoldFactoryState extends State<ExampleScaffoldFactory> implements ScaffoldFactoryBehaviors {
  // body
  void onBackButtonPressed() {
    print("Scaffold Factory => onBackButtonPressed()");

  void onFloatingActionButtonPressed() {
    print("Scaffold Factory => onFloatingActionButtonPressed()");

  Future onEventBusMessageReceived(event) async {
    print("ScaffoldFactory: Event Received");

4- Initialize ScaffoldFactory with the scopes you want:

  void initState() {
  void _initScaffoldFactory() {
    _scaffoldFactory = ScaffoldFactory(
      scaffoldKey: _scaffoldKey,
      materialPalette: _sampleColorPalette,
    _scaffoldFactory.scaffoldFactoryBehavior = this;

      backgroundType: BackgroundType.normal,
      appBarVisibility: false,
      floatingActionButtonVisibility: false,
      drawerVisibility: false,
      nestedAppBarVisibility: false,
      bottomNavigationBarVisibility: false,

5- Pass the body widget to build method of your _scaffoldFactory object and define your theme of texts:

Widget build(BuildContext context) {
  _scaffoldFactory.textTheme = Theme.of(context).textTheme;


Widget _buildBody(BuildContext context) {
  // return your body widget    

Features #

  • Easily create a material interface with simple configurations.
  • There is an implementation for each of scaffold's widget like the AppBar, BottomNavigationBar, FloatingActionButton, etc.
buildAppBarAppBar widget
buildNestedScrollViewNestedScrollView widget
buildBottomNavigationBarBottomNavigationBar widget
buildBottomAppBarBottomAppBar widget
buildFloatingActionButtonFloatingActionButton widget
  • You can change the visibility of scaffold's widgets and pass your custom widget in the init method
      appBarVisibility: true,
      appBar: _scaffoldFactory.buildAppBar(
        titleVisibility: true,
        leadingVisibility: false,
        tabBarVisibility: false,
        titleWidget: Text('Scaffol Factory Example'),
        backgroundColor: _scaffoldFactory.colorPalette.primaryColor,

or whenever you want in the build method of your state.

Widget build(BuildContext context) {
  _scaffoldFactory.textTheme = Theme.of(context).textTheme;
  _scaffoldFactory.appBarVisibility = true;
  _scaffoldFactory.appBar = _scaffoldFactory.buildAppBar(
      titleVisibility: true,
      leadingVisibility: false,
      tabBarVisibility: false,
      titleWidget: Text('Scaffol Factory Example'),
      backgroundColor: _scaffoldFactory.colorPalette.primaryColor,


Example #

There are two examples in the example application package.

Solid Solid Solid Solid

0.8.2 #

  • Breaking change. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library.
  • Update url_launcher plugin
  • Fix snack bar problem when icon is visible

0.8.1 #

  • Fixed some bugs of EventBus
  • Deleted event bus file and added it to scaffold factory with public access

0.7.9+1 #

  • Modify scaffold_factory.dart file and improve methods

0.7.8 #

  • Modify example.dart file and simplify body widget
  • Add comments for scaffold_factory variables and methods
  • Enable Super Mixin in analysis_options.yaml
  • Update API Documentation

0.7.7 #

  • Now, The user can pass the text style to snack bar
  • Add background color parameter to init method

0.7.5 #

  • Fixed app bar problem. Removed blank space above of tab bar when title and leading widgets are invisible.
  • Removed category card's background image URL and replaced it with the local asset.

0.7.4 #

  • Change some scaffold factory's initialize parameters type to required.

0.7.3 #

  • Add analysis options to project and reformat codes with new rules.
  • Add example file for publishing in dart packages
  • Modify some import path to pass the dry-run analysis

0.7.1 #

  • Add API Documentation

0.7.0 #

  • Add bottom app bar to scaffold factory
  • Add drawer to scaffold factory
  • Modify updateAndroidFrameColor method
  • Modify SamplePlaceholder constructor
  • Some bugs fixed

0.6.0 #

  • Add Event bus to scaffold factory. Now, The user can define a custom event, fire it and stop it whenever needs. The Scaffold Factory listen to the bus and call the onEventBusMessageReceived method.
  • Change the name of ScaffoldFactoryButtonsBehavior class to ScaffoldFactoryBehaviors
  • Add a new method to scaffold factory named updateAndroidFrameColor. This method changes android's status bar and navigation bar colors.
  • Add the global EventBus object
  • Modify sample screens

0.5.0 #

  • Add new sample for snack bar
  • Add method to scaffold factory for showing snack bar
  • Modify sample floating action button and use snack bar

0.4.0 #

  • Add sample_tab_bar.dart file and implement an example of tab bar widget in scafoold factory
  • Modify colors of some sample pages
  • Modify nested app bar and complete it with vertical slider to be a better example

0.3.3 #

  • Complete nested app bar implementation and fix some bugs in scaffold factory

0.3.2 #

  • Add nested app bar
  • Create sample for nested app bar

0.3.1 #

  • Remove scaffold visibility and replace it with boolean
  • Reformat project
  • Add center text to placeholder
  • Modify code with new visibility parameters

0.3.0 #

  • Add sample_bottom_naviagation_bar
  • Add sample_placeholder
  • Modify scaffold factory and add bottom navigation bar parameters

0.2.2 #

  • Add center title switch to sample_app_bar and scaffold factory
  • Add center and floating switch to sample_floating_action_button

0.2.1 #

  • Modify variables in scaffold_factory
  • Now we can call scaffold_factory.launchURL and open the url in the web browser
  • Create routes with the specific name for example application
  • Create sample_catalog and use it as the home screen
  • Create sample_app_bar
  • Create sample_floating_action_button

0.1.4 #

  • Add Floating action button support

0.1.2 #

  • Add app bar to scaffold factory and create simple custom app bar

0.1.1 #

  • Add color palette

0.1.0 #

  • Remove .idea folder from repository
  • Clear template data and add constructor of the class

0.0.1 #

  • First commit


import 'package:flutter/material.dart';

import 'sample/sample_app_bar.dart';
import 'sample/sample_bottom_app_bar.dart';
import 'sample/sample_bottom_navigation_bar.dart';
import 'sample/sample_catalog.dart';
import 'sample/sample_floating_action_button.dart';
import 'sample/sample_nested_app_bar.dart';
import 'sample/sample_snack_bar.dart';
import 'sample/sample_tab_bar.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Scaffold Factory Example',
      debugShowCheckedModeBanner: false,
      theme: ThemeData.light(),
      routes: routes,

final routes = {
  '/': (BuildContext context) => SampleCatalog(),
  '/appBar': (BuildContext context) => SampleAppBar(),
  '/floatingActionButton': (BuildContext context) =>
  '/bottomNavigationBar': (BuildContext context) => SampleBottomNavigationBar(),
  '/bottomAppBar': (BuildContext context) => SampleBottomAppBar(),
  '/nestedAppBar': (BuildContext context) => SampleNestedAppBar(),
  '/tabBar': (BuildContext context) => SampleTabBar(),
  '/snackBar': (BuildContext context) => SampleSnackBar(),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  scaffold_factory: ^0.8.2

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:scaffold_factory/scaffold_factory.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 3, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:scaffold_factory/scaffold_factory.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:scaffold_factory/scaffold_factory.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:scaffold_factory/scaffold_factory.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:scaffold_factory/scaffold_factory.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [scaffold_factory] that is in a package requiring null.

Health suggestions

Fix lib/scaffold_factory.dart. (-0.50 points)

Analysis of lib/scaffold_factory.dart reported 1 hint:

line 439 col 28: 'subhead' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is subtitle1. This feature was deprecated after v1.13.8..

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (flutter_statusbarcolor).

Package is getting outdated. (-13.97 points)

The package was last published 59 weeks ago.

Update (-8 points)

4 image links are insecure (e.g., use https URLs instead.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
event_bus ^1.0.1 1.1.1
flutter 0.0.0
flutter_statusbarcolor ^0.1.1 0.1.6 0.2.3
url_launcher ^5.0.2 5.4.11
Transitive dependencies
collection 1.14.12 1.14.13
flutter_web_plugins 0.0.0
meta 1.1.8
platform_detect 1.4.0
plugin_platform_interface 1.0.2
pub_semver 1.4.4
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
url_launcher_macos 0.0.1+7
url_launcher_platform_interface 1.0.7
url_launcher_web 0.1.2
vector_math 2.0.8