From ef8dc9e8d49c046a7f65a49d7536c56ad1753a06 Mon Sep 17 00:00:00 2001 From: nyne Date: Sun, 26 Jan 2025 18:36:35 +0800 Subject: [PATCH] fix #158 --- lib/pages/settings/settings_page.dart | 62 ++++++++++++++------------- pubspec.lock | 6 +-- pubspec.yaml | 1 + 3 files changed, 37 insertions(+), 32 deletions(-) diff --git a/lib/pages/settings/settings_page.dart b/lib/pages/settings/settings_page.dart index b08de03..cb79750 100644 --- a/lib/pages/settings/settings_page.dart +++ b/lib/pages/settings/settings_page.dart @@ -206,37 +206,41 @@ class _SettingsPageState extends State implements PopEntry { ], ); } else { - return Stack( - children: [ - Positioned.fill(child: buildLeft()), - Positioned( - left: offset, - width: MediaQuery.of(context).size.width, - top: 0, - bottom: 0, - child: Listener( - onPointerDown: handlePointerDown, - child: AnimatedSwitcher( - duration: const Duration(milliseconds: 200), - switchInCurve: Curves.fastOutSlowIn, - switchOutCurve: Curves.fastOutSlowIn, - transitionBuilder: (child, animation) { - var tween = Tween( - begin: const Offset(1, 0), end: const Offset(0, 0)); + return LayoutBuilder( + builder: (context, constrains) { + return Stack( + children: [ + Positioned.fill(child: buildLeft()), + Positioned( + left: offset, + width: constrains.maxWidth, + top: 0, + bottom: 0, + child: Listener( + onPointerDown: handlePointerDown, + child: AnimatedSwitcher( + duration: const Duration(milliseconds: 200), + switchInCurve: Curves.fastOutSlowIn, + switchOutCurve: Curves.fastOutSlowIn, + transitionBuilder: (child, animation) { + var tween = Tween( + begin: const Offset(1, 0), end: const Offset(0, 0)); - return SlideTransition( - position: tween.animate(animation), - child: child, - ); - }, - child: Material( - key: ValueKey(currentPage), - child: buildRight(), + return SlideTransition( + position: tween.animate(animation), + child: child, + ); + }, + child: Material( + key: ValueKey(currentPage), + child: buildRight(), + ), + ), ), - ), - ), - ) - ], + ) + ], + ); + }, ); } } diff --git a/pubspec.lock b/pubspec.lock index d3e9212..368074e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1083,13 +1083,13 @@ packages: source: hosted version: "6.5.0" yaml: - dependency: transitive + dependency: "direct main" description: name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" zip_flutter: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index b723d14..79dd7be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -75,6 +75,7 @@ dependencies: flex_seed_scheme: ^3.5.0 flutter_localizations: sdk: flutter + yaml: ^3.1.3 dev_dependencies: flutter_test: