backdrop 0.2.8

  • Readme
  • Changelog
  • Example
  • Installing
  • 95

backdrop #

pub.dev Gitlab Issues Gitlab Contributors Gitlab Stars Gitlab Forks

Backdrop implementation in flutter.

This widget is in active development. Wait for the stable v1.0.0. Any contribution, idea, criticism or feedback is welcomed.

packagehttps://pub.dev/packages/backdrop
Git Repohttps://gitlab.com/daadu/backdrop
Issue Trackerhttps://gitlab.com/daadu/backdrop/issues
Github Mirror Repohttps://github.com/daadu/backdrop

Getting started #

Follow the medium article to Quickly Implement Backdrop in Flutter.

Usage #

BackdropScaffold #

Use BackdropScaffold instead of the standard Scaffold in your app. A backLayer and a frontLayer have to be defined for the backdrop to work.

BackdropScaffold(
    title: Text("Backdrop Example"),
    backLayer: Center(
        child: Text("Back Layer"),
    ),
    frontLayer: Center(
        child: Text("Front Layer"),
    ),
    iconPosition: BackdropIconPosition.leading,
)
BackdropScaffold example

To use backdrop for navigation, use the provided BackdropNavigationBackLayer as backLayer.

The BackdropNavigationBackLayer contains a property items representing the list elements shown on the back layer. The front layer has to be "manually" set depending on the current index, which can be accessed with the onTap callback.

class _MyAppState extends State<MyApp> {
  int _currentIndex = 0;
  final List<Widget> _frontLayers = [Widget1(), Widget2()];

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Backdrop Demo',
      home: BackdropScaffold(
        title: Text("Backdrop Navigation Example"),
        iconPosition: BackdropIconPosition.leading,
        actions: <Widget>[
          BackdropToggleButton(
            icon: AnimatedIcons.list_view,
          ),
        ],
        frontLayer: _frontLayers[_currentIndex],
        backLayer: BackdropNavigationBackLayer(
          items: [
            ListTile(title: Text("Widget 1")),
            ListTile(title: Text("Widget 2")),
          ],
          onTap: (int position) => {setState(() => _currentIndex = position)},
        ),
      ),
    );
  }
}
BackdropNavigationScaffold example

For more information, check out sample code in the example directory

Contribute #

  1. You'll need a gitlab account. (Sorry, if you had to create one!!)
  2. Fork the repository.
  3. Implement features from to-do, fix issues, etc.
  4. Add your name and email in AUTHORS file
  5. Send merge request.
  6. Star this project.
  7. Become a hero!!

Features and bugs #

Please file feature requests and bugs at the issue tracker.

TODO #

  • Properly document the usage of the widget in README.md
  • Properly document classes and public methods
  • scaffoldKey provided to access scaffold directly
  • Write an example flutter app to demonstrate options and functionality
  • Using InheritedWIdget for storing controller in state and accessing it throughout
  • Dynamic height for backdrop - based on height of backpanel
  • Fixed height for backdrop - provided in argument of BackdropScaffold
  • BackdropNavigation : Using backpanel for navigation
  • BackdropTitle : Different title for backpanel and frontpanel visibility
  • BackdropAction : Action with view in backpanel
  • subheader argument (optional) in BackdropScaffol
  • BackdropToggle : widget to fling backdrop anywhere inside the scaffol
  • BackdropButton : widget that build button with BackdropToggle with default menu_close icon. Can directly be used in actions.

[0.2.8] - 16 January 2020 #

  • disabling focus on backLayer when not visible

[0.2.7] - 18 December 2019 #

  • updated README.md

[0.2.0] - 18 December 2019 #

  • NavigationBackLayer widget - for easily implement navigation with backdrop
  • stickyFrontLayer - dynamic height for backdrop - based on height of backLayer
  • animationCurve for backdrop can be passed as parameter
  • minor bug fixes

[0.1.0] - 28 July 2018. #

  • opacity fixes in BackdropScaffold.
  • headerHeight option added in BackdropScaffold.
  • frontLayerBorderRadius option added in BackdropScaffold
  • refactor: body -> frontLayer
  • refactor: backpanel -> backLayer
  • BackdropToggleButton widget implemented.

[0.0.1] - 21 July 2018. #

  • Basic backdrop implementation.
  • BackdropScaffold widget implemented.

example/lib/main.dart

import 'package:backdrop/backdrop.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Backdrop Demo',
      home: BackdropScaffold(
        title: Text("Backdrop Example"),
        backLayer: Center(
          child: Text("Back Layer"),
        ),
        frontLayer: Center(
          child: Text("Front Layer"),
        ),
        iconPosition: BackdropIconPosition.leading,
        actions: <Widget>[
          BackdropToggleButton(
            icon: AnimatedIcons.list_view,
          ),
        ],
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  backdrop: ^0.2.8

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:backdrop/backdrop.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
90
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]
95
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Format lib/backdrop.dart.

Run flutter format to format lib/backdrop.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
test any