scaffold_factory 0.7.8

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new73

Scaffold Factory

Pub

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.

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
 
  @override
  void onBackButtonPressed() {
    print("Scaffold Factory => onBackButtonPressed()");
  }

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

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

4- Initialize ScaffoldFactory with the scopes you want:

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

    _scaffoldFactory.init(
      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:

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

  return _scaffoldFactory.build(_buildBody(context));
}

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.
MethodOutput
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
 _scaffoldFactory.init(
      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.

@override
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,
    );

  return _scaffoldFactory.build(_buildBody(context));
}

Example

There are two examples in the example application package.

Solid Solid Solid Solid

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.3

  • 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

example/README.md

Scaffold Factory Examples

There are two example applications to demonstrate how to use the scaffold_factory plugin.

Example 1

Demonstrates how to use the scaffold_factory plugin. Run the example.dart file to use this example.

Solid Solid

Example 2

Sample application with a catalog to show you how to implement the different parts of the scaffold_factory plugin. Run the main.dart file to use this example.

Solid Solid Solid Solid

Use this package as a library

1. Depend on it

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


dependencies:
  scaffold_factory: ^0.7.8

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages 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';
  
Version Uploaded Documentation Archive
0.7.8 Nov 23, 2018 Go to the documentation of scaffold_factory 0.7.8 Download scaffold_factory 0.7.8 archive
0.7.7 Nov 21, 2018 Go to the documentation of scaffold_factory 0.7.7 Download scaffold_factory 0.7.7 archive
0.7.6 Nov 21, 2018 Go to the documentation of scaffold_factory 0.7.6 Download scaffold_factory 0.7.6 archive
0.7.5 Nov 21, 2018 Go to the documentation of scaffold_factory 0.7.5 Download scaffold_factory 0.7.5 archive
0.7.4 Nov 19, 2018 Go to the documentation of scaffold_factory 0.7.4 Download scaffold_factory 0.7.4 archive
0.7.3 Nov 18, 2018 Go to the documentation of scaffold_factory 0.7.3 Download scaffold_factory 0.7.3 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
47
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
73
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
event_bus ^1.0.1 1.0.1
flutter 0.0.0
flutter_statusbarcolor ^0.1.1 0.1.1
url_launcher ^4.0.1 4.0.2
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8