diff --git a/assets/images/1.png b/assets/images/1.png deleted file mode 100644 index 055a1f4..0000000 Binary files a/assets/images/1.png and /dev/null differ diff --git a/assets/images/10.png b/assets/images/10.png deleted file mode 100644 index b017aa9..0000000 Binary files a/assets/images/10.png and /dev/null differ diff --git a/assets/images/2.png b/assets/images/2.png deleted file mode 100644 index 61ba398..0000000 Binary files a/assets/images/2.png and /dev/null differ diff --git a/assets/images/3.png b/assets/images/3.png deleted file mode 100644 index 80a458e..0000000 Binary files a/assets/images/3.png and /dev/null differ diff --git a/assets/images/4.png b/assets/images/4.png deleted file mode 100644 index 956aa88..0000000 Binary files a/assets/images/4.png and /dev/null differ diff --git a/assets/images/5.png b/assets/images/5.png deleted file mode 100644 index 9cfddef..0000000 Binary files a/assets/images/5.png and /dev/null differ diff --git a/assets/images/6.png b/assets/images/6.png deleted file mode 100644 index 96482ff..0000000 Binary files a/assets/images/6.png and /dev/null differ diff --git a/assets/images/7.png b/assets/images/7.png deleted file mode 100644 index 4f7fd44..0000000 Binary files a/assets/images/7.png and /dev/null differ diff --git a/assets/images/8.png b/assets/images/8.png deleted file mode 100644 index 9ae7122..0000000 Binary files a/assets/images/8.png and /dev/null differ diff --git a/assets/images/9.png b/assets/images/9.png deleted file mode 100644 index 7983245..0000000 Binary files a/assets/images/9.png and /dev/null differ diff --git a/assets/images/apple_login.png b/assets/images/apple_login.png deleted file mode 100644 index cf87a74..0000000 Binary files a/assets/images/apple_login.png and /dev/null differ diff --git a/assets/images/back.jpg b/assets/images/back.jpg deleted file mode 100644 index d6b3f91..0000000 Binary files a/assets/images/back.jpg and /dev/null differ diff --git a/assets/images/background.png b/assets/images/background.png deleted file mode 100644 index 0bd320f..0000000 Binary files a/assets/images/background.png and /dev/null differ diff --git a/assets/images/bg copy.jpg b/assets/images/bg copy.jpg deleted file mode 100644 index 58b49fb..0000000 Binary files a/assets/images/bg copy.jpg and /dev/null differ diff --git a/assets/images/color.png b/assets/images/color.png deleted file mode 100644 index f852fa2..0000000 Binary files a/assets/images/color.png and /dev/null differ diff --git a/assets/images/edit_icon.png b/assets/images/edit_icon.png deleted file mode 100644 index 3132186..0000000 Binary files a/assets/images/edit_icon.png and /dev/null differ diff --git a/assets/images/fast_login.png b/assets/images/fast_login.png deleted file mode 100644 index 9fb12c7..0000000 Binary files a/assets/images/fast_login.png and /dev/null differ diff --git a/assets/images/icons.png b/assets/images/icons.png deleted file mode 100644 index 9b4195f..0000000 Binary files a/assets/images/icons.png and /dev/null differ diff --git a/assets/images/mine_bg.png b/assets/images/mine_bg.png deleted file mode 100644 index 26d2615..0000000 Binary files a/assets/images/mine_bg.png and /dev/null differ diff --git a/assets/images/photo_icon.png b/assets/images/photo_icon.png deleted file mode 100644 index 2c82a1c..0000000 Binary files a/assets/images/photo_icon.png and /dev/null differ diff --git a/assets/images/signIn01.png b/assets/images/signIn01.png deleted file mode 100644 index 773e4b3..0000000 Binary files a/assets/images/signIn01.png and /dev/null differ diff --git a/assets/images/signIn02.png b/assets/images/signIn02.png deleted file mode 100644 index 17c31cc..0000000 Binary files a/assets/images/signIn02.png and /dev/null differ diff --git a/assets/images/signUp01.png b/assets/images/signUp01.png deleted file mode 100644 index c51e85b..0000000 Binary files a/assets/images/signUp01.png and /dev/null differ diff --git a/assets/images/signUp02.png b/assets/images/signUp02.png deleted file mode 100644 index 4e9d3a6..0000000 Binary files a/assets/images/signUp02.png and /dev/null differ diff --git a/assets/images/splashImage.png b/assets/images/splashImage.png deleted file mode 100644 index dc2c4f1..0000000 Binary files a/assets/images/splashImage.png and /dev/null differ diff --git a/assets/images/study.png b/assets/images/study.png deleted file mode 100644 index b017aa9..0000000 Binary files a/assets/images/study.png and /dev/null differ diff --git a/lib/app_theme.dart b/lib/app_theme.dart index a5adb22..ee46f8b 100644 --- a/lib/app_theme.dart +++ b/lib/app_theme.dart @@ -15,7 +15,7 @@ class AppTheme { static const Color nearlyWhite = Color(0xFFFEFEFE); static const Color black = Color(0xFF000000); static const Color nearlyBlack = Color(0xFF213333); - static const Color grey = Color(0xFF3A5160); + static const Color grey = Color.fromARGB(255, 98, 101, 102); static const Color snackbarErrorBackgroudColor = Colors.red; static const Color snackbarSuccessBackgroudColor = Colors.green; static const Color snackbarWarningBackgroudColor = Colors.orange; diff --git a/lib/constants/enum.dart b/lib/constants/enum.dart index f21a38e..29af930 100644 --- a/lib/constants/enum.dart +++ b/lib/constants/enum.dart @@ -8,6 +8,6 @@ enum InventoryInOrOutEnum { In, Out } // 创建一个映射,将 InventoryInOrOutEnum 值与整数关联起来 const Map InventoryInOrOutEnumValues = { - InventoryInOrOutEnum.In: 1, - InventoryInOrOutEnum.Out: 2, + InventoryInOrOutEnum.In: 0, + InventoryInOrOutEnum.Out: 1, }; diff --git a/lib/index.dart b/lib/index.dart index a677565..6fb8887 100644 --- a/lib/index.dart +++ b/lib/index.dart @@ -50,9 +50,9 @@ class IndexPage extends StatelessWidget { if (AppInfoService.to.checkIsFirstInstall()) { // 如果是第一次打开app打开的页面 } - return StorageService.to.getString(CacheKeys.token, isWithUser: false) == - null - ? RouteConfig.login - : RouteConfig.home; + final token = + StorageService.to.getString(CacheKeys.token, isWithUser: false); + bool isLogined = token != null; + return isLogined ? RouteConfig.home : RouteConfig.login; } } diff --git a/lib/screens/inventory_inout/components/change_button_roe.dart b/lib/screens/inventory_inout/components/change_button_roe.dart index aa98690..82a698f 100644 --- a/lib/screens/inventory_inout/components/change_button_roe.dart +++ b/lib/screens/inventory_inout/components/change_button_roe.dart @@ -18,14 +18,16 @@ class ChangeButtonRow extends StatelessWidget { children: [ const TodayButton(), const Spacer(), - InkWell( - onTap: () => controller.onMoveBack(), - child: ChangeIconButton( - icon: Icon( - Icons.arrow_back_ios_rounded, - color: Colors.white, - size: ScreenAdaper.sp(30), - ))), + ClipOval( + child: InkWell( + onTap: () => controller.onMoveBack(), + child: ChangeIconButton( + icon: Icon( + Icons.arrow_back_ios_rounded, + color: Colors.white, + size: ScreenAdaper.sp(30), + )), + )), const SizedBox( width: defaultPadding, ), diff --git a/lib/screens/inventory_inout/components/change_icon.dart b/lib/screens/inventory_inout/components/change_icon.dart index 045884f..929417e 100644 --- a/lib/screens/inventory_inout/components/change_icon.dart +++ b/lib/screens/inventory_inout/components/change_icon.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:sk_base_mobile/app_theme.dart'; import 'package:sk_base_mobile/constants/bg_color.dart'; import 'package:sk_base_mobile/util/screen_adaper_util.dart'; @@ -11,13 +12,16 @@ class ChangeIconButton extends StatelessWidget { height: ScreenAdaper.height(60), width: ScreenAdaper.height(60), alignment: Alignment.center, - decoration: - BoxDecoration(shape: BoxShape.circle, color: neviBlue, boxShadow: [ - BoxShadow( - color: neviBlue.withOpacity(.3), - offset: Offset(0, ScreenAdaper.height(10)), - blurRadius: ScreenAdaper.sp(10)) - ]), + decoration: BoxDecoration( + shape: BoxShape.circle, + gradient: const LinearGradient( + colors: [AppTheme.primaryColorLight, AppTheme.primaryColor]), + boxShadow: [ + BoxShadow( + color: neviBlue.withOpacity(.3), + offset: Offset(0, ScreenAdaper.height(10)), + blurRadius: ScreenAdaper.sp(10)) + ]), child: icon, ); } diff --git a/lib/screens/inventory_inout/components/inventory_inout_card.dart b/lib/screens/inventory_inout/components/inventory_inout_card.dart index 2ff2c72..1c7675b 100644 --- a/lib/screens/inventory_inout/components/inventory_inout_card.dart +++ b/lib/screens/inventory_inout/components/inventory_inout_card.dart @@ -1,14 +1,14 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:sk_base_mobile/app_theme.dart'; import 'package:sk_base_mobile/config.dart'; import 'package:sk_base_mobile/constants/bg_color.dart'; -import 'package:sk_base_mobile/constants/data.dart'; -import 'package:sk_base_mobile/constants/enum.dart'; -import 'package:sk_base_mobile/screens/inventory_inout/components/inventory_inout_card_content.dart'; import 'package:sk_base_mobile/screens/inventory_inout/inventory_inout_controller.dart'; import 'package:sk_base_mobile/util/util.dart'; import 'package:sk_base_mobile/widgets/fade_in_cache_image.dart'; +import '../../../constants/enum.dart'; + class InventoryInoutCard extends StatelessWidget { InventoryInoutCard({required this.index, required this.ind}); final int index; @@ -16,161 +16,253 @@ class InventoryInoutCard extends StatelessWidget { final controller = Get.find(); @override Widget build(BuildContext context) { - return Dismissible( - key: UniqueKey(), - confirmDismiss: (direction) async { - // return await ModalUtil.showWarningDialog( - // 'Remove Task', 'Are you sure to remove this task', 'Confirm', () { - // controller.db.delete(controller.list[ind][index].key, 'Tasks'); - // controller.list[ind].remove(controller.list[ind][index]); - // }); - }, - child: Container( - margin: EdgeInsets.symmetric( - vertical: ScreenAdaper.height(15), - horizontal: ScreenAdaper.width(15)), - padding: EdgeInsets.symmetric( - horizontal: ScreenAdaper.width(defaultPadding)), - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: lightAccentBlue.withOpacity(.5), - offset: Offset(0, ScreenAdaper.height(5)), - blurRadius: ScreenAdaper.sp(10)), - ], - color: Colors.white, - borderRadius: BorderRadius.circular(ScreenAdaper.sp(30))), - child: Row( + return Container( + margin: EdgeInsets.symmetric( + vertical: ScreenAdaper.height(15), + horizontal: ScreenAdaper.width(15)), + padding: EdgeInsets.symmetric( + horizontal: ScreenAdaper.width(defaultPadding), + vertical: ScreenAdaper.height(defaultPadding)), + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: AppTheme.barrierColor.withOpacity(0.2), + offset: Offset(0, ScreenAdaper.height(5)), + blurRadius: ScreenAdaper.sp(10)), + ], + color: AppTheme.nearlyWhite, + borderRadius: BorderRadius.circular(ScreenAdaper.sp(30))), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + buildImage(), + Expanded(child: buildContent()), + + // const Spacer( + // flex: 2, + // ), + // controller.list[ind][index].inOrOut == + // InventoryInOrOutEnumValues[InventoryInOrOutEnum.In] + // ? Container( + // height: ScreenAdaper.height(40), + // width: ScreenAdaper.width(40), + // decoration: BoxDecoration( + // shape: BoxShape.circle, + // gradient: const LinearGradient( + // begin: Alignment.topCenter, + // end: Alignment.bottomCenter, + // colors: [ + // lightOrange, + // darkOrange, + // ]), + // boxShadow: [ + // BoxShadow( + // color: lightOrange, + // offset: Offset(0, ScreenAdaper.height(10)), + // blurRadius: ScreenAdaper.sp(10)) + // ]), + // child: const Icon( + // Icons.done, + // color: Colors.white, + // ), + // ) + // : Align( + // alignment: Alignment.topRight, + // child: Padding( + // padding: EdgeInsets.only(top: ScreenAdaper.height(20)), + // child: PopupMenuButton( + // onSelected: (value) => { + // // controller.onTaskComplete(value, index, ind, + // // controller.list[ind][index].key, context) + // }, + // surfaceTintColor: Colors.white, + // padding: EdgeInsets.zero, + // icon: Icon( + // Icons.more_vert_rounded, + // color: Colors.grey, + // size: ScreenAdaper.sp(24), + // ), + // shape: OutlineInputBorder( + // borderRadius: + // BorderRadius.circular(ScreenAdaper.sp(20)), + // borderSide: BorderSide.none, + // ), + // itemBuilder: (context) { + // return [ + // PopupMenuItem( + // height: ScreenAdaper.height(20), + // value: 1, + // child: Row( + // children: [ + // Icon( + // Icons.edit_note, + // color: Colors.orange, + // size: ScreenAdaper.sp(14), + // ), + // SizedBox( + // width: + // ScreenAdaper.width(defaultPadding) / + // 2, + // ), + // const Text('Edit') + // ], + // )), + // PopupMenuItem( + // height: ScreenAdaper.height(25), + // value: 2, + // child: Row( + // children: [ + // Icon( + // Icons.delete_outline, + // color: Colors.orange, + // size: ScreenAdaper.sp(14), + // ), + // SizedBox( + // width: + // ScreenAdaper.width(defaultPadding) / + // 2, + // ), + // Text('Delete') + // ], + // )), + // PopupMenuItem( + // height: ScreenAdaper.height(25), + // value: 3, + // child: Row( + // children: [ + // Icon( + // Icons.done_all_outlined, + // color: Colors.orange, + // size: ScreenAdaper.sp(14), + // ), + // SizedBox( + // width: + // ScreenAdaper.width(defaultPadding) / + // 2, + // ), + // Text('Complete') + // ], + // )), + // ]; + // }, + // )), + // ), + ], + ), + ); + } + + Widget buildContent() { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, children: [ - // Image.asset( - // Data().images[controller.list[ind][index].image], - // height: 100, - // width: 100, - // ), - if (controller.list[ind][index].files.isNotEmpty) - ClipRRect( - borderRadius: BorderRadius.circular(ScreenAdaper.sp(15)), - child: FadeInCacheImage( - width: ScreenAdaper.width(100), - height: ScreenAdaper.width(100), - url: - '${GloablConfig.OSS_URL}${controller.list[ind][index].files[0]?.path}'), - ), - SizedBox( - width: ScreenAdaper.width(defaultPadding) / 2, - ), - InventoryInoutCardContent(index: index, ind: ind), - // const Spacer( - // flex: 2, - // ), - // controller.list[ind][index].inOrOut == - // InventoryInOrOutEnumValues[InventoryInOrOutEnum.In] - // ? Container( - // height: ScreenAdaper.height(40), - // width: ScreenAdaper.width(40), - // decoration: BoxDecoration( - // shape: BoxShape.circle, - // gradient: const LinearGradient( - // begin: Alignment.topCenter, - // end: Alignment.bottomCenter, - // colors: [ - // lightOrange, - // darkOrange, - // ]), - // boxShadow: [ - // BoxShadow( - // color: lightOrange, - // offset: Offset(0, ScreenAdaper.height(10)), - // blurRadius: ScreenAdaper.sp(10)) - // ]), - // child: const Icon( - // Icons.done, - // color: Colors.white, - // ), - // ) - // : Align( - // alignment: Alignment.topRight, - // child: Padding( - // padding: EdgeInsets.only(top: ScreenAdaper.height(20)), - // child: PopupMenuButton( - // onSelected: (value) => { - // // controller.onTaskComplete(value, index, ind, - // // controller.list[ind][index].key, context) - // }, - // surfaceTintColor: Colors.white, - // padding: EdgeInsets.zero, - // icon: Icon( - // Icons.more_vert_rounded, - // color: Colors.grey, - // size: ScreenAdaper.sp(24), - // ), - // shape: OutlineInputBorder( - // borderRadius: - // BorderRadius.circular(ScreenAdaper.sp(20)), - // borderSide: BorderSide.none, - // ), - // itemBuilder: (context) { - // return [ - // PopupMenuItem( - // height: ScreenAdaper.height(20), - // value: 1, - // child: Row( - // children: [ - // Icon( - // Icons.edit_note, - // color: Colors.orange, - // size: ScreenAdaper.sp(14), - // ), - // SizedBox( - // width: - // ScreenAdaper.width(defaultPadding) / - // 2, - // ), - // const Text('Edit') - // ], - // )), - // PopupMenuItem( - // height: ScreenAdaper.height(25), - // value: 2, - // child: Row( - // children: [ - // Icon( - // Icons.delete_outline, - // color: Colors.orange, - // size: ScreenAdaper.sp(14), - // ), - // SizedBox( - // width: - // ScreenAdaper.width(defaultPadding) / - // 2, - // ), - // Text('Delete') - // ], - // )), - // PopupMenuItem( - // height: ScreenAdaper.height(25), - // value: 3, - // child: Row( - // children: [ - // Icon( - // Icons.done_all_outlined, - // color: Colors.orange, - // size: ScreenAdaper.sp(14), - // ), - // SizedBox( - // width: - // ScreenAdaper.width(defaultPadding) / - // 2, - // ), - // Text('Complete') - // ], - // )), - // ]; - // }, - // )), - // ), + Expanded( + child: Text( + controller.list[ind][index].product?.name ?? '-', + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: ScreenAdaper.sp(25)), + )), + buildInOrOut() ], ), + Text( + controller.list[ind][index].product?.company?.name ?? '-', + style: TextStyle( + color: AppTheme.grey, + fontWeight: FontWeight.bold, + fontSize: ScreenAdaper.sp(20)), + ), + SizedBox( + height: ScreenAdaper.height(5), + ), + Row( + children: [ + Expanded( + child: Text( + '项目: ${controller.list[ind][index].project?.name}', + style: TextStyle( + fontWeight: FontWeight.w600, fontSize: ScreenAdaper.sp(20)), + ), + ), + ], + ), + SizedBox( + height: ScreenAdaper.height(5), + ), + Row( + children: [ + Expanded( + child: Text( + '数量: ${controller.list[ind][index].quantity} ${controller.list[ind][index].product?.unit?.label ?? '-'}', + style: TextStyle( + fontWeight: FontWeight.w600, fontSize: ScreenAdaper.sp(20)), + ), + ), + Text( + controller.list[ind][index].agent ?? '-', + style: TextStyle( + fontWeight: FontWeight.w600, fontSize: ScreenAdaper.sp(20)), + ), + ], + ) + ], + ); + } + + Widget buildImage() { + return Container( + margin: EdgeInsets.only(right: ScreenAdaper.width(defaultPadding) / 2), + child: ClipRRect( + borderRadius: BorderRadius.circular(ScreenAdaper.sp(15)), + child: FadeInCacheImage( + width: ScreenAdaper.width(100), + height: ScreenAdaper.width(100), + url: controller.list[ind][index].product?.files.isNotEmpty ?? + false + ? '${GloablConfig.OSS_URL}${controller.list[ind][index].product?.files[0].path}' + : ''), + )); + } + + Widget buildInOrOut() { + final bgColor = controller.list[ind][index].inOrOut == + InventoryInOrOutEnumValues[InventoryInOrOutEnum.In] + ? AppTheme.snackbarSuccessBackgroudColor + : AppTheme.snackbarErrorBackgroudColor; + final textInOut = controller.list[ind][index].inOrOut == + InventoryInOrOutEnumValues[InventoryInOrOutEnum.In] + ? '入' + : '出'; + return Container( + alignment: Alignment.center, + height: ScreenAdaper.height(40), + width: ScreenAdaper.width(40), + decoration: BoxDecoration( + shape: BoxShape.circle, + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + bgColor.withOpacity(0.6), + bgColor, + ]), + boxShadow: [ + BoxShadow( + color: lightOrange, + offset: Offset(0, ScreenAdaper.height(10)), + blurRadius: ScreenAdaper.sp(10)) + ]), + child: Text( + textInOut, + style: const TextStyle( + color: AppTheme.nearlyWhite, fontWeight: FontWeight.w600), ), ); } diff --git a/lib/screens/inventory_inout/components/inventory_inout_card_content.dart b/lib/screens/inventory_inout/components/inventory_inout_card_content.dart deleted file mode 100644 index 4eb13d6..0000000 --- a/lib/screens/inventory_inout/components/inventory_inout_card_content.dart +++ /dev/null @@ -1,72 +0,0 @@ -import 'dart:math'; - -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:sk_base_mobile/constants/bg_color.dart'; -import 'package:sk_base_mobile/constants/data.dart'; -import 'package:sk_base_mobile/screens/inventory_inout/inventory_inout_controller.dart'; -import 'package:sk_base_mobile/util/screen_adaper_util.dart'; - -class InventoryInoutCardContent extends StatelessWidget { - InventoryInoutCardContent( - {super.key, required this.index, required this.ind}); - final int index; - final int ind; - final int randomColor1 = Random().nextInt(9); - final int randomColor2 = Random().nextInt(9); - final controller = Get.find(); - @override - Widget build(BuildContext context) { - return Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - controller.list[ind][index].product?.name ?? 'Product Name', - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: ScreenAdaper.sp(25)), - ), - // Text( - // '${controller.list[ind][index].time} - ${controller.list[ind][index].time}', - // style: const TextStyle( - // color: Colors.grey, fontWeight: FontWeight.w300, fontSize: 12), - // ), - SizedBox( - height: ScreenAdaper.width(defaultPadding) / 2, - ), - // Row( - // children: [ - // Container( - // alignment: Alignment.center, - // padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 10), - // decoration: BoxDecoration( - // color: Data().colors[randomColor1].withOpacity(.5), - // borderRadius: BorderRadius.circular(10), - // ), - // child: Text( - // Data().tags[Random().nextInt(13)], - // style: TextStyle(color: Data().colors[randomColor1]), - // ), - // ), - // const SizedBox( - // width: defaultPadding / 2, - // ), - // Container( - // alignment: Alignment.center, - // padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 10), - // decoration: BoxDecoration( - // color: Data().colors[randomColor2].withOpacity(.5), - // borderRadius: BorderRadius.circular(10)), - // child: Text( - // Data().tags[Random().nextInt(13)], - // style: TextStyle(color: Data().colors[randomColor2]), - // ), - // ) - // ], - // ), - ], - ); - } -} diff --git a/lib/screens/inventory_inout/components/task_list.dart b/lib/screens/inventory_inout/components/task_list.dart index 957bf13..1740a97 100644 --- a/lib/screens/inventory_inout/components/task_list.dart +++ b/lib/screens/inventory_inout/components/task_list.dart @@ -15,12 +15,12 @@ class TaskList extends StatelessWidget { return Responsive( tablet: Grid( crossAsis: 2, - ratio: 3, + ratio: 2.2, ind: index, ), largeTablet: Grid( crossAsis: 3, - ratio: 3, + ratio: 2.3, ind: index, ), mobile: Grid( diff --git a/lib/screens/inventory_inout/components/task_page_View.dart b/lib/screens/inventory_inout/components/task_page_View.dart index 7376786..105f787 100644 --- a/lib/screens/inventory_inout/components/task_page_View.dart +++ b/lib/screens/inventory_inout/components/task_page_View.dart @@ -9,7 +9,8 @@ class TaskPageView extends StatelessWidget { @override Widget build(BuildContext context) { return PageView( - physics: const NeverScrollableScrollPhysics(), + physics: const BouncingScrollPhysics(), + reverse: true, controller: controller.pageController, children: List.generate( controller.daysNum, diff --git a/lib/screens/inventory_inout/inventory_inout_controller.dart b/lib/screens/inventory_inout/inventory_inout_controller.dart index 291de5b..c9f5b84 100644 --- a/lib/screens/inventory_inout/inventory_inout_controller.dart +++ b/lib/screens/inventory_inout/inventory_inout_controller.dart @@ -59,7 +59,8 @@ class InventoryInoutController extends GetxController { duration: const Duration(milliseconds: 100), left: value * 80, child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(30)), + borderRadius: + const BorderRadius.all(Radius.circular(30)), child: Material( child: Ink( decoration: BoxDecoration( @@ -67,7 +68,7 @@ class InventoryInoutController extends GetxController { colors: [Colors.green[300]!, Colors.green], ), borderRadius: - BorderRadius.all(Radius.circular(30)), + const BorderRadius.all(Radius.circular(30)), ), child: ElevatedButton( onPressed: () { @@ -80,7 +81,7 @@ class InventoryInoutController extends GetxController { shadowColor: MaterialStateProperty.all( Colors.transparent), shape: MaterialStateProperty.all( - RoundedRectangleBorder( + const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(30)), ), @@ -256,12 +257,12 @@ class InventoryInoutController extends GetxController { } getDateAccordingTabs(int value) { - return '${DateUtil.addPrefix(dateTime.add(Duration(days: value)).year.toString())}-${DateUtil.addPrefix(dateTime.add(Duration(days: value)).month.toString())}-${DateUtil.addPrefix(dateTime.add(Duration(days: value)).day.toString())}'; + return DateUtil.format(dateTime.add(Duration(days: -(daysNum - value)))); } getSepretLists() { List> tempList = []; - for (int i = 0; i < 7; i++) { + for (int i = daysNum; i > 0; i--) { RxList tempList1 = [].obs; tempList1.clear(); for (int j = 0; j < model.length; j++) { diff --git a/lib/store/auth.store.dart b/lib/store/auth.store.dart index 499c2ac..ddcf360 100644 --- a/lib/store/auth.store.dart +++ b/lib/store/auth.store.dart @@ -115,7 +115,7 @@ class AuthStore extends GetxController { try { final response = await Api.getUserInfo(); if (response.data != null) { - UserInfoModel userInfo = UserInfoModel.fromJson(response.data['data']); + UserInfoModel userInfo = UserInfoModel.fromJson(response.data); await updateUserInfoState(userInfo); } } catch (e) { diff --git a/lib/widgets/fade_in_cache_image.dart b/lib/widgets/fade_in_cache_image.dart index 2a6b1cf..3586b3f 100644 --- a/lib/widgets/fade_in_cache_image.dart +++ b/lib/widgets/fade_in_cache_image.dart @@ -1,6 +1,8 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; import 'package:sk_base_mobile/app_theme.dart'; +import 'package:sk_base_mobile/util/screen_adaper_util.dart'; class FadeInCacheImage extends StatefulWidget { final double? width; @@ -40,13 +42,12 @@ class _FadeInCacheImageState extends State { theContext = context; if ((widget.url == null || widget.url == '' || widget.url == 'null')) { - return Image( - width: widget.width, - height: widget.height, - fit: widget.fit, - image: AssetImage( - 'assets/images/deer_detail_banner1.jpg', - )); + return Container( + width: widget.width, + height: widget.height, + child: Icon(Icons.image_not_supported, + size: ScreenAdaper.sp(100), color: AppTheme.grey), + ); } return buildImg(widget.url);