Responsive Scaffold - On mobile it shows a list and pushes to details and on tablet it shows the List and the selected item. Maintainer: @rodydavis

Overview

Flutter Community: responsive_scaffold

Buy Me A Coffee Donate pub package github pages

responsive_scaffold

View the online demo here!

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

Online Demo: https://fluttercommunity.github.io/responsive_scaffold/

Getting Started

3 Column Layout

example

Responsive Layout

Follows Material Design Layout Docs.

md-layout

Here is a demo on various sizes.

image image image image image image

Example

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

class LayoutExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ResponsiveScaffold(
      title: Text('Responsive Layout Example'),
      drawer: ListView(
        children: <Widget>[
          ListTile(
            leading: Icon(Icons.settings),
            title: Text('Settings Page'),
          ),
          ListTile(
            leading: Icon(Icons.info),
            title: Text('Info Page'),
          ),
          ListTile(
            leading: Icon(Icons.library_books),
            title: Text('Library Page'),
          ),
          ListTile(
            leading: Icon(Icons.help),
            title: Text('Help Page'),
          ),
        ],
      ),
      endIcon: Icons.filter_list,
      endDrawer: ListView(
        children: <Widget>[
          ListTile(
            leading: Icon(Icons.filter_list),
            title: Text('Filter List'),
            subtitle: Text('Hide and show items'),
            trailing: Switch(
              value: true,
              onChanged: (val) {},
            ),
          ),
          ListTile(
            leading: Icon(Icons.image_aspect_ratio),
            title: Text('Size Settings'),
            subtitle: Text('Change size of images'),
          ),
          ListTile(
            title: Slider(
              value: 0.5,
              onChanged: (val) {},
            ),
          ),
          ListTile(
            leading: Icon(Icons.sort_by_alpha),
            title: Text('Sort List'),
            subtitle: Text('Change layout behavior'),
            trailing: Switch(
              value: false,
              onChanged: (val) {},
            ),
          ),
        ],
      ),
      trailing: IconButton(
        icon: Icon(Icons.search),
        onPressed: () {},
      ),
      body: Center(
        child: RaisedButton(
          child: Text('Close'),
          onPressed: () {
            Navigator.pop(context);
          },
        ),
      ),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.add),
        backgroundColor: Theme.of(context).accentColor,
        onPressed: () {},
      ),
    );
  }
}

Responsive List

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

tablet push mobile

  • On Tablet it will show a Master Detail View.
  • 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> {
  var _scaffoldKey = new GlobalKey<ScaffoldState>();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: ResponsiveListScaffold.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: Scaffold(
              appBar: AppBar(
                elevation: 0.0,
                title: Text("Details"),
                automaticallyImplyLeading: !tablet,
                actions: [
                  IconButton(
                    icon: Icon(Icons.share),
                    onPressed: () {},
                  ),
                  IconButton(
                    icon: Icon(Icons.delete),
                    onPressed: () {
                      if (!tablet) Navigator.of(context).pop();
                    },
                  ),
                ],
              ),
              bottomNavigationBar: BottomAppBar(
                elevation: 0.0,
                child: Container(
                  child: IconButton(
                    icon: Icon(Icons.share),
                    onPressed: () {},
                  ),
                ),
              ),
              body: Container(
                child: Center(
                  child: Text("Item: $index"),
                ),
              ),
            ),
          );
        },
        nullItems: Center(child: CircularProgressIndicator()),
        emptyItems: Center(child: Text("No Items Found")),
        slivers: <Widget>[
          SliverAppBar(
            title: Text("App Bar"),
          ),
        ],
        itemCount: 100,
        itemBuilder: (BuildContext context, int index) {
          return ListTile(
            leading: Text(index.toString()),
          );
        },
        bottomNavigationBar: BottomAppBar(
          elevation: 0.0,
          child: Container(
            child: IconButton(
              icon: Icon(Icons.share),
              onPressed: () {},
            ),
          ),
        ),
        floatingActionButton: FloatingActionButton(
          child: Icon(Icons.add),
          onPressed: () {
            _scaffoldKey.currentState.showSnackBar(SnackBar(
              content: Text("Snackbar!"),
            ));
          },
        ),
      ),
    );
  }
}
Comments
  • Generating error when implementing

    Generating error when implementing

    Launching lib\main.dart on Android SDK built for x86 in debug mode... lib\main.dart:1 /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/responsive_scaffold-1.3.0+2/lib/templates/list/responsive_list.dart:217:11: Error: No named parameter with the name 'resizeToAvoidBottomPadding'. resizeToAvoidBottomPadding: resizeToAvoidBottomPadding, ^^^^^^^^^^^^^^^^^^^^^^^^^^ /C:/src/flutter/packages/flutter/lib/src/material/scaffold.dart:1451:9: Context: Found this candidate, but the arguments don't match. const Scaffold({ ^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/responsive_scaffold-1.3.0+2/lib/templates/list/views/tablet.dart:188:15: Error: No named parameter with the name 'resizeToAvoidBottomPadding'. resizeToAvoidBottomPadding: widget?.resizeToAvoidBottomPadding, ^^^^^^^^^^^^^^^^^^^^^^^^^^ /C:/src/flutter/packages/flutter/lib/src/material/scaffold.dart:1451:9: Context: Found this candidate, but the arguments don't match. const Scaffold({ ^^^^^^^^ 2

    FAILURE: Build failed with an exception.

    • Where: Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991

    • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

    Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    opened by ruandutrab 2
  • resizeToAvoidBottomPadding not supported (flutter2)

    resizeToAvoidBottomPadding not supported (flutter2)

    resizeToAvoidBottomPadding not recognised with latest build using flutter 2 stable release. C:/flutter/.pub-cache/hosted/pub.dartlang.org/responsive_scaffold-1.3.0+2/lib/templates/list/responsive_list.dart:217:11: Error: No named parameter with the name 'resizeToAvoidBottomPadding'.

    opened by coastalgit 1
  • Added the appElevation to the other breakpoints

    Added the appElevation to the other breakpoints

    In #8 the appElevation field was added to the ResponsiveScaffold, but it was only added to the desktop breakpoint. This mistake happened because of ignorance in regard to the layout of the ResponsiveScaffold widget.

    This was spotted when the app was tested on mobile and the lack of elevation compliance was clearly visible: Screenshot-2020-02-07-at-20-49-16

    This is a mistake with the commit that introduced the feature: 59fe621

    opened by ghost 1
  • Added needed functionality the scaffold widget.

    Added needed functionality the scaffold widget.

    Well done on that plugin. It is a pleasure to watch.

    However two things were needed that your solution did not offer:

    • a customizable FAB
    • app bar elevation

    What I did:

    • Added app elevation as a field
    • Removed the restrictions on the scaffold FAB, because they were limiting useful functions like scaling. (Changed the type of the button to be Widget, instead of FloatingActionButton

    App bar elevation issue:

    Floating action button issue:

    Your app allows me to pass a FAB of type FloatingActionButton, but in my case I have a Material Backdrop and I needed my FAB to scale in accordance to the Backdrop animation. The current code doesn't allow me to pass a widget that contains a FAB, but inside it and because it is not of type FloatingActionButton, there is a compile time error: Transform.scale( child: FloatingActionButton(...), scale: transformScale );

    I really needed to make the elevation of the appBar zero, because in my app I am also implementing the Material Backdrop and in the spec sheet this is written:

    Active back layer The back layer appears at the lowest elevation (0dp) in an app, filling the entire background. It holds actionable content that is relevant to the...

    Without the FAB change the button hides my backdrop on mobile and tablet and without the elevation change the app bar looks like a lifted rectangle and not as a part of the rest of the material sheet. With changes: Screenshot-2020-02-05-at-02-46-55 For now I am using the fork I have created, but I sincerely hope that you add those features in some way. Even if you don't, the code in this repository is amazing and I will try my best to keep my fork up to date.

    opened by ghost 1
  • How to add a ScrollController to detect if I scroll to bottom at list in ResponsiveListScaffold?

    How to add a ScrollController to detect if I scroll to bottom at list in ResponsiveListScaffold?

    Hi there!

    I am working on an application and I want to implement your packages, but I have a question about how to do it.

    When I navigate to the page, I load 20 items from API first and then if scroll to bottom of the list, load next 20 items and add them to bottom of the list.

    Now, I do it with ListView.builder () and ScrollController with a listener that when the listener detects that user scrolls to bottom of list view, it throws a method to load the following items, but in ResponsiveListScaffold it does not have a controller of displacement, How can I make for what if I scroll to bottom of the list, lauch a method to load following items?

    Thanks for all.

    opened by polpenyarrojaNik 0
  • update pubspec.yaml as package moved to Flutter Community

    update pubspec.yaml as package moved to Flutter Community

    The info and links for the package on pub.dev is out of date since the package got moved to Flutter Community. This PR should fix that

    cc @AppleEducate

    opened by MaikuB 0
  • Still active?

    Still active?

    This is a really useful package! So, I'm asking myself if it is still in active development? There are lots of open issues and useful pull requests, The last closed pull request is from one and a half years ago! It would be a pity if the development did not continue. 🙏🏼

    opened by phranck 0
  • How to navigate to other page without losing ListView in responsive_scaffold package?

    How to navigate to other page without losing ListView in responsive_scaffold package?

    Hi there!

    I used responsive_scaffold package to display a list of items on left side screen and show a detail of item list on right side of the screen as in attached image.

    My question is how to navigate to another page and only change the details page without losing list, because when used a Navigator.push () changes whole page and not just the right part of screen, which would be detail. Captura de pantalla 2021-08-30 a las 8 22 08

    opened by polpenyarrojaNik 0
  • Null Safety fixes #31

    Null Safety fixes #31

    What I've done:

    • run dart migrate
    • fixed everything
    • changed deprecated stuff
    • implemented strict linting
    • fixed everything according to the linting
    • changed the example in the readme

    What needs to be done:

    • nothing

    Tested on:

    • Web
    • Android
    opened by Leptopoda 2
  • Changing some initial ResponsiveScaffold Properties

    Changing some initial ResponsiveScaffold Properties

    Hey, I am working with your responsive_scaffold and its a good solution make the app crossplattform compatible and more responsibe.

    I am now on the point where the responsive_scaffold facing its limits.

    Generally its adaptive to many cases.

    But regarding to the appbar its a bit impractical. You can only overgive the title and actions to adjust this, But what if i want use crossplatorm backbuttons and using the bottom functionality of the appbar for example for tab views? --> I need to build my appbar on my own.

    i have some ideas regarding to the responsive scaffold:

    • So i think its more useful if title and trailing + appbar specific stuff will be removed.
    • floatingActionButtons are bound to the bottom of the scaffold body, but why not to the scaffolds floating action button properties?

    In my opinion the responsive_scaffold is just a container which gives 100% controle over the scaffold but enables the power to makes the scaffold responsible regarding to the device(so what its doing atm).

    What do you think about it? Correct me if I am wrong.

    And I wonder why no more people use this package, bec responsiblitie is a main theme in flutter?!?!

    Thank you for this package btw! Good work.

    Best regards from germany,

    Robin

    image

    opened by Ronjack 1
  • Errors in example on Linux run

    Errors in example on Linux run

    I cannot run example under Linux (Linux Mint 19.3 Cinnamon - based on Ubuntu 18.04). After flutter pub get and flutter run I get:

    Launching lib/main.dart on Linux in debug mode...
    Exception: No Linux desktop project configured. See https://flutter.dev/desktop#add-desktop-support-to-an-existing-app to learn about adding Linux support to a project.
    

    After flutter create . and flutter run I get:

    Launching lib/main.dart on Linux in debug mode...
    ERROR: ../lib/templates/list/responsive_list.dart:217:11: Error: No named parameter with the name 'resizeToAvoidBottomPadding'.
    ERROR:           resizeToAvoidBottomPadding: resizeToAvoidBottomPadding,
    ERROR:           ^^^^^^^^^^^^^^^^^^^^^^^^^^                             
    ERROR: ../../../../development/flutter/packages/flutter/lib/src/material/scaffold.dart:1451:9: Context: Found this candidate, but the arguments don't match.
    ERROR:   const Scaffold({                                               
    ERROR:         ^^^^^^^^                                                 
    ERROR: ../lib/templates/list/views/tablet.dart:188:15: Error: No named parameter with the name 'resizeToAvoidBottomPadding'.
    ERROR:               resizeToAvoidBottomPadding: widget?.resizeToAvoidBottomPadding,
    ERROR:               ^^^^^^^^^^^^^^^^^^^^^^^^^^                         
    ERROR: ../../../../development/flutter/packages/flutter/lib/src/material/scaffold.dart:1451:9: Context: Found this candidate, but the arguments don't match.
    ERROR:   const Scaffold({                                               
    ERROR:         ^^^^^^^^                                                 
    Building Linux application...                                           
    Exception: Build process failed
    

    flutter doctor

    [✓] Flutter (Channel dev, 1.26.0-17.2.pre, on Linux, locale pl_PL.UTF-8)
    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    [✓] Chrome - develop for the web
    [✓] Linux toolchain - develop for Linux desktop
    [✓] Android Studio
    [✓] VS Code (version 1.53.0)
    [✓] Connected device (2 available)
    
    • No issues found!
    
    opened by digit81 4
Owner
Flutter Community
A central place for all community made Flutter packages. To get started, see the README of the 'community' repository.
Flutter Community
Example implementation of Responsive Screen for Mobile, Tablet, Web, and Desktop in Flutter

flutter_responsive A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you start

R. Rifa Fauzi Komara 7 Oct 12, 2022
A WallpaperWalaApp is a Simple Wallpaper app🏞️ developed in Flutter 💙 , with responsive UI✨ for Mobile📱 and Tablet 💻

WallpaperWalaApp A WallpaperWalaApp is a Simple Wallpaper app ??️ developed in Flutter ?? , with responsive UI ✨ for Mobile ?? and Tablet ?? . Fetch d

Dip Hire 3 Sep 16, 2022
In this repo you'll find how to responsive any screen whether it's for mobile, tablet and desktop

This repo is all about responsiveness of screen using flutter: By cloning and giving this repo a star you can get the concept of responsiveness of screen whether the screen is for mobile, tablet and desktop.

null 3 Aug 29, 2022
Responsive-Ui-builder - The responsive ui builder package contains widgets that helps you to create your UI responsive

Responsive Ui Builder Getting Started The responsive ui builder package contains

null 0 Feb 1, 2022
Flutter ticket pass - A Flutter Widget to display the details of a ticket/pass purchased by customers and display the details of the purchase

ticket_pass_package A Flutter package to display the purchase of a ticket/pass along with additional details such as list of buyers. The source code i

null 40 Aug 13, 2022
A pixel perfect dashboard for mobile, tablet and desktop.

A pixel perfect dashboard for mobile, tablet and desktop.

BotCoder 25 Dec 27, 2022
Package to select layout per orientation or device size like mobile vs tablet layouts or portrait vs landscape

proxy_layout Package to select layout per orientation or device size like mobile vs tablet layouts or portrait vs landscape Usage You have two widgets

Jimmy Aumard 8 Apr 18, 2021
Find The Latest trending and upcoming movies and tv shows with MovieDB app. The app contains all info about movies and tv shows. find similar movies or shows, Browse all genres, video trailers, backdrops, logos, and posters.

MovieDB App Features. Dynamic Theming Search Functionality Onboarding-Screen Select favourite movie Home Screen Tranding movie Movies different catego

Ansh rathod 80 Dec 12, 2022
Aplicação para aula sobre Scaffold, Drawer e Navigator

scaffold_class A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

Deyvid J. Lira 7 Dec 27, 2022
A flutter list view which can drag & move item to change order.

draggable_flutter_list A flutter list view which can drag & move item to change order. some codes come from flutter_list_drag_and_drop fix flutter_lis

刘彦博 40 Sep 22, 2022
Sardor Makhmudov 0 Feb 7, 2022
In this repo you will see how to pick images from the image library and also, see how to store the selected images on Firebase.

flutterimageapp Flutter Tutorial - Upload Images using Firebase Storage. Flutter Tutorial - Upload Images using Firebase Storage Video series can be w

Whatsupcoders 60 Nov 4, 2022
Open source Flutter package, bar indicator made of a series of selected and unselected steps

Step Progress Indicator Open source Flutter package, bar indicator made of a series of selected and unselected steps. Made by Sandro Maglione, check o

Sandro Maglione 138 Dec 15, 2022
CurrencyConverter - Flutter based application that uses web-scrapping to show currency of selected countries.

CurrencyConverter - Flutter based application that uses web-scrapping to show currency of selected countries.

Dhruv Dholakia 1 Jul 7, 2022
The simple way to show the user some information on your selected widget.

Info Popup The simple way to show the user some information on your selected widget. Features Info holder with dynamic size Fully editable content are

Salih Can 9 Nov 23, 2022
Get It - Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App. Maintainer: @escamoteur

❤️ Sponsor get_it This is a simple Service Locator for Dart and Flutter projects with some additional goodies highly inspired by Splat. It can be used

Flutter Community 1k Jan 1, 2023
Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.

nfc_in_flutter NFC in Flutter is a plugin for reading and writing NFC tags in Flutter. It works on both Android and iOS with a simple stream interface

Andi Semler 113 Sep 28, 2022
State Persistence - Persist state across app launches. By default this library store state as a local JSON file called `data.json` in the applications data directory. Maintainer: @slightfoot

State Persistence Persist state across app launches. By default this library store state as a local JSON file called data.json in the applications dat

Flutter Community 70 Sep 28, 2022
🎯 Automatically organize your dart imports. Maintainer: @gleich

___ _____ ______ ________ ________ ________ _________ |\ \|\ _ \ _ \|\ __ \|\ __ \|\ __ \|\___ ___\ \ \ \ \ \\\__\ \ \ \ \|

Flutter Community 138 Dec 12, 2022