Giter Site home page Giter Site logo

glourencosilva / scaled_animated_scaffold Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tapizquent/scaled_animated_scaffold

0.0 0.0 0.0 928 KB

A Scaffold-like Widget that animates and reveals a menu

License: Apache License 2.0

Kotlin 0.34% Swift 1.09% Objective-C 0.10% Dart 98.47%

scaled_animated_scaffold's Introduction

Scaled Animated Scaffold

Pub Package

A customized Scaffold widget that animates and scales down its content revealing a fully-customizable menu while keeping other functionality developers are used to intact.

Image

Usage

Make sure to check out example project.

For additional info please refer to API docs.

Installation

Add to pubspec.yaml:

dependencies:
  scaled_animated_scaffold: ^0.0.6

Then import it to your project:

import 'package:scaled_animated_scaffold/scaled_animated_scaffold.dart';

And finally create the ScaledAnimatedScaffold with the ScaledAnimatedScaffoldMenuConfiguration:

@override
Widget build(BuildContext context) {
  return ScaledAnimatedScaffold(
    menuConfiguration: ScaledAnimatedScaffoldMenuConfiguration(
      header: ScaledAnimatedScaffoldMenuButton(
        icon: Icon(
          Icons.account_circle,
        ),
        label: Text('John Wilkins'),
        onPressed: () {},
      ),
      content: Column(
        children: [
          ScaledAnimatedScaffoldMenuButton(
            icon: Icon(Icons.star),
            label: Text('Favorites'),
            onPressed: () {},
          ),
        ],
      ),
      footer: ScaledAnimatedScaffoldMenuButton(
        icon: Icon(
          Icons.settings,
        ),
        label: Text('Settings'),
        onPressed: () {},
      ),
    ),
    body: Center(
      child: Text('Hello World'),
    ),
  );
}

The menu can be reveled by tapping in the ScaledAnimatedScaffoldAppBar's menu icon or by swipping from the left of the screen, just as you would with a Drawer

Using the ScaledAnimatedScaffoldMenuButton is not at all required but it nicely aligns the button content to the left, whereas other buttons such as FlatButton center the content, but you are free to use any widget you desire

Since this is a special type of Scaffold, no Drawer can be specified as it would conflict with the revealing of the menu

ScaledAnimatedScaffold contains many other properties that can be customized such as:

  • whether to show the shadow under the Scaffold when the menu is visible with showShadow
  • the color of the shadow with shadowColor
  • the opening and closing animation duration with animationDuration
  • the border radius of the Scaffold when menu is visible with boderRadius
  • and much more!

AppBar

Since the opening and closing on the menu is handled internally, a regular material AppBar will not work for the ScaledAnimatedScaffold. Instead, you can use the adjusted ScaledAnimatedScaffoldAppBar which behaves very similarly to the regular AppBar but with minor restrictions such as, the leading widget can't be assigned but you can easily change the menu icon by specifying the leadingIcon property. Most other properties are kept intact and can be used the same way as the regular AppBar

@override
  Widget build(BuildContext context) {
    return ScaledAnimatedScaffold(
      appBar: ScaledAnimatedScaffoldAppBar(
        brightness: Brightness.light,
        title: Text('Scaled Scaffold'),
      ),
      body: ...
    );
  }

scaled_animated_scaffold's People

Contributors

tapizquent avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.