mcrovero / rubber Goto Github PK
View Code? Open in Web Editor NEWAn elastic material bottom sheet implementation for Flutter.
License: BSD 2-Clause "Simplified" License
An elastic material bottom sheet implementation for Flutter.
License: BSD 2-Clause "Simplified" License
A nice addition would be scrim/overlay covering the widgets below the sheet. It helps to bring focus to the sheet. This would also be compliant with the material design guidelines.
Describe the bug
I have a column with multiple rows in my upperLayer section. If I leave at it is, I get a "Bottom overflowed" error.
Column(
children: <Widget>[
Row(
children: <Widget> [
...
]),
Row(
children: <Widget> [
...
]),
])
Putting the column within a ListView or similar widget remove the overflow, but now, when dragging up the section, it just scroll the ListView:
ListView(
children: <Widget> [
Column(
children: <Widget>[
Row(
children: <Widget> [
...
]),
Row(
children: <Widget> [
...
]),
])
])
....
Smartphone (please complete the following information):
Describe the bug
Trying to have the RubberBottomSheet over GoogleMaps and allow the user to search. I can get the look needed, but everything seems to cause 'RenderFlex overflowed by 1.4 pixels on the bottom.' when moving Bottom sheet up and down...especially when using the header. I've tried using Stacks, ListViews, ClipRects, SingleChildScrollView, etc. However, always get an overflow.
To Reproduce
CameraPosition cam = _kInitialPos;
return Scaffold(
appBar: AppBar(
elevation: 0.0,
title: Image.asset(
"assets/Logo_white_med.png",
fit: BoxFit.cover,
),
backgroundColor: Theme.of(context).primaryColor,
),
body: Container(
child: RubberBottomSheet(
scrollController: _scrollController,
header: Container(
width: MediaQuery.of(context).size.width,
color: Theme.of(context).highlightColor,
child: Icon(
FontAwesomeIcons.gripLines,
color: Theme.of(context).backgroundColor,
),
),
lowerLayer: Container(
child: GoogleMap(
mapType: MapType.normal,
initialCameraPosition: cam,
onMapCreated: (GoogleMapController controller) {
_mcontroller.complete(controller);
},
zoomGesturesEnabled: true,
),
),
upperLayer: ListView(
controller: _scrollController,
children: <Widget>[
Text("Jimmy"),
Text("Ted"),
Text("Fred"),
],
),
animationController: _controller,
),
),
);
Expected behavior
Not overflow
Screenshots
Example of what we are going for...
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Looking at the code, it seems like dragFriction
is being treated as a multiplier, while I would expect more friction to dampen the velocity. I think this is what you want:
- controller.value -= details.primaryDelta / _screenHeight * friction;
+ controller.value -= details.primaryDelta / (_screenHeight * friction);
Describe the bug
First of all, great work with the RubberBottomSheet ๐
Now, I have a List much like in : https://github.com/mcrovero/rubber/blob/master/example/lib/scroll.dart
Upon onTap
on the ListTile item I want to collapse the bottom sheet and then further do some update on the lowerLayer
of the RubberBottomSheet
. So I went for something like :
void _listItemTapped(index) {
print('Collapsing');
_controller.collapse().whenComplete(() {
print('Collapsed');
// Do something here
});
}
But I don't see Collapsed
being printed at all. What am I missing here ?
** Gif **
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Failed assertion: line 110 pos 12: '_positions.isNotEmpty'
Either the assertion indicates an error in the framework itself, or we should provide substantiallyWhen the exception was thrown, this was the stack:
#2 ScrollController.position (package:flutter/src/widgets/scroll_controller.dart:110:12)
#3 RubberBottomSheetState._handleDragStart (package:diabetist_pro/backend/componets/rubber/src/bottom_sheet.dart:246:33)
how can i get state of this library when trigger collapsed, expanded?
Is your feature request related to a problem? Please describe.
When the RubberBottomSheet is tapped, we need it to have a different behaviour than the default one (in our case, expanding to be higher instead of collapsing to its smallest size), which is currently impossible because tapping is interpreted as a _onVerticalDragDown event by the plugin.
Describe the solution you'd like
Adding an Function _onTap
property to the Widget, enabling executing a user-defined method when tapping instead of _onVerticalDragDown.
This onTap could be optional and call _onVerticalDragDown as a default behaviour, so that existing code relying on it would continue working as before.
Describe alternatives you've considered
Not many alternatives possible from outside the plugin.
We have tried wrapping the header and/or the content into a GestureDetector to handle the onTap event before it reaches the RubberBottomSheet. but that would also intercept any drag events, making it pointless to use a bottom sheet at all.
Similarly also considered putting it behind an transparent overlay (possibly using a Stack widget), but it would have the same effect.
The following assertion was thrown while handling a gesture:
ScrollController not attached to any scroll views.
'package:flutter/src/widgets/scroll_controller.dart':
Failed assertion: line 110 pos 12: '_positions.isNotEmpty'RubberBottomSheetState._onVerticalDragDown (package:diabetist_pro/backend/componets/rubber/src/bottom_sheet.dart:181:33)
Is your feature request related to a problem? Please describe.
Currently you have to pass down the RubberAnimationController
in order to show/control the BottomSheet from widgets down the tree.
Describe the solution you'd like
Like Scaffold.of(context).showModalBottomSheet
it would be nice to have RubberBottomSheet.of(context)
, or something similar, in order to access the RubberAnimationController
.
Describe alternatives you've considered
Like described, the alternative is to pass down the RubberAnimationController
which isn't elegant.
Hey thank you for your awesome work
I want to change the upperBoundValue and lowerBoundValue in RubberAnimationControler when the device orientation changes, I couldn't change them using getters so I created two controllers each for a specific device orientation but it didn't seem to work. is there a better way to achieve this?
Thank you
Describe the bug
Implementing the bare minimum rubber bottomsheet in my page results in an exception. The exception does not terminate the bottomsheet though, it still works.
To Reproduce
Code:
class BrowserPage extends StatefulWidget {
@override
_BrowserPageState createState() => _BrowserPageState();
}
class _BrowserPageState extends State<BrowserPage> with SingleTickerProviderStateMixin {
RubberAnimationController _controller;
@override
void initState() {
_controller = RubberAnimationController(
vsync: this,
duration: Duration(milliseconds: 200)
);
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
// drawer: AppDrawer(),
// endDrawer: DebugDrawer(),
body: Container(
child: RubberBottomSheet(
lowerLayer: Container(
color: Colors.blueAccent
),
upperLayer: Container(
color: Colors.redAccent
),
animationController: _controller,
),
)
);
}
}
And error:
I/flutter (19728): โโโก EXCEPTION CAUGHT BY SCHEDULER LIBRARY โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
I/flutter (19728): The following assertion was thrown during a scheduler callback:
I/flutter (19728): RenderBox was not laid out: RenderStack#abea0 NEEDS-LAYOUT NEEDS-PAINT
I/flutter (19728): 'package:flutter/src/rendering/box.dart': Failed assertion: line 1482 pos 12: 'hasSize'
I/flutter (19728):
I/flutter (19728): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter (19728): more information in this error message to help you determine and fix the underlying cause.
I/flutter (19728): In either case, please report this assertion by filing a bug on GitHub:
I/flutter (19728): https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter (19728):
I/flutter (19728): When the exception was thrown, this was the stack:
I/flutter (19728): #2 RenderBox.size
package:flutter/โฆ/rendering/box.dart:1482
I/flutter (19728): #3 _RubberBottomSheetState._bottomSheetHeight
package:rubber/src/bottom_sheet.dart:50
I/flutter (19728): #4 _RubberBottomSheetState.afterFirstLayout
package:rubber/src/bottom_sheet.dart:296
I/flutter (19728): #5 __RubberBottomSheetState&State&TickerProviderStateMixin&AfterLayoutMixin.initState.<anonymous closure>
package:after_layout/after_layout.dart:10
I/flutter (19728): #6 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback
I/flutter (19728): #7 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame
package:flutter/โฆ/scheduler/binding.dart:936
I/flutter (19728): #8 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame
package:flutter/โฆ/scheduler/binding.dart:840
I/flutter (19728): #12 _invoke (dart:ui/hooks.dart:209:10)
I/flutter (19728): #13 _drawFrame (dart:ui/hooks.dart:168:3)
I/flutter (19728): (elided 5 frames from class _AssertionError and package dart:async)
Smartphone (please complete the following information):
Extra:
As an aside, setting the lowerBoundValue to AnimationControllerValue(pixel: whatever) terminates the upperlayer, i.e. it doesnt show up at all. No error messages except for the one mentioned here.
If you use launchTo
to go to a value that is lower than the lowerBoundValue
it goes to the value, then after a second it jumps back up to the lowerBoundValue
on its own. This worked properly (without bouncing back up) in previous versions, but has since been broken.
This is the line that causes the issue (440 & 441 in animation_controller.dart):
if(_value < lowerBound && dismissable)
_value = lowerBound;
This should work like it did before, or there should be an option to allow not jump back up.
like with drag and drop animation how can i set them for expand and collapse methods?
Is your feature request related to a problem? Please describe.
I need to listen when the drag starts so I can hide a FAB.
Describe the solution you'd like
Introduce RubberBottomSheet.onDragStart
.
Describe the bug
When using a RubberAnimationController like this one:
_controller = RubberAnimationController( vsync: this, halfBoundValue: AnimationControllerValue(percentage: 0.5), lowerBoundValue: AnimationControllerValue(pixel: 200), duration: Duration(milliseconds: 200) );
and an upper layer like this:
Widget _getUpperLayer() { return Container( height: 200.0, decoration: BoxDecoration( color: Colors.cyan ), ); }
then after starting the app everything looks fine, collapsed state:
Expanded state:
(note this is only for demonstration purposes, of course 200 pixel tall strip as a upper layer doesn't make a lot of sense)
Now I collapse the bottom sheet again and go into landscape mode:
The bottom sheet is not at the right position. A part of it is hidden below the screen.
Expanded in landscape:
To Reproduce
Steps to reproduce the behavior:
height: 200.0,
Expected behavior
In the horizontal, as well as in the vertical position the full 200.0 pixel tall strip should be visible in the collapsed state.
Smartphone (please complete the following information):
Could you implement a threshold parameter for when to animate up/down? Currently the threshold is extremely high. This feels extremely awkward if you want to dismiss the bottom sheet and you have to move your finger across more than a half of the screen.
You're welcome to PR your project on https://github.com/Solido/awesome-flutter !
Thank you.
Great library! For now, it's the only way to implement awesome persistent bottom sheet. But there is an annoying bug.
Source code of my application: https://github.com/alexandr2levin/my_mikhailovka
Description of the bug
RubberBottomSheet very often expands to full height and can't be collapsed in release builds. Sometimes it works as expected, but it happens very rare. Debug builds works as expected.
To Reproduce
flutter run --release
my projectScreenshots
Release build (incorrect behavior) | Debug build (correct behavior) |
---|---|
![]() |
![]() |
Smartphone:
Flutter doctor
[โ] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.3 18D109, locale en-RU)
Is your feature to change direction from top to bottom?
Is it possible to disable the drag event? I need to toggle the bottom sheet via click of a button only
It will be nice to get a variable to set the initial height value of the widget. Something like:
RubberBottomSheet(
lowerLayer: _getLowerLayer(),
upperLayer: _getUpperLayer(),
animationController: _controller,
height: 100.0
),
If there is another way, I would like to know. Thanks and nice widget!
i think the library doesn't have any parameter to set height of that, when i try to show that with custom height
I only mange to get AnimationState.expanded || AnimationState.animating with onDragEnd
, but not AnimationState.collapsed.
Please see the following error found in package:rubber/src/animation_controller.dart.
`'package:rubber/src/animation_controller.dart': error: line 355 pos 30:
file:///D:/Programing/FLUTTER/flutter/.pub-cache/hosted/pub.dartlang.org/rubber-0.2.5/lib/src/animation_controller.dart:355:30:
Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
final double launchSpeed = 7;
^
final double launchSpeed = 7;
^`
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
Additional context
When I try to slide down, it prompts me to overflow the title height
Describe the bug
Another exception was thrown: 'package:flutter/src/widgets/basic.dart': Failed assertion: line 2058 pos 15: 'heightFactor == null || heightFactor >= 0.0': is not true.
To Reproduce
Steps to reproduce the behavior:
Start to drag the RubberBottomSheet at the bottom
I think it's common behavior that when your sheet slides up, the background dims to a certain degree. It would be nice if Rubber can handle this. I'm currently trying out ways to do it, via listening on AnimationStatus, or even using ValueBuilder to listen on animationState
, but neither of this work nicely (I want the background to be dimmed the moment it starts sliding up, and automatically un-dim when it's dragged down, right now with my weird hack there are things like setting state to trigger a refresh, and even then it's pretty janky)
how to get a status of swipe down using listener?
Can we have the ability to completely close the bottom sheet when we swipe all the way to the bottom? Or alternatively selecting the area of the screen where the bottom sheet is not showing.
Describe the bug
I have a ListView
with items similar to the scroll example (which is now working really great by the way ๐). Every item is wrapped in a GestureDetector
that is listening for onTap
.
There are currently three problems:
onTap
is successfully called, the sheet jumps around.flutter: โโโก EXCEPTION CAUGHT BY GESTURE โโโโโโโโ
flutter: The following assertion was thrown while handling a gesture:
flutter: 'package:rubber/src/bottom_sheet.dart': Failed assertion: line 149 pos 12: '_hold == null': is not
flutter: true.
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter: https://github.com/flutter/flutter/issues/new?template=BUG.md
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2 _RubberBottomSheetState._onVerticalDragDown (package:rubber/src/bottom_sheet.dart:149:12)
flutter: #3 DragGestureRecognizer.addPointer.<anonymous closure> (package:flutter/src/gestures/monodrag.dart:123:46)
flutter: #4 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
flutter: #5 DragGestureRecognizer.addPointer (package:flutter/src/gestures/monodrag.dart:123:9)
flutter: #6 RawGestureDetectorState._handlePointerDown (package:flutter/src/widgets/gesture_detector.dart:643:18)
flutter: #7 RenderPointerListener.handleEvent (package:flutter/src/rendering/proxy_box.dart:2500:14)
flutter: #8 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:158:22)
flutter: #9 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:138:7)
flutter: #10 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:101:7)
flutter: #11 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:85:7)
flutter: #12 _invoke1 (dart:ui/hooks.dart:168:13)
flutter: #13 _dispatchPointerDataPacket (dart:ui/hooks.dart:122:5)
flutter: (elided 2 frames from class _AssertionError)
flutter:
flutter: Handler: onDown
flutter: Recognizer:
flutter: VerticalDragGestureRecognizer#d7641(debugOwner: GestureDetector)
flutter: โโโโโโโ
Expected behavior
I expect that "normal" interactions like onTap are handled by the widgets inside of the modal.
Describe the bug
When i was scrolling the bottom Sheet , i got the below exception
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
I/flutter (22346): โโโก EXCEPTION CAUGHT BY GESTURE โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
I/flutter (22346): The following assertion was thrown while handling a gesture:
I/flutter (22346): 'package:rubber/src/bottom_sheet.dart': Failed assertion: line 158 pos 14: '_drag == null': is not
I/flutter (22346): true.
I/flutter (22346):
I/flutter (22346): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter (22346): more information in this error message to help you determine and fix the underlying cause.
I/flutter (22346): In either case, please report this assertion by filing a bug on GitHub:
I/flutter (22346): https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter (22346):
I/flutter (22346): When the exception was thrown, this was the stack:
I/flutter (22346): #2 _RubberBottomSheetState._onVerticalDragDown (package:rubber/src/bottom_sheet.dart:158:14)
I/flutter (22346): #3 DragGestureRecognizer.addPointer. (package:flutter/src/gestures/monodrag.dart:123:46)
I/flutter (22346): #4 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
I/flutter (22346): #5 DragGestureRecognizer.addPointer (package:flutter/src/gestures/monodrag.dart:123:9)
I/flutter (22346): #6 RawGestureDetectorState._handlePointerDown (package:flutter/src/widgets/gesture_detector.dart:698:18)
I/flutter (22346): #7 RenderPointerListener.handleEvent (package:flutter/src/rendering/proxy_box.dart:2519:14)
I/flutter (22346): #8 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:158:22)
I/flutter (22346): #9 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:138:7)
I/flutter (22346): #10 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:101:7)
I/flutter (22346): #11 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:85:7)
I/flutter (22346): #12 _invoke1 (dart:ui/hooks.dart:173:13)
I/flutter (22346): #13 _dispatchPointerDataPacket (dart:ui/hooks.dart:127:5)
I/flutter (22346): (elided 2 frames from class _AssertionError)
I/flutter (22346):
I/flutter (22346): Handler: onDown
I/flutter (22346): Recognizer:
I/flutter (22346): VerticalDragGestureRecognizer#30ccf(debugOwner: GestureDetector)
I/flutter (22346): โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
I/flutter (22346): Another exception was thrown: 'package:rubber/src/bottom_sheet.dart': Failed assertion: line 219 pos 14: '_drag == null': is not true.
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Describe the bug
flutter: โโโก EXCEPTION CAUGHT BY SCHEDULER LIBRARY โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
flutter: The following assertion was thrown during a scheduler callback:
flutter: AnimationController.animateTo() called with no explicit Duration and no default Duration.
flutter: Either the "duration" argument to the animateTo() method should be provided, or the "duration"
flutter: property should be set, either in the constructor or later, before calling the animateTo() function.
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0 RubberAnimationController._animateToInternal. (package:rubber/src/animation_controller.dart:312:11)
flutter: #1 RubberAnimationController._animateToInternal (package:rubber/src/animation_controller.dart:320:8)
flutter: #2 RubberAnimationController.height= (package:rubber/src/animation_controller.dart:191:5)
flutter: #3 _RubberBottomSheetState.afterFirstLayout (package:rubber/src/bottom_sheet.dart:296:17)
flutter: #4 __RubberBottomSheetState&State&TickerProviderStateMixin&AfterLayoutMixin.initState. (package:after_layout/after_layout.dart:10:38)
flutter: #5 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
flutter: #6 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:938:9)
flutter: #7 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
flutter: #8 _invoke (dart:ui/hooks.dart:159:13)
flutter: #9 _drawFrame (dart:ui/hooks.dart:148:3)
To Reproduce
Steps to reproduce the behavior:
void initState() {
_controller = RubberAnimationController(
halfBoundValue: AnimationControllerValue(percentage: 0.5),
vsync: this,
);
super.initState();
}
**Smartphone (please complete the following information):**
- Device: iPhoneXR Simulator
**Additional context**
Add any other context about the problem here.
i'm using a ListView
for my upperLayer
. When the AnimationState
is half_expanded
or collapsed
i can scroll the ListView
. I need to disable the scroll in this states and just enable it in expanded
. How can i achieve this?
I faced a need to keep sheet strictly in its bounds, so, when I didn't find any out-of-box solution, I decided to play with it by myself. And what I got:
In _onVerticalDragUpdate
function from RubberBottomSheet
I replaced one line like this
//_controller.value -= details.primaryDelta / screenHeight * friction;
var newValue = controller.value - (details.primaryDelta / _screenHeight * friction);
if (_someFlagThatMakesControllerBeAwareAboutSheetBounds) {
if (newValue > controller.upperBound)
newValue = controller.upperBound;
else if (newValue < controller.lowerBound)
newValue = controller.lowerBound;
}
controller.value = newValue;
And after some gestures that caused fling
of RubberAnimationController
to be called, sheet comes collapsed or even disappears. But I played with it too and added these lines before simulation object creates (because it caused division by zero inside) [Not sure if it's necessary after update edits, couldn't catch it again]
if (value == to)
return null;
Upd:
Also, controller should have added (_tick
), right before notifyListeners()
:
// Strict boundaries enforced
if(_someFlagThatMakesControllerBeAwareAboutSheetBounds && _value > upperBound)
_value = upperBound;
So I hope it will appear in Rubber in a future.
Describe the bug
Hi McRovero, first i want to thank you for this great library, but i'm disappointed how the animation is too slow and luggy. is there something should i do to optimize the animation?
and thanks.
To Reproduce
Expand/Collapse the bottomsheet
Expected behavior
Smooth and not luggy animation
Smartphone:
Being able to hide Rubber and make it appear and disappear via functions would be great
When using a percentage to set the lowerBoundValue and the bottom sheet is collapsed, how can I make sure that the widget on the top of the bottom sheet expands the area properly? This is for example and issue when I switch to landscape mode, as the available size is much smaller then, which is causing overflow issues.
Thanks!!!
I want to hide /show menuLayer
this case "hide after swipe up, show after swipe down"
Describe the bug
SingleChildScrollView
inside upperLayer
doesn't occupy full height.
To Reproduce
In the example (https://github.com/mcrovero/rubber/blob/master/example/lib/scroll.dart), replace ListView.builder
with SingleChildScrollView
that contains any small widget (e.g. a Text
).
Expected behavior
The whole upper layer should be cyan-colored.
I created a RubberBottomSheet without passing a ScrollController. It works for the most part, but an exception is thrown if I try to drag it down in order to dismiss. Below is the stack trace:
I/flutter (32146): โโโก EXCEPTION CAUGHT BY GESTURE โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
I/flutter (32146): The following NoSuchMethodError was thrown while handling a gesture:
I/flutter (32146): The getter 'position' was called on null.
I/flutter (32146): Receiver: null
I/flutter (32146): Tried calling: position
I/flutter (32146):
I/flutter (32146): When the exception was thrown, this was the stack:
I/flutter (32146): #0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
I/flutter (32146): #1 _RubberBottomSheetState._onVerticalDragDown (package:rubber/src/bottom_sheet.dart:159:31)
I/flutter (32146): #2 DragGestureRecognizer.addPointer.<anonymous closure> (package:flutter/src/gestures/monodrag.dart:123:46)
I/flutter (32146): #3 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
I/flutter (32146): #4 DragGestureRecognizer.addPointer (package:flutter/src/gestures/monodrag.dart:123:9)
I/flutter (32146): #5 RawGestureDetectorState._handlePointerDown (package:flutter/src/widgets/gesture_detector.dart:643:18)
I/flutter (32146): #6 RenderPointerListener.handleEvent (package:flutter/src/rendering/proxy_box.dart:2500:14)
I/flutter (32146): #7 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:158:22)
I/flutter (32146): #8 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:138:7)
I/flutter (32146): #9 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:101:7)
I/flutter (32146): #10 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:85:7)
I/flutter (32146): #11 _invoke1 (dart:ui/hooks.dart:168:13)
I/flutter (32146): #12 _dispatchPointerDataPacket (dart:ui/hooks.dart:122:5)
I/flutter (32146):
I/flutter (32146): Handler: onDown
I/flutter (32146): Recognizer:
I/flutter (32146): VerticalDragGestureRecognizer#b6362(debugOwner: GestureDetector)
I/flutter (32146): โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
I am using rubber: 0.2.5
Hello!
Thank you so much for this great library.
I'm using the bottom sheet in my new app where I have a Navigator
with multiple scrolling screens in the bottom sheet:
Scrolling is working fine for the first screen, but adding the ScrollController to the ListView of the second screen is throwing this exception:
ScrollController attached to multiple scroll views
Which makes sense I guess.... Can you think of a way to support multiple ListViews (on different pages, so only one shown at a time) inside a single bottom sheet?
Thanks!
Wow, this is a incredible good package - by far the smoothiest bottom-slider out there! ๐ฅ
I am new to flutter, and i didn't found a way to:
** not more than this height / space is wanted ...
is just a placeholder for some real content, the content is not the text or a height of 10 ;)
Is there anything listener for listening to the bottomsheet position depending on peek mode and expanded mode?
Is your feature request related to a problem? Please describe.
With the current version of this module, the debug console is spammed with useless informations for the end user.
Describe the solution you'd like
Hide those logs if a verbose mode is not activated.
It would be really nice if you were able to change the shape of the sheet, for example to create rounded corners at the top of the sheet, like many of Google's redesigned apps have.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.