diff --git a/lib/components/style/sliding_up_opener.dart b/lib/components/style/sliding_up_opener.dart index b2cd7e08..d00411a4 100644 --- a/lib/components/style/sliding_up_opener.dart +++ b/lib/components/style/sliding_up_opener.dart @@ -13,6 +13,8 @@ class SlidingUpOpener extends StatefulWidget { /// The height of the sliding panel when fully open. final double maxHeight; + final double heightOffset; + /// If non-null, shows a darkening shadow over the [body] as /// the panel slides open. final bool backdropEnabled; @@ -67,6 +69,7 @@ class SlidingUpOpener extends StatefulWidget { this.minHeight = 160.0, this.maxHeight = 500.0, this.borderRadius = 16.0, + this.heightOffset = 0.0, this.backdropEnabled = true, this.catchPopScope = true, this.clickToOpen = true, @@ -109,7 +112,7 @@ class SlidingUpOpenerState extends State { collapsed: buildCollapsed(), body: Column(children: [ Expanded(child: widget.body), - SizedBox(height: widget.minHeight + 80), + SizedBox(height: widget.minHeight + widget.heightOffset + 80), ]), ); diff --git a/lib/ui/image_gallery_screen.dart b/lib/ui/image_gallery_screen.dart index d3cd56c4..b91062ef 100644 --- a/lib/ui/image_gallery_screen.dart +++ b/lib/ui/image_gallery_screen.dart @@ -191,7 +191,7 @@ class ImageGalleryScreenState extends State { .replaceFirst('.', ''); // 原本檔名是 uuid v4 產生,前綴為 [0-9A-F], // 為了做區別而設計成這樣。 - final dst = XFile.fs.path.join(baseDir.path, 'G$name'); + final dst = XFile.fs.path.join(baseDir.path, 'g$name'); Log.ger('save_image', 'start', dst); // avator first, avoid different with origin one diff --git a/lib/ui/order/cashier/order_cashier_modal.dart b/lib/ui/order/cashier/order_cashier_modal.dart index a5da8b5e..7d663b6d 100644 --- a/lib/ui/order/cashier/order_cashier_modal.dart +++ b/lib/ui/order/cashier/order_cashier_modal.dart @@ -60,6 +60,7 @@ class _OrderCashierModalState extends State { // 4 rows * 64 + 24 (insets) + 64 (collapse) maxHeight: 408, minHeight: 84, + heightOffset: 58, renderPanelSheet: false, body: body, panel: panel, diff --git a/test/image_gallery_screen_test.dart b/test/image_gallery_screen_test.dart index bd2875a1..a962bc5c 100644 --- a/test/image_gallery_screen_test.dart +++ b/test/image_gallery_screen_test.dart @@ -39,7 +39,8 @@ void main() { await tester.tap(find.byKey(const Key('image_gallery.add'))); await tester.pumpAndSettle(); - expect(imagePath, startsWith('menu_image/G20')); + final pattern = RegExp('menu_image/g[0-9]{8}T[0-9]{12}'); + expect(pattern.hasMatch(imagePath!), isTrue); expect(XFile('$imagePath-avator').file.existsSync(), isTrue); }); @@ -87,10 +88,10 @@ void main() { testWidgets('delete selected', (tester) async { final gallery = GlobalKey(); - await createImageAt('G20230102030405111'); - await createImageAt('G20230102030405222'); - await createImageAt('G20230102030405222-avator'); - await createImageAt('G20230102030405333'); + await createImageAt('g20230102030405111'); + await createImageAt('g20230102030405222'); + await createImageAt('g20230102030405222-avator'); + await createImageAt('g20230102030405333'); await tester.pumpWidget(MaterialApp( home: ImageGalleryScreen(key: gallery), @@ -144,8 +145,8 @@ void main() { expect( gallery.currentState!.images, equals([ - 'menu_image/G20230102030405333', - 'menu_image/G20230102030405111', + 'menu_image/g20230102030405333', + 'menu_image/g20230102030405111', ]), ); @@ -159,7 +160,7 @@ void main() { expect( gallery.currentState!.images, - equals(['menu_image/G20230102030405333']), + equals(['menu_image/g20230102030405333']), ); });