From ad64c15d0620f213438a248900aae6c2012b9abe Mon Sep 17 00:00:00 2001 From: louis <869322496@qq.com> Date: Mon, 1 Apr 2024 10:13:24 +0800 Subject: [PATCH] fix: inevnetory --- .../components/inventory_inout_page_View.dart | 6 +++++- .../{task_list.dart => inventory_inout_view_item.dart} | 0 lib/screens/inventory_inout/components/upper_body.dart | 2 +- .../new_inventory_inout/components/inventory_search.dart | 7 +++++-- lib/screens/sale_quotation/components/data_table.dart | 1 - lib/screens/sale_quotation/sale_quotation.dart | 2 -- 6 files changed, 11 insertions(+), 7 deletions(-) rename lib/screens/inventory_inout/components/{task_list.dart => inventory_inout_view_item.dart} (100%) diff --git a/lib/screens/inventory_inout/components/inventory_inout_page_View.dart b/lib/screens/inventory_inout/components/inventory_inout_page_View.dart index 08123df..09faa2f 100644 --- a/lib/screens/inventory_inout/components/inventory_inout_page_View.dart +++ b/lib/screens/inventory_inout/components/inventory_inout_page_View.dart @@ -1,8 +1,9 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:sk_base_mobile/screens/inventory_inout/components/task_list.dart'; import 'package:sk_base_mobile/screens/inventory_inout/inventory_inout_controller.dart'; +import 'inventory_inout_view_item.dart'; + class InventoryInoutView extends StatelessWidget { InventoryInoutView({super.key}); final controller = Get.find(); @@ -11,6 +12,9 @@ class InventoryInoutView extends StatelessWidget { return PageView( physics: const BouncingScrollPhysics(), reverse: true, + onPageChanged: (index) { + controller.setIndex(index); + }, controller: controller.pageController, children: List.generate( controller.daysNum, diff --git a/lib/screens/inventory_inout/components/task_list.dart b/lib/screens/inventory_inout/components/inventory_inout_view_item.dart similarity index 100% rename from lib/screens/inventory_inout/components/task_list.dart rename to lib/screens/inventory_inout/components/inventory_inout_view_item.dart diff --git a/lib/screens/inventory_inout/components/upper_body.dart b/lib/screens/inventory_inout/components/upper_body.dart index 31d1ace..82d487a 100644 --- a/lib/screens/inventory_inout/components/upper_body.dart +++ b/lib/screens/inventory_inout/components/upper_body.dart @@ -32,7 +32,7 @@ class UperBody extends StatelessWidget { itemBuilder: (context, index) { return InkWell( borderRadius: BorderRadius.circular(ScreenAdaper.sp(20)), - onTap: () => controller.setIndex(index), + onTap: () => controller.pageController.jumpToPage(index), child: DateContainer(index: index), ); }, diff --git a/lib/screens/new_inventory_inout/components/inventory_search.dart b/lib/screens/new_inventory_inout/components/inventory_search.dart index fe4662c..5660192 100644 --- a/lib/screens/new_inventory_inout/components/inventory_search.dart +++ b/lib/screens/new_inventory_inout/components/inventory_search.dart @@ -62,6 +62,9 @@ class InventorySearch extends StatelessWidget { hintText: '名称,编号,规格', floatingLabelBehavior: FloatingLabelBehavior.always, prefixIcon: const Icon(Icons.search), + prefixIconConstraints: BoxConstraints( + minWidth: ScreenAdaper.width(80), + ), // 当searchBarController有值时不显示 suffixIcon: controller.searchKey.value.isEmpty ? null @@ -152,8 +155,8 @@ class InventorySearch extends StatelessWidget { Widget buildHasInventoryPicker() { return Container( - width: ScreenAdaper.width(200), - constraints: BoxConstraints(minWidth: ScreenAdaper.width(200)), + width: ScreenAdaper.width(220), + constraints: BoxConstraints(minWidth: ScreenAdaper.width(220)), child: Obx( () => DropdownButtonFormField( value: controller.hasInventoryStatus.value, diff --git a/lib/screens/sale_quotation/components/data_table.dart b/lib/screens/sale_quotation/components/data_table.dart index 288367e..afcca4d 100644 --- a/lib/screens/sale_quotation/components/data_table.dart +++ b/lib/screens/sale_quotation/components/data_table.dart @@ -1,6 +1,5 @@ import 'package:data_table_2/data_table_2.dart'; import 'package:sk_base_mobile/app_theme.dart'; -import 'package:sk_base_mobile/util/screen_adaper_util.dart'; import 'package:sk_base_mobile/widgets/core/sk_text_input.dart'; import './helper.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/sale_quotation/sale_quotation.dart b/lib/screens/sale_quotation/sale_quotation.dart index 12387a3..2a9fecf 100644 --- a/lib/screens/sale_quotation/sale_quotation.dart +++ b/lib/screens/sale_quotation/sale_quotation.dart @@ -1,7 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_sticky_header/flutter_sticky_header.dart'; import 'package:sk_base_mobile/screens/sale_quotation/components/data_table.dart'; -import 'package:sk_base_mobile/util/screen_adaper_util.dart'; import 'package:sk_base_mobile/widgets/sk_appbar.dart'; class SaleQuotationPage extends StatelessWidget {