responsive_scaffold 0.0.5+1

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

responsive_scaffold #

On mobile it shows a list and pushes to details and on tablet it shows the List and the selected item.

Getting Started #

  • You can use this in two modes ResponsiveScaffold and ResponsiveScaffold.builder.
  • On Mobile the ListView will push to the details screen

mobile

push

  • On Tablet it will show a Master Detail View.

tablet

  • You can add additional Slivers to the Scrollview and the AppBar is optional.

Example #

import 'package:flutter/material.dart';

import 'package:responsive_scaffold/responsive_scaffold.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: ResponsiveScaffold.builder(
        detailBuilder: (BuildContext context, int index) {
          return DetailsScreen(
            appBar: AppBar(
              elevation: 0.0,
              title: Text("Details"),
              actions: [
                IconButton(
                  icon: Icon(Icons.share),
                  onPressed: () {},
                ),
              ],
            ),
            body: Container(
              child: Center(
                child: Text("Item: $index"),
              ),
            ),
          );
        },
        slivers: <Widget>[
          SliverAppBar(
            title: Text("App Bar"),
          ),
        ],
        itemCount: 100,
        itemBuilder: (BuildContext context, int index) {
          return ListTile(
            leading: Text(index.toString()),
          );
        },
      ),
    );
  }
}

0.0.5 #

  • Added Mobile Navigator BuildContext navigatorContext

0.0.4 #

  • Aded Use rootNavigator

0.0.3 #

  • Fixing Version
  • Updating UI
  • Removing extendBody till next update
  • FAB now showing up in right place
  • Adding Scaffold Key
  • Updated Example

0.0.2 #

  • Adding Customizable Flex
  • Conditional Building

0.0.1 #

  • Adding Widgets

example/README.md

responsive_scaffold_example #

Demonstrates how to use the responsive_scaffold plugin.

import 'package:flutter/material.dart';

import 'package:responsive_scaffold/responsive_scaffold.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  var _scaffoldKey = new GlobalKey<ScaffoldState>();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: ResponsiveScaffold.builder(
        scaffoldKey: _scaffoldKey,
        detailBuilder: (BuildContext context, int index, bool tablet) {
          return DetailsScreen(
            appBar: AppBar(
              elevation: 0.0,
              title: Text("Details"),
              actions: [
                IconButton(
                  icon: Icon(Icons.share),
                  onPressed: () {},
                ),
                IconButton(
                  icon: Icon(Icons.delete),
                  onPressed: () {
                    if (!tablet) Navigator.of(context).pop();
                  },
                ),
              ],
            ),
            body: Container(
              child: Center(
                child: Text("Item: $index"),
              ),
            ),
          );
        },
        slivers: <Widget>[
          SliverAppBar(
            title: Text("App Bar"),
          ),
        ],
        // bottomNavigationBar: BottomAppBar(
        //   child: Container(
        //     height: 50.0,
        //     color: Colors.green,
        //   ),
        // ),
        itemCount: 100,
        itemBuilder: (BuildContext context, int index) {
          return ListTile(
            leading: Text(index.toString()),
          );
        },
        floatingActionButton: FloatingActionButton(
          child: Icon(Icons.add),
          onPressed: () {
            _scaffoldKey.currentState.showSnackBar(SnackBar(
              content: Text("Snackbar!"),
            ));
          },
        ),
      ),
    );
  }
}


Use this package as a library

1. Depend on it

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


dependencies:
  responsive_scaffold: ^0.0.5+1

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:responsive_scaffold/responsive_scaffold.dart';
  
Version Uploaded Documentation Archive
0.0.5+1 Mar 23, 2019 Go to the documentation of responsive_scaffold 0.0.5+1 Download responsive_scaffold 0.0.5+1 archive
0.0.5 Mar 23, 2019 Go to the documentation of responsive_scaffold 0.0.5 Download responsive_scaffold 0.0.5 archive
0.0.4 Mar 23, 2019 Go to the documentation of responsive_scaffold 0.0.4 Download responsive_scaffold 0.0.4 archive
0.0.3 Mar 15, 2019 Go to the documentation of responsive_scaffold 0.0.3 Download responsive_scaffold 0.0.3 archive
0.0.2 Mar 14, 2019 Go to the documentation of responsive_scaffold 0.0.2 Download responsive_scaffold 0.0.2 archive
0.0.1 Mar 14, 2019 Go to the documentation of responsive_scaffold 0.0.1 Download responsive_scaffold 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
72
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
84
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.3.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/ui/views/mobile.dart.

Run flutter format to format lib/ui/views/mobile.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test