Giter Site home page Giter Site logo

akshathjain / sliding_up_panel Goto Github PK

View Code? Open in Web Editor NEW
1.3K 20.0 377.0 136.11 MB

A draggable Flutter widget that makes implementing a SlidingUpPanel much easier!

Home Page: https://pub.dartlang.org/packages/sliding_up_panel

License: Other

Objective-C 0.09% Dart 92.86% Ruby 5.02% Python 0.80% Kotlin 0.29% Swift 0.94%
dart flutter plugin

sliding_up_panel's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sliding_up_panel's Issues

different layout on directions

when i change slideDirection to SlideDirection.DOWN or SlideDirection.DOWN i have different layout on screen

http://s6.uplod.ir/i/00953/sz9fo2k942ih.png

http://s6.uplod.ir/i/00953/cf5v1l6xalbp.png

SlidingUpPanel(
  slideDirection:SlideDirection.DOWN,
  maxHeight: MediaQuery.of(context).size.height / 2,
  renderPanelSheet: false,
  backdropEnabled: true,
  boxShadow: [
    BoxShadow(color: Colors.black, blurRadius: 2),
  ],
  panel: Container(
    decoration: BoxDecoration(
      color: Colors.blueGrey,
      borderRadius: BorderRadius.all(Radius.circular(10.0)),
    ),
    margin: const EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
    child: Center(
      child: TextField(

      )
    ),
  ),
  collapsed: Container(
    decoration: BoxDecoration(
        color: Colors.white,
        /*borderRadius: BorderRadius.only(
            bottomLeft: Radius.circular(10.0),
            bottomRight: Radius.circular(10.0)),*/
        boxShadow: [
          BoxShadow(
            blurRadius: 20.0,
            color: Colors.grey,
          ),
        ]),
    margin: const EdgeInsets.all(10.0),
    child: Center(
      child: Text("This is the SlidingUpPanel when open"),
    ),
  ),
)

Borders will not round properly

Hi,

I am unable to get the borders to round correctly on my application. Instead, it creates a colour that matches my background colour to fill the corners with.

In release mode weird first few frames flicker on iOS (more obvious on old devices)

As in other similar libraries, this one has that issue, that the size is defined by MediaQuery.of(context).size.width and on the very beggining the issue that may happen is that there is no width defined, or it's wrong. And the process of calculating this value differs in release and debug modes. Issue also reproducable with the example provided. It is obvious on iPhone 5s and pretty noticable on iPhone 6 and family.

Sliding up panel moves up when keyboard appears

I have a textfield inside the panel, upon focusing on it the keyboard appears and the whole sliding panel gets pushed up. How do I make it stay at current position, or perhaps only move up a bit.

Screenshot 2019-06-20 at 8 41 21 PM

Screenshot 2019-06-20 at 8 41 45 PM

Close panel with scrollable content without need of an empty space.

It would be nice if we could close the panel that has scrollable content without needing the empty space. The idea is quite simple: when you can't scroll up the content anymore, the panel should start to close (just like it is with Google Map). The execution though, is quite hard. I tried creating a package from ground up with this feature in mind, but I couldn't do it.

minSnapDistance for hide

Right now the y position user needs to bring the panel down for it to disappear is fixed(or maybe a fraction of the maxHeight). Developer should be able to set this according to his/her own needs imho.

Add a parallax effect as the panel opens

Add an option that allows the user to configure whether or not there's a parallax effect as the panel is opened. Essentially, this means that as the panel opens, the body slides up as well.

The parallax effect should be configurable with a parameter (such as parallaxOffset) that takes in a double ranging from 0.0 to 1.0 where 0.0 indicates no parallax and 1.0 indicates that the body should be offset by the same amount as the panel's offset from its collapsed state (i.e. a scrolling effect).

Scrollable content as body

How can I add something scrollable like a ListView as the body?
Currently the closed panel hides the content and disables scrolling on the content.
Also a padding beneath the closed panel needs to be added for that.
Is such thing possible yet?

Set default state to open?

Hi, how can we set the default pannel to be opened;

I use this Widget as my Home page which i need to open this Pannel as default.

So how can we set it?

Full Height with Scaffold, no safe area

Hello, I'm trying to extend the Panel to "full height" when it is open

SlidingUpPanel(
  minHeight: UiPlayerShrinked._kPlayerBodyHeight,
  maxHeight: MediaQuery.of(context).size.height,
  controller: _pc,
  onPanelOpened: () => updateIsPlayerExtendedShowing(true),
  onPanelClosed: () => updateIsPlayerExtendedShowing(false),
  collapsed: buildShrinkedPlayer(playingBeat, context),
  panel: Scaffold(
    body: Text('Scaffold'),
  ),

Although there are a couple of problems:

First is this error:

flutter: #11     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout 
package:flutter/…/rendering/proxy_box.dart:105
flutter: #12     RenderObject.layout 
package:flutter/…/rendering/object.dart:1644
flutter: #13     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout 
package:flutter/…/rendering/proxy_box.dart:105
flutter: #14     RenderObject.layout 
package:flutter/…/rendering/object.dart:1644
flutter: #15     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout 
package:flutter/…/rendering/proxy_box.dart:105
flutter: #16     RenderObject.layout 
package:flutter/…/rendering/object.dart:1644
flutter: #17     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout 
package:flutter/…/rendering/proxy_box.dart:105
flutter: #18     RenderObject.layout 
package:flutter/…/rendering/object.dart:1644
flutter: #19     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout 
package:flutter/…/rendering/proxy_box.dart:105
flutter: #20     RenderObject.layout 
package:flutter/…/rendering/object.dart:1644
flutter: #21     RenderConstrainedOverflowBox.performLayout 
package:flutter/…/rendering/shifted_box.dart:571
flutter: #22     RenderObject._layoutWithoutResize 
package:flutter/…/rendering/object.dart:1519
flutter: #23     PipelineOwner.flushLayout 
package:flutter/…/rendering/object.dart:766
flutter: #24     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame 
package:flutter/…/rendering/binding.dart:347
flutter: #25     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame 
package:flutter/…/widgets/binding.dart:701
flutter: #26     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback 
package:flutter/…/rendering/binding.dart:286
flutter: #27     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback 
package:flutter/…/scheduler/binding.dart:1012
flutter: #28     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame 
package:flutter/…/scheduler/binding.dart:952
flutter: #29     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame 
package:flutter/…/scheduler/binding.dart:864
flutter: #33     _invoke  (dart:ui/hooks.dart:219:10)
flutter: #34     _drawFrame  (dart:ui/hooks.dart:178:3)
flutter: (elided 5 frames from class _AssertionError and package dart:async)
flutter:
flutter: The following RenderObject was being processed when the exception was fired:
flutter:   RenderCustomMultiChildLayoutBox#09649 relayoutBoundary=up8 NEEDS-LAYOUT NEEDS-PAINT
flutter:   creator: CustomMultiChildLayout ← AnimatedBuilder ← DefaultTextStyle ← AnimatedDefaultTextStyle ←
flutter:   _InkFeatures-[GlobalKey#ad7ea ink renderer] ← NotificationListener<LayoutChangedNotification> ←
flutter:   PhysicalModel ← AnimatedPhysicalModel ← Material ← PrimaryScrollController ← _ScaffoldScope ←
flutter:   Scaffold ← ⋯
flutter:   parentData: <none> (can use size)
flutter:   constraints: BoxConstraints(0.0<=w<=414.0, h=896.0)
flutter:   size: Size(414.0, 896.0)
flutter: This RenderObject had the following descendants (showing up to depth 5):
flutter:   _RenderLayoutBuilder#0aed1 relayoutBoundary=up9
flutter:     _RenderScrollSemantics#2b11b relayoutBoundary=up10
flutter:       RenderPointerListener#b3ac8 relayoutBoundary=up11
flutter:         RenderSemanticsGestureHandler#4a540 relayoutBoundary=up12
flutter:           RenderPointerListener#d0ada relayoutBoundary=up13
flutter:   RenderConstrainedBox#adef0 relayoutBoundary=up9
flutter:     RenderSemanticsAnnotations#3a36e relayoutBoundary=up10
flutter:       RenderAnnotatedRegion<SystemUiOverlayStyle>#61585 relayoutBoundary=up11
flutter:         RenderPhysicalModel#e90d0 relayoutBoundary=up12
flutter:           _RenderInkFeatures#4d6ad relayoutBoundary=up13
flutter:   RenderFlex#a74c8 relayoutBoundary=up9 NEEDS-PAINT
flutter:     RenderStack#834eb relayoutBoundary=up10 NEEDS-PAINT
flutter:       RenderLimitedBox#3e5ec relayoutBoundary=up11
flutter:         RenderConstrainedBox#de0f0 relayoutBoundary=up12
flutter:       RenderLimitedBox#78b88 relayoutBoundary=up11
flutter:         RenderConstrainedBox#e7caa relayoutBoundary=up12
flutter:       RenderSemanticsGestureHandler#5ff96 relayoutBoundary=up11 NEEDS-PAINT
flutter:         RenderPointerListener#86019 relayoutBoundary=up12 NEEDS-PAINT
flutter:           RenderConstrainedBox#54ac0 relayoutBoundary=up13 NEEDS-PAINT
flutter:     RenderDecoratedBox#24077 relayoutBoundary=up10
flutter:       RenderConstrainedBox#227f5 relayoutBoundary=up11
flutter:         RenderPadding#c4b38 relayoutBoundary=up12
flutter:           RenderFlex#64816 relayoutBoundary=up13
flutter:   RenderStack#02564 relayoutBoundary=up9
flutter:     RenderTransform#35b38 relayoutBoundary=up10
flutter:       RenderTransform#c3d02 relayoutBoundary=up11
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
flutter: Another exception was thrown: 'package:flutter/src/material/scaffold.dart': Failed assertion: line 423 pos 16: 'bodyMaxHeight <= math.max(0.0, looseConstraints.maxHeight - contentTop)': is not true.
flutter: Another exception was thrown: A RenderFlex overflowed by 10 pixels on the bottom.
flutter: Another exception was thrown: 'package:flutter/src/material/scaffold.dart': Failed assertion: line 423 pos 16: 'bodyMaxHeight <= math.max(0.0, looseConstraints.maxHeight - contentTop)': is not true.
flutter: Another exception was thrown: 'package:flutter/src/material/scaffold.dart': Failed assertion: line 423 pos 16: 'bodyMaxHeight <= math.max(0.0, looseConstraints.maxHeight - contentTop)': is not true.
flutter: Another exception was thrown: 'package:flutter/src/material/scaffold.dart': Failed assertion: line 423 pos 16: 'bodyMaxHeight <= math.max(0.0, looseConstraints.maxHeight - contentTop)': is not true.
flutter: Another exception was thrown: 'package:flutter/src/material/scaffold.dart': Failed assertion: line 423 pos 16: 'bodyMaxHeight <= math.max(0.0, looseConstraints.maxHeight - contentTop)': is not true.
flutter: Another exception was thrown: 'package:flutter/src/material/scaffold.dart': Failed assertion: line 423 pos 16: 'bodyMaxHeight <= math.max(0.0, looseConstraints.maxHeight - contentTop)': is not true.
flutter: Another exception was thrown: 'package:flutter/src/material/scaffold.dart': Failed assertion: line 423 pos 16: 'bodyMaxHeight <= math.max(0.0, looseConstraints.maxHeight - contentTop)': is not true.
flutter: Another exception was thrown: Updated layout information required for _RenderLayoutBuilder#0aed1 relayoutBoundary=up9 NEEDS-LAYOUT to calculate semantics.
	[C61.1 903ABA02-99A7-41A4-B22F-87E88066A736 192.168.1.117:62932<->18.194.48.246:443]
	Connected Path: satisfied (Path is satisfied), interface: en0
	Duration: 30.893s, DNS @0.000s took 0.001s, TCP @0.003s took 0.031s, TLS took 0.069s
	bytes in/out: 5047/1673, packets in/out: 8/6, rtt: 0.031s, retransmitted packets: 0, out-of-order packets: 0

The second issue is that there is no "safe area". I'm actually trying to emulate a "view" when the panel is open, with AppBar and Body but I can't achieve that because the content is pushed to the very edges

Body is covered by collapsed slide up panel

I am using a ListView as body and it is a list of items. However when the panel is collapsed the body is not above the panel. The last item in the ListView is covered by the collapsed panel. ��

How can I shift it up so the ListView is above the collapsed panel, as to show the last item?

Close panel when keyboard is open

It would be useful to add the option for close automatically the panel when the keyboard is open.
As show in the screenshot the panel is above the keyboard. When the panel is fully opened and a TextField is focused the panel obscure all the view.

not-fully opened
screenshot

fully opened
screenshot 2

panel does not dismiss when backdropEnabled: true

When the user presses anywhere except the panel, the panel should hide. But right now nothing happens.

Also, the backdrop overlay only covers the body of the Scaffold. BottomNavigationBar and AppBar are not greyed out.

Allow to add listeners to a PanelController

For the onPanelSlide , onPanelClosed and onPanelOpened.

For example:

PanelController pc = PanelController();
pc.addOnPanelSlideListener((double position){
  print(position);
});

Infinite height?

First of all, it's great implementation. I have been looking for a widget like this for a while and I had implemented it from scratch but it was no where as smooth as your implementation. I have been playing around with different properties but i am not able to implement it with infinite height or with height that's larger than screen size. I am trying implement it with floating effect, so how would i implement when height is larger than screen size? i want it to scroll/drag as long as there are items. Thanks in advance!

Adding Opacity

What about adding features to adjust opacity? I think that will help people who want to use gradient background

close panel when i press on back

how can i close panel when i press on back button on phone?

this code don't work

class _LoginForm extends State<LoginForm> with SingleTickerProviderStateMixin {
  PanelController _pc = new PanelController();

...

return WillPopScope(
  onWillPop: () {
    if(_pc.isPanelShown()){
      _pc.hide();
    }
  },
  child: Scaffold(

tutorial

Some tutorial or artical on medium on this would be amazing!:)

PanelController should have a listener for when the panel slides

The PanelController should have a listener that subscribes to the animation controller and is called every time the animation changes (i.e. the panel slides open/closed). This can be useful for adding custom animations that are based on the panel position. For example:

PanelController pc = new PanelController();

pc.addOnPanelSlideListener((double position){
  print(position); //0.0 to 1.0 where 0.0 is full collapsed and 1.0 is fully open
});

Example with Provider for PanelController State Management

So, currently i'm use this plugin and I need to manage the controller from other class, so I'm sharing this public example for anyone who wants to use https://github.com/hectorAguero/slidingpanelexample

Currently I'm works with some similar in a app, but after call a PageRoute(LoginPage to HomePage), I have problems with the controller inside the model class , I don't put that code in the example because I dont have more time now, so all the example works.

The code, doesn't have comments, sorry for that.

Any comment is welcomed

GIF

Dark brightness mode in ThemeData vanishes all widgets

Hi,
The current version has an issue with brightness mode.
steps to reproduce

  1. add a dark brightness in your example

return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'SlidingUpPanel Example',
theme: ThemeData(primarySwatch: Colors.blue, brightness: Brightness.dark),
home: HomePage(),
);

  1. run and get the result like this
    https://uppic.cc/d/5v25

all the text is gone. maybe it does not respect the dark mode.

[Feature Request] AnimatedContainer in place of Container?

Hi! Really love the package! What are your thoughts on making the container here an AnimatedContainer?

I have the use case where my panel can hava data in it or be empty (it's holding a sport player's information). The user can click on a player in main UI list to fetch the data and on load I wanted the panel to animate up to a minimum height of 60 (whereas it's empty value is 40). Using setState and animated container, it's as simple as changing the minHeight property on the SlidingUpPanel:

minHeight: playerSummary?.player == null ? 40 : 60,

Close/Open panel on tap instead of dragging?

Thanks so much for this, very helpful!
Is there a way to open the panel on tap instead of dragging it? I have a scroll view inside it so dragging causes only the view inside to scroll and I can't open the panel itself.
I know I can open it with a button and call _pc.open(), but ideally I'd want to open on backdrop tap, so any area of the header will open it. And I tried to close it with backdropTapClosesPanel: true but it won't work somehow.

3 levels of height

In addition to maxHeight and minHeight, there should be a defaultHeight. When the panel opens up, it should open in defaultHeight. And if maxHeight is bigger than defaultHeight and the user pulls the panel towards top, it should snap to maxHeight. This can be taken even further to make the panel full screen if pulled all the way. What do you think of this feature? It gives the end user much more flexibility and ease of use imho.

MaxHeight to wrap content's height

Hi there, I have a quick question if there's any wrap panel's content height? I want the panel's height to be dynamic to it's child. I tried to get the height of the panel's child widget then set it to the maxHeight so that when the panel opens, the maxheight will be adjusted but this doesn't work because the widget isn't available yet when the calculation performed.

The only way of doing this is in the onPanelOpened callback to calculate and adjust the height of the panel. The problem here is that the animation it adjusted the new height doesn't look good. It jump to the new height and fix itself in position. Have any ways to achieve this?

Thank you. :)

Panels elements not showing properly

This is the
`Dart
import 'package:flutter/material.dart';
import 'package:sliding_up_panel/sliding_up_panel.dart';

class BottomSheet extends StatefulWidget {
@OverRide
_BottomSheetState createState() => _BottomSheetState();
}

class _BottomSheetState extends State {
final double _initFabHeight = 120.0;
double _fabHeight;
double _panelHeightOpen = 575.0;
double _panelHeightClosed = 95.0;

@OverRide
void initState() {
super.initState();

_fabHeight = _initFabHeight;

}

@OverRide
Widget build(BuildContext context) {
return Material(
child: Stack(
alignment: Alignment.topCenter,
children: [
SlidingUpPanel(
maxHeight: _panelHeightOpen,
minHeight: _panelHeightClosed,
parallaxEnabled: true,
parallaxOffset: .5,
body: _body(),
panel: _panel(),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(18.0),
topRight: Radius.circular(18.0)),
onPanelSlide: (double pos) => setState(() {
_fabHeight = pos * (_panelHeightOpen - _panelHeightClosed) +
_initFabHeight;
}),
),

      // the fab
      Positioned(
        right: 20.0,
        bottom: _fabHeight,
        child: FloatingActionButton(
          child: Icon(
            Icons.gps_fixed,
            color: Theme.of(context).primaryColor,
          ),
          onPressed: () {},
          backgroundColor: Colors.white,
        ),
      ),

      //the SlidingUpPanel Titel
      Positioned(
        top: 42.0,
        child: Container(
          padding: const EdgeInsets.fromLTRB(24.0, 18.0, 24.0, 18.0),
          child: Text(
            "SlidingUpPanel Example",
            style: TextStyle(fontWeight: FontWeight.w500),
          ),
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(24.0),
            boxShadow: [
              BoxShadow(
                  color: Color.fromRGBO(0, 0, 0, .25), blurRadius: 16.0)
            ],
          ),
        ),
      ),
    ],
  ),
);

}

Widget _panel() {
return Text("hahaha");
}

Widget _body() {
return SizedBox.expand(
child: Text("lalals"),
);
}
}
`

Screenshot

set max height of preview

is any solution about setting max height of preview panel? i mean when i run application of show scrren i want to have custom height of panel

Textfield is overlapped by keyboard (SlidingUpPanel -> panel -> CustomScrollView -> SliverStickyHeader -> TextField)

Code as follow:

return Material(
      child: Scaffold(
        body: Stack(
          alignment: Alignment.topCenter,
          children: <Widget>[
            SlidingUpPanel(
              isDraggable: false,
              color: Colors.cyan,
              controller: _pc,
              maxHeight: MediaQuery.of(context).size.height * 0.87,
              minHeight: MediaQuery.of(context).size.height * 0.7,
              parallaxEnabled: true,
              parallaxOffset: .5,
              body: _body(),
              panel: _panel(),
              borderRadius: BorderRadius.only(
                topLeft: Radius.circular(18.0),
                topRight: Radius.circular(18.0),
              ),
            ),
            Align(
              alignment: Alignment.bottomCenter,
              child: _getCheckoutLayer(),
            ),
          ],
        ),
      ),
    );
  Widget _panel() {
    return Container(
      margin: const EdgeInsets.only(top: 18.0),
      color: Colors.cyan,
      child: NotificationListener<ScrollNotification>(
        onNotification: (scrollNotification) {
          if (scrollNotification is ScrollStartNotification) {
          } else if (scrollNotification is ScrollUpdateNotification) {
            if (scrollNotification.metrics.pixels > _currentPosition) {
              if (_pc.isPanelClosed()) {
                _pc.open();
                setState(() {
                  firstStateEnabled = false;
                });
              }
            }
          } else if (scrollNotification is ScrollEndNotification) {
            if (scrollNotification.metrics.pixels == 0) {
              if (_pc.isPanelOpen()) {
                _pc.close();
                setState(() {
                  firstStateEnabled = true;
                });
              }
            }
          }
          _currentPosition = scrollNotification.metrics.pixels;
          return true;
        },
        child: CustomScrollView(
          physics: ClampingScrollPhysics(),
          slivers: [
            _itemAmount(),
            _items(1),
            _items(2),
            _items(3),
            _items(4),
            _items(5),
            _items(6),
            _itemRemark(),
            _itemBottom(),
          ],
        ),
      ),
    );
  }
  Widget _itemRemark() {
    return SliverStickyHeader(
      header: Container(
        color: Colors.cyan,
        height: 60.0,
        padding: EdgeInsets.only(
          left: 16.0,
          top: 20.0,
          bottom: 10.0,
        ),
        alignment: Alignment.centerLeft,
        child: Text(
          '備註',
          style: const TextStyle(
            color: Colors.white,
            fontSize: 22,
            fontWeight: FontWeight.bold,
          ),
        ),
      ),
      sliver: SliverList(
        delegate: SliverChildBuilderDelegate(
          (context, i) {
            return Container(
              padding: EdgeInsets.only(
                left: 15,
                right: 15,
              ),
              child: Container(
                padding: const EdgeInsets.all(8.0),
                decoration: BoxDecoration(
                    border: Border.all(color: Colors.white),
                    borderRadius: BorderRadius.circular(12.0)),
                child: TextField(
                  textInputAction: TextInputAction.done,
                  maxLines: 5,
                  decoration: InputDecoration.collapsed(hintText: ''),
                  style: TextStyle(color: Colors.white),
                ),
              ),
            );
          },
          childCount: 1,
        ),
      ),
    );
  }

Body going off screen

I'm running a Sliding Up Panel as the body of a scaffold, with its body consisting of a column surrounded by some padding, but the content (on smaller devices) goes off the screen. If I take the Sliding Up Panel out and have the column as the body of the scaffold it works just fine fitting to the constraints of the screen.

(I've made the collapsed panel very small, to view the content behind it)
1
2

Not sure if I'm implementing this wrong / it's intended behaviour or a bug.

return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.blueGrey[800],
        title: Text('Time Since Last'),
        actions: <Widget>[
          IconButton(
            icon: Icon(Icons.settings),
            onPressed: () {
              Navigator.pushNamed(context, CategoryEdit.id, arguments: ScreenArguments(title: title, emoji: categoryIcon, documentId: documentId));
            },
          ),
        ],
      ),
      body: SlidingUpPanel(
        backdropEnabled: true,
        borderRadius: radius,
        minHeight: 4.0,
        maxHeight: height * 0.75,
        panel: SlideUpPanel(radius: radius, title: title, documentId: documentId),
        collapsed: CollapsedPanel(radius: radius),
        body: isLoading
            ? Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  SpinKitDoubleBounce(
                    color: Colors.white,
                  ),
                  SizedBox(height: 42.0),
                ],
              )
            : Padding(
                padding: const EdgeInsets.all(16.0),
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: <Widget>[
                    Text(
                      title.toString(),
                      style: TextStyle(fontSize: 26.0, fontWeight: FontWeight.bold, decoration: TextDecoration.underline),
                      textAlign: TextAlign.center,
                    ),
                    tslDays > 100
                        ? Text(timeAgoBuilder(lastTsl), style: TextStyle(fontSize: 48.0, fontWeight: FontWeight.bold))
                        : RichText(
                            text: TextSpan(
                              children: <TextSpan>[
                                TextSpan(
                                  text: tslDays < 10 ? '   0$tslDays' : '   $tslDays',
                                  style: TextStyle(fontSize: 40.0, fontWeight: FontWeight.bold),
                                ),
                                TextSpan(
                                  text: ' Days\n',
                                  style: TextStyle(fontSize: 16.0),
                                ),
                                TextSpan(
                                  text: tslHours < 10 ? '   0$tslHours' : '   $tslHours',
                                  style: TextStyle(fontSize: 40.0, fontWeight: FontWeight.bold),
                                ),
                                TextSpan(
                                  text: ' Hours\n',
                                  style: TextStyle(fontSize: 16.0),
                                ),
                                TextSpan(
                                  text: tslMinutes < 10 ? '   0$tslMinutes' : '   $tslMinutes',
                                  style: TextStyle(fontSize: 40.0, fontWeight: FontWeight.bold),
                                ),
                                TextSpan(
                                  text: ' Minutes\n',
                                  style: TextStyle(fontSize: 16.0),
                                ),
                                TextSpan(
                                  text: tslSeconds < 10 ? '   0$tslSeconds' : '   $tslSeconds',
                                  style: TextStyle(fontSize: 40.0, fontWeight: FontWeight.bold),
                                ),
                                TextSpan(
                                  text: ' Seconds\n',
                                  style: TextStyle(fontSize: 16.0),
                                ),
                              ],
                            ),
                          ),
                    ButtonTheme(
                      minWidth: double.infinity,
                      child: RaisedButton(
                        color: Colors.red[900],
                        onPressed: () {
                          HapticFeedback.lightImpact();
                          showDialog(
                            context: context,
                            barrierDismissible: true,
                            builder: (BuildContext context) {
                              return resetTslDialog();
                            },
                          );
                        },
                        elevation: 5.0,
                        //shape: StadiumBorder(),
                        child: Text('RESET'),
                      ),
                    ),
                    Container(
                      height: 42.0,
                      color: Colors.deepOrange,
                    ),
                  ],
                ),
              ),
      ),
    );

Accessibility support (Talkback)

Hi,
Thanks for great package. Has anyone notice that Talkback behaves weird with sliding panel. The body widget is hard to focus. I have a listview widget in the sliding panel body. When I focus on the listview, it doesn't get focused, however if I swipe right it goes through the list.

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.