Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

341 bug sheetbottom tap to scroll down #352

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [Bug]: Icons Button name ([#334](https://github.com/Orange-OpenSource/ods-flutter/issues/334))
- [Bug]: Spacing for the 'Small Card' component ([#342](https://github.com/Orange-OpenSource/ods-flutter/issues/342))
- [Bug]: Snackbar without action text positioning ([#198](https://github.com/Orange-OpenSource/ods-flutter/issues/198))
- [Bug]: SheetBottom. Tap to scroll down ([#341](https://github.com/Orange-OpenSource/ods-flutter/issues/341))

### [0.8.O](https://github.com/Orange-OpenSource/ods-flutter/compare/0.1.1...0.8.0) - 2023-03-02

Expand Down
1 change: 1 addition & 0 deletions library/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [Bug]: Spacing for the 'Small Card' component ([#342](https://github.com/Orange-OpenSource/ods-flutter/issues/342))
- [Bug]: Snackbar without action text positioning ([#198](https://github.com/Orange-OpenSource/ods-flutter/issues/198))
- [Bug]: SheetBottom. Tap to scroll down ([#341](https://github.com/Orange-OpenSource/ods-flutter/issues/341))


## [0.8.O](https://github.com/Orange-OpenSource/ods-flutter/compare/0.1.1...0.8.0) - 2023-03-02
Expand Down
133 changes: 69 additions & 64 deletions library/lib/components/sheets_bottom/ods_sheets_bottom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,83 +64,88 @@ class _OdsSheetsBottomState extends State<OdsSheetsBottom> {
child: AnimatedContainer(
duration: const Duration(seconds: 11150),
height: expanded ? collapsedHeight : null,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
GestureDetector(
onPanEnd: (details) {
if (details.velocity.pixelsPerSecond.dy.abs() > 100 &&
details.velocity.pixelsPerSecond.dy != 0.0) {
_expandCloseBottomSheet();
}
},
child: Container(
color: Colors.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(top: spacingM),
child: Container(
width: 40,
height: 5,
margin: const EdgeInsets.symmetric(vertical: spacingXs),
decoration: BoxDecoration(
color:
Theme.of(context).colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(2.5),
),
),
),
],
),
),
),
GestureDetector(
onPanEnd: (details) {
if (details.velocity.pixelsPerSecond.dy.abs() > 100 &&
details.velocity.pixelsPerSecond.dy != 0.0) {
_expandCloseBottomSheet();
}
},
child: MergeSemantics(
child: GestureDetector(
onTap: _expandCloseBottomSheet,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
GestureDetector(
onPanEnd: (details) {
if (details.velocity.pixelsPerSecond.dy.abs() > 100 &&
details.velocity.pixelsPerSecond.dy != 0.0) {
_expandCloseBottomSheet();
}
},
child: Container(
color: Colors.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AnimatedRotation(
turns: chevronTurns,
duration: const Duration(milliseconds: 200),
child: IconButton(
icon: const Icon(
Icons.expand_more,
size: 31,
Padding(
padding: const EdgeInsets.only(top: spacingM),
child: Container(
width: 40,
height: 5,
margin:
const EdgeInsets.symmetric(vertical: spacingXs),
decoration: BoxDecoration(
color: Theme.of(context)
.colorScheme
.secondaryContainer,
borderRadius: BorderRadius.circular(2.5),
),
onPressed: _expandCloseBottomSheet,
),
),
Expanded(
child: Text(
widget.title,
style: Theme.of(context).textTheme.titleMedium,
overflow: TextOverflow.ellipsis,
),
),
],
),
),
),
),
if (!expanded)
Flexible(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.only(bottom: spacingXl),
child: widget.sheetContent,
GestureDetector(
onPanEnd: (details) {
if (details.velocity.pixelsPerSecond.dy.abs() > 100 &&
details.velocity.pixelsPerSecond.dy != 0.0) {
_expandCloseBottomSheet();
}
},
child: MergeSemantics(
child: Container(
color: Colors.transparent,
child: Row(
children: [
AnimatedRotation(
turns: chevronTurns,
duration: const Duration(milliseconds: 200),
child: IconButton(
icon: const Icon(
Icons.expand_more,
size: 31,
),
onPressed: _expandCloseBottomSheet,
),
),
Expanded(
child: Text(
widget.title,
style: Theme.of(context).textTheme.titleMedium,
overflow: TextOverflow.ellipsis,
),
),
],
),
),
),
)
],
),
if (!expanded)
Flexible(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.only(bottom: spacingXl),
child: widget.sheetContent,
),
),
)
],
),
),
),
);
Expand Down
Loading