From c9d6adc6700bfda2e0ad1e25c81ceda5c3c8e474 Mon Sep 17 00:00:00 2001 From: louis <869322496@qq.com> Date: Wed, 20 Mar 2024 10:47:16 +0800 Subject: [PATCH] feat: optimize inventory in out dialog UI --- lib/constants/text_enum.dart | 1 + .../inventory_inout/components/date_container.dart | 2 +- .../inventory_inout/components/upper_body.dart | 2 +- .../inventory_inout_controller.dart | 14 ++++++++------ .../new_inventory_inout/new_inventory_inout.dart | 5 +++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/constants/text_enum.dart b/lib/constants/text_enum.dart index 84b4da6..de88093 100644 --- a/lib/constants/text_enum.dart +++ b/lib/constants/text_enum.dart @@ -3,4 +3,5 @@ class TextEnum { static const String homeWelcomeText = '你好,'; static const String backToTodayButtonText = '今天'; static const String createInventoryInOutBtnText = '提交'; + static const String inventoryInOutDialogTitle = '出入库登记'; } diff --git a/lib/screens/inventory_inout/components/date_container.dart b/lib/screens/inventory_inout/components/date_container.dart index f3d2278..b1260d2 100644 --- a/lib/screens/inventory_inout/components/date_container.dart +++ b/lib/screens/inventory_inout/components/date_container.dart @@ -16,7 +16,7 @@ class DateContainer extends StatelessWidget { return Obx(() => AnimatedContainer( duration: const Duration(milliseconds: 200), height: ScreenAdaper.height(120), - width: ScreenAdaper.width(100), + width: ScreenAdaper.width(110), margin: EdgeInsets.only(left: ScreenAdaper.width(size.width) * 0.05), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/screens/inventory_inout/components/upper_body.dart b/lib/screens/inventory_inout/components/upper_body.dart index 3b3fdd3..52f4391 100644 --- a/lib/screens/inventory_inout/components/upper_body.dart +++ b/lib/screens/inventory_inout/components/upper_body.dart @@ -25,7 +25,7 @@ class UperBody extends StatelessWidget { shrinkWrap: true, scrollDirection: Axis.horizontal, padding: EdgeInsets.only( - bottom: ScreenAdaper.height(30), top: defaultPadding), + bottom: ScreenAdaper.height(20), top: defaultPadding), itemBuilder: (context, index) { return InkWell( borderRadius: BorderRadius.circular(ScreenAdaper.sp(20)), diff --git a/lib/screens/inventory_inout/inventory_inout_controller.dart b/lib/screens/inventory_inout/inventory_inout_controller.dart index 9a4d675..204dbee 100644 --- a/lib/screens/inventory_inout/inventory_inout_controller.dart +++ b/lib/screens/inventory_inout/inventory_inout_controller.dart @@ -146,19 +146,21 @@ class InventoryInoutController extends GetxController { /// 打开新建库存出入库对话框 Future showInventoryInoutCreateDialog() async { final isTablet = Responsive.isTablet(Get.context!); + print(isTablet); isTablet ? showGeneralDialog( context: Get.overlayContext!, - barrierLabel: "Barrier", + barrierLabel: "CreateInventoryInout", barrierDismissible: true, - barrierColor: Colors.black.withOpacity(0.5), transitionDuration: const Duration(milliseconds: 400), pageBuilder: (_, __, ___) { - return Center( + return Container( + margin: EdgeInsets.symmetric( + horizontal: ScreenAdaper.width(100), + vertical: ScreenAdaper.height(100)), child: ClipRRect( - borderRadius: BorderRadius.circular(30), - child: Material(child: NewInventoryInout()), - ), + borderRadius: BorderRadius.circular(30), + child: Material(child: NewInventoryInout())), ); }, transitionBuilder: (_, anim, __, child) { diff --git a/lib/screens/new_inventory_inout/new_inventory_inout.dart b/lib/screens/new_inventory_inout/new_inventory_inout.dart index 4037d8c..8b87eb2 100644 --- a/lib/screens/new_inventory_inout/new_inventory_inout.dart +++ b/lib/screens/new_inventory_inout/new_inventory_inout.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:get/get.dart'; import 'package:sk_base_mobile/app_theme.dart'; +import 'package:sk_base_mobile/constants/constants.dart'; import 'package:sk_base_mobile/models/product.model.dart'; import 'package:sk_base_mobile/screens/new_inventory_inout/components/category_input.dart'; import 'package:sk_base_mobile/screens/new_inventory_inout/components/date_time.dart'; @@ -69,13 +70,13 @@ class NewInventoryInout extends StatelessWidget { child: Row( children: [ Text( - '出入库登记', + TextEnum.inventoryInOutDialogTitle, style: TextStyle( fontSize: ScreenAdaper.sp(25), fontWeight: FontWeight.w700, ), ), - Spacer(), + const Spacer(), IconButton( onPressed: () { Get.back();