feat : init statics
This commit is contained in:
20
assets/icons/calendar_search_outline.svg
Normal file
20
assets/icons/calendar_search_outline.svg
Normal file
@@ -0,0 +1,20 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5.3335 3.83301C5.06016 3.83301 4.8335 3.60634 4.8335 3.33301V1.33301C4.8335 1.05967 5.06016 0.833008 5.3335 0.833008C5.60683 0.833008 5.8335 1.05967 5.8335 1.33301V3.33301C5.8335 3.60634 5.60683 3.83301 5.3335 3.83301Z"
|
||||
fill="#797979"/>
|
||||
<path d="M10.6665 3.83301C10.3932 3.83301 10.1665 3.60634 10.1665 3.33301V1.33301C10.1665 1.05967 10.3932 0.833008 10.6665 0.833008C10.9398 0.833008 11.1665 1.05967 11.1665 1.33301V3.33301C11.1665 3.60634 10.9398 3.83301 10.6665 3.83301Z"
|
||||
fill="#797979"/>
|
||||
<path d="M12.1333 14.7667C10.68 14.7667 9.5 13.5867 9.5 12.1333C9.5 10.68 10.68 9.5 12.1333 9.5C13.5867 9.5 14.7667 10.68 14.7667 12.1333C14.7667 13.5867 13.5867 14.7667 12.1333 14.7667ZM12.1333 10.5C11.2333 10.5 10.5 11.2333 10.5 12.1333C10.5 13.0333 11.2333 13.7667 12.1333 13.7667C13.0333 13.7667 13.7667 13.0333 13.7667 12.1333C13.7667 11.2333 13.0333 10.5 12.1333 10.5Z"
|
||||
fill="#797979"/>
|
||||
<path d="M14.6665 15.167C14.5398 15.167 14.4131 15.1203 14.3131 15.0203L13.6465 14.3536C13.4531 14.1603 13.4531 13.8403 13.6465 13.647C13.8398 13.4536 14.1598 13.4536 14.3531 13.647L15.0198 14.3136C15.2131 14.507 15.2131 14.827 15.0198 15.0203C14.9198 15.1203 14.7931 15.167 14.6665 15.167Z"
|
||||
fill="#797979"/>
|
||||
<path d="M5.66667 9.66658C5.58 9.66658 5.49333 9.64659 5.41333 9.61326C5.32666 9.57992 5.25333 9.53324 5.19333 9.47324C5.16666 9.43991 5.13333 9.40658 5.11333 9.37325C5.08667 9.33325 5.06667 9.29325 5.05333 9.25325C5.03333 9.21325 5.02 9.17326 5.01334 9.13326C5.00667 9.08659 5 9.03992 5 8.99992C5 8.82658 5.07333 8.65325 5.19333 8.52659C5.25333 8.46659 5.32666 8.41991 5.41333 8.38657C5.65333 8.27991 5.95334 8.33992 6.14 8.52659C6.26 8.65325 6.33333 8.82658 6.33333 8.99992C6.33333 9.03992 6.32666 9.08659 6.32 9.13326C6.31333 9.17326 6.3 9.21325 6.28 9.25325C6.26667 9.29325 6.24667 9.33325 6.22 9.37325C6.19333 9.40658 6.16667 9.43991 6.14 9.47324C6.01334 9.59324 5.84 9.66658 5.66667 9.66658Z"
|
||||
fill="#797979"/>
|
||||
<path d="M8.00016 9.66679C7.82683 9.66679 7.65349 9.59345 7.52682 9.47345C7.40682 9.34679 7.3335 9.18012 7.3335 9.00012C7.3335 8.91346 7.3535 8.82679 7.38683 8.74679C7.42016 8.66679 7.46682 8.59346 7.52682 8.5268C7.77349 8.28013 8.22017 8.28013 8.4735 8.5268C8.5935 8.65346 8.66683 8.82679 8.66683 9.00012C8.66683 9.04012 8.66016 9.0868 8.65349 9.13347C8.64683 9.17347 8.63349 9.21346 8.61349 9.25346C8.60016 9.29346 8.58016 9.33346 8.5535 9.37346C8.52683 9.40679 8.50017 9.44012 8.4735 9.47345C8.34683 9.59345 8.1735 9.66679 8.00016 9.66679Z"
|
||||
fill="#797979"/>
|
||||
<path d="M5.66667 11.9998C5.49333 11.9998 5.32 11.9265 5.19333 11.8065C5.07333 11.6798 5 11.5065 5 11.3331C5 11.2465 5.02 11.1598 5.05333 11.0798C5.08667 10.9931 5.13333 10.9198 5.19333 10.8598C5.44 10.6131 5.89334 10.6131 6.14 10.8598C6.26 10.9865 6.33333 11.1598 6.33333 11.3331C6.33333 11.5065 6.26 11.6798 6.14 11.8065C6.01334 11.9265 5.84 11.9998 5.66667 11.9998Z"
|
||||
fill="#797979"/>
|
||||
<path d="M13.6668 6.55957H2.3335C2.06016 6.55957 1.8335 6.3329 1.8335 6.05957C1.8335 5.78624 2.06016 5.55957 2.3335 5.55957H13.6668C13.9402 5.55957 14.1668 5.78624 14.1668 6.05957C14.1668 6.3329 13.9402 6.55957 13.6668 6.55957Z"
|
||||
fill="#797979"/>
|
||||
<path d="M8.91333 15.1663H5.33333C2.9 15.1663 1.5 13.7663 1.5 11.333V5.66634C1.5 3.23301 2.9 1.83301 5.33333 1.83301H10.6667C13.1 1.83301 14.5 3.23301 14.5 5.66634V8.66634C14.5 8.93967 14.2733 9.16634 14 9.16634C13.7267 9.16634 13.5 8.93967 13.5 8.66634V5.66634C13.5 3.75967 12.5733 2.83301 10.6667 2.83301H5.33333C3.42667 2.83301 2.5 3.75967 2.5 5.66634V11.333C2.5 13.2397 3.42667 14.1663 5.33333 14.1663H8.91333C9.18666 14.1663 9.41333 14.393 9.41333 14.6663C9.41333 14.9397 9.18666 15.1663 8.91333 15.1663Z"
|
||||
fill="#797979"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
6
assets/icons/profile2_outline.svg
Normal file
6
assets/icons/profile2_outline.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.10622 7.74634C6.08622 7.74634 6.07288 7.74634 6.05288 7.74634C6.01955 7.73967 5.97288 7.73967 5.93288 7.74634C3.99955 7.68634 2.53955 6.16634 2.53955 4.29301C2.53955 2.38634 4.09288 0.833008 5.99955 0.833008C7.90622 0.833008 9.45955 2.38634 9.45955 4.29301C9.45288 6.16634 7.98622 7.68634 6.12622 7.74634C6.11955 7.74634 6.11288 7.74634 6.10622 7.74634ZM5.99955 1.83301C4.64622 1.83301 3.53955 2.93967 3.53955 4.29301C3.53955 5.62634 4.57955 6.69967 5.90622 6.74634C5.94622 6.73967 6.03288 6.73967 6.11955 6.74634C7.42622 6.68634 8.45288 5.61301 8.45955 4.29301C8.45955 2.93967 7.35288 1.83301 5.99955 1.83301Z" fill="#797979"/>
|
||||
<path d="M11.0261 7.83366C11.0061 7.83366 10.9861 7.83366 10.9661 7.82699C10.6928 7.85366 10.4128 7.66033 10.3861 7.38699C10.3594 7.11366 10.5261 6.86699 10.7994 6.83366C10.8794 6.82699 10.9661 6.82699 11.0394 6.82699C12.0128 6.77366 12.7728 5.97366 12.7728 4.99366C12.7728 3.98033 11.9528 3.16033 10.9394 3.16033C10.6661 3.16699 10.4394 2.94033 10.4394 2.66699C10.4394 2.39366 10.6661 2.16699 10.9394 2.16699C12.4994 2.16699 13.7728 3.44033 13.7728 5.00033C13.7728 6.53366 12.5728 7.77366 11.0461 7.83366C11.0394 7.83366 11.0328 7.83366 11.0261 7.83366Z" fill="#797979"/>
|
||||
<path d="M6.11307 15.0337C4.80641 15.0337 3.49307 14.7003 2.49974 14.0337C1.57307 13.4203 1.06641 12.5803 1.06641 11.667C1.06641 10.7537 1.57307 9.90699 2.49974 9.28699C4.49974 7.96033 7.73974 7.96033 9.72641 9.28699C10.6464 9.90033 11.1597 10.7403 11.1597 11.6537C11.1597 12.567 10.6531 13.4137 9.72641 14.0337C8.72641 14.7003 7.41974 15.0337 6.11307 15.0337ZM3.05307 10.127C2.41307 10.5537 2.06641 11.1003 2.06641 11.6737C2.06641 12.2403 2.41974 12.787 3.05307 13.207C4.71307 14.3203 7.51307 14.3203 9.17307 13.207C9.81307 12.7803 10.1597 12.2337 10.1597 11.6603C10.1597 11.0937 9.80641 10.547 9.17307 10.127C7.51307 9.02033 4.71307 9.02033 3.05307 10.127Z" fill="#797979"/>
|
||||
<path d="M12.2263 13.8333C11.993 13.8333 11.7863 13.6733 11.7396 13.4333C11.6863 13.16 11.8596 12.9 12.1263 12.84C12.5463 12.7533 12.933 12.5867 13.233 12.3533C13.613 12.0667 13.8196 11.7067 13.8196 11.3267C13.8196 10.9467 13.613 10.5867 13.2396 10.3067C12.9463 10.08 12.5796 9.92001 12.1463 9.82001C11.8796 9.76001 11.7063 9.49335 11.7663 9.22001C11.8263 8.95335 12.093 8.78001 12.3663 8.84001C12.9396 8.96668 13.4396 9.19335 13.8463 9.50668C14.4663 9.97335 14.8196 10.6333 14.8196 11.3267C14.8196 12.02 14.4596 12.68 13.8396 13.1533C13.4263 13.4733 12.9063 13.7067 12.333 13.82C12.293 13.8333 12.2596 13.8333 12.2263 13.8333Z" fill="#797979"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
BIN
assets/vec/calendar_search_outline.svg.vec
Normal file
BIN
assets/vec/calendar_search_outline.svg.vec
Normal file
Binary file not shown.
BIN
assets/vec/profile2_outline.svg.vec
Normal file
BIN
assets/vec/profile2_outline.svg.vec
Normal file
Binary file not shown.
@@ -7,6 +7,7 @@ import 'package:rasadyar_app/presentation/routes/app_pages.dart';
|
||||
import 'package:rasadyar_auth/data/services/token_storage_service.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_inspection/inspection.dart';
|
||||
import 'package:rasadyar_inspection/presentation/routes/app_routes.dart';
|
||||
|
||||
class SplashLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
late final AnimationController scaleController;
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_inspection/inspection.dart';
|
||||
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';
|
||||
|
||||
|
||||
part 'app_paths.dart';
|
||||
|
||||
sealed class AppPages {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart' hide ListItem2;
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart' hide ListItem2;
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:rasadyar_chicken/data/models/response/roles_products/roles_produ
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/inventory_widget.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart';
|
||||
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:rasadyar_chicken/data/models/response/roles_products/roles_produ
|
||||
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/inventory_widget.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart';
|
||||
|
||||
import 'package:rasadyar_chicken/presentation/widget/page_route.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/inventory_widget.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart';
|
||||
|
||||
import 'package:rasadyar_chicken/presentation/widget/page_route.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_pr
|
||||
import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart';
|
||||
|
||||
|
||||
import 'package:rasadyar_chicken/presentation/widget/page_route.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buy
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart' hide ListItem2;
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:rasadyar_chicken/data/models/response/roles_products/roles_produ
|
||||
import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart';
|
||||
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
|
||||
@@ -58,6 +58,9 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/calendar_search.svg
|
||||
SvgGenImage get calendarSearch => const SvgGenImage('assets/icons/calendar_search.svg');
|
||||
|
||||
/// File path: assets/icons/calendar_search_outline.svg
|
||||
SvgGenImage get calendarSearchOutline => const SvgGenImage('assets/icons/calendar_search_outline.svg');
|
||||
|
||||
/// File path: assets/icons/call.svg
|
||||
SvgGenImage get call => const SvgGenImage('assets/icons/call.svg');
|
||||
|
||||
@@ -190,6 +193,9 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/profile2.svg
|
||||
SvgGenImage get profile2 => const SvgGenImage('assets/icons/profile2.svg');
|
||||
|
||||
/// File path: assets/icons/profile2_outline.svg
|
||||
SvgGenImage get profile2Outline => const SvgGenImage('assets/icons/profile2_outline.svg');
|
||||
|
||||
/// File path: assets/icons/profile_circle.svg
|
||||
SvgGenImage get profileCircle => const SvgGenImage('assets/icons/profile_circle.svg');
|
||||
|
||||
@@ -273,6 +279,7 @@ class $AssetsIconsGen {
|
||||
buy,
|
||||
calendar,
|
||||
calendarSearch,
|
||||
calendarSearchOutline,
|
||||
call,
|
||||
check,
|
||||
checkSquare,
|
||||
@@ -317,6 +324,7 @@ class $AssetsIconsGen {
|
||||
pictureFrame,
|
||||
placeHolder,
|
||||
profile2,
|
||||
profile2Outline,
|
||||
profileCircle,
|
||||
profileUser,
|
||||
receiptDiscount,
|
||||
@@ -403,6 +411,9 @@ class $AssetsVecGen {
|
||||
/// File path: assets/vec/calendar_search.svg.vec
|
||||
SvgGenImage get calendarSearchSvg => const SvgGenImage.vec('assets/vec/calendar_search.svg.vec');
|
||||
|
||||
/// File path: assets/vec/calendar_search_outline.svg.vec
|
||||
SvgGenImage get calendarSearchOutlineSvg => const SvgGenImage.vec('assets/vec/calendar_search_outline.svg.vec');
|
||||
|
||||
/// File path: assets/vec/call.svg.vec
|
||||
SvgGenImage get callSvg => const SvgGenImage.vec('assets/vec/call.svg.vec');
|
||||
|
||||
@@ -535,6 +546,9 @@ class $AssetsVecGen {
|
||||
/// File path: assets/vec/profile2.svg.vec
|
||||
SvgGenImage get profile2Svg => const SvgGenImage.vec('assets/vec/profile2.svg.vec');
|
||||
|
||||
/// File path: assets/vec/profile2_outline.svg.vec
|
||||
SvgGenImage get profile2OutlineSvg => const SvgGenImage.vec('assets/vec/profile2_outline.svg.vec');
|
||||
|
||||
/// File path: assets/vec/profile_circle.svg.vec
|
||||
SvgGenImage get profileCircleSvg => const SvgGenImage.vec('assets/vec/profile_circle.svg.vec');
|
||||
|
||||
@@ -618,6 +632,7 @@ class $AssetsVecGen {
|
||||
buySvg,
|
||||
calendarSvg,
|
||||
calendarSearchSvg,
|
||||
calendarSearchOutlineSvg,
|
||||
callSvg,
|
||||
checkSvg,
|
||||
checkSquareSvg,
|
||||
@@ -662,6 +677,7 @@ class $AssetsVecGen {
|
||||
pictureFrameSvg,
|
||||
placeHolderSvg,
|
||||
profile2Svg,
|
||||
profile2OutlineSvg,
|
||||
profileCircleSvg,
|
||||
profileUserSvg,
|
||||
receiptDiscountSvg,
|
||||
|
||||
@@ -40,6 +40,7 @@ class _ROutlinedElevatedIconState extends State<ROutlinedElevatedIcon> {
|
||||
Widget build(BuildContext context) {
|
||||
return OutlinedButton.icon(
|
||||
icon: widget.icon,
|
||||
|
||||
label: Text(widget.text),
|
||||
onPressed: widget.onPressed,
|
||||
style: ButtonStyle(
|
||||
|
||||
127
packages/core/lib/presentation/widget/list_item/list_item.dart
Normal file
127
packages/core/lib/presentation/widget/list_item/list_item.dart
Normal file
@@ -0,0 +1,127 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ListItem extends StatelessWidget {
|
||||
const ListItem({
|
||||
super.key,
|
||||
required this.index,
|
||||
required this.child,
|
||||
required this.secondChild,
|
||||
required this.labelColor,
|
||||
required this.labelIcon,
|
||||
required this.onTap,
|
||||
required this.selected,
|
||||
this.labelIconColor = AppColor.mediumGreyDarkHover,
|
||||
});
|
||||
|
||||
final int index;
|
||||
final Widget child;
|
||||
final Widget secondChild;
|
||||
final Color labelColor;
|
||||
final String labelIcon;
|
||||
final Color? labelIconColor;
|
||||
final VoidCallback onTap;
|
||||
final bool selected;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
|
||||
decoration: BoxDecoration(
|
||||
color: labelColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.lightGreyNormalHover),
|
||||
),
|
||||
child: AnimatedSize(
|
||||
duration: Duration(milliseconds: 400),
|
||||
alignment: Alignment.center,
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.centerRight,
|
||||
children: [
|
||||
AnimatedSize(
|
||||
duration: Duration(milliseconds: 300),
|
||||
child: Container(
|
||||
width: Get.width - 30,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: AnimatedCrossFade(
|
||||
alignment: Alignment.center,
|
||||
firstChild: Container(
|
||||
height: 75,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.zero,
|
||||
bottomRight: Radius.circular(8),
|
||||
topLeft: Radius.zero,
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: child,
|
||||
),
|
||||
secondChild: Container(
|
||||
padding: EdgeInsets.fromLTRB(8, 12, 14, 12),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: secondChild,
|
||||
),
|
||||
crossFadeState: selected
|
||||
? CrossFadeState.showSecond
|
||||
: CrossFadeState.showFirst,
|
||||
duration: Duration(milliseconds: 300),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: SvgGenImage.vec(labelIcon).svg(
|
||||
width: 16.w,
|
||||
height: 16.h,
|
||||
colorFilter: ColorFilter.mode(labelColor, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
right: -12,
|
||||
child: Container(
|
||||
width: index < 999 ? 24 : null,
|
||||
height: index < 999 ? 24 : null,
|
||||
padding: EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.greenLightHover,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(width: 0.50, color: AppColor.greenDarkActive),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
(index + 1).toString(),
|
||||
style: AppFonts.yekan12.copyWith(color: Colors.black),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
117
packages/core/lib/presentation/widget/list_item/list_item2.dart
Normal file
117
packages/core/lib/presentation/widget/list_item/list_item2.dart
Normal file
@@ -0,0 +1,117 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ListItem2 extends StatelessWidget {
|
||||
const ListItem2({
|
||||
super.key,
|
||||
required this.index,
|
||||
required this.child,
|
||||
required this.secondChild,
|
||||
required this.labelColor,
|
||||
required this.labelIcon,
|
||||
required this.onTap,
|
||||
required this.selected,
|
||||
this.labelIconColor = AppColor.mediumGreyDarkHover,
|
||||
});
|
||||
|
||||
final int index;
|
||||
final Widget child;
|
||||
final Widget secondChild;
|
||||
final Color labelColor;
|
||||
final String labelIcon;
|
||||
final Color? labelIconColor;
|
||||
final VoidCallback onTap;
|
||||
final bool selected;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
|
||||
decoration: BoxDecoration(
|
||||
color: labelColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.lightGreyNormalHover),
|
||||
),
|
||||
child: AnimatedSize(
|
||||
duration: Duration(milliseconds: 400),
|
||||
alignment: Alignment.center,
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.centerRight,
|
||||
children: [
|
||||
AnimatedCrossFade(
|
||||
firstChild: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 75,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.zero,
|
||||
bottomRight: Radius.circular(8),
|
||||
topLeft: Radius.zero,
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: SvgGenImage.vec(labelIcon).svg(
|
||||
width: 16.w,
|
||||
height: 16.h,
|
||||
//TODO
|
||||
colorFilter: ColorFilter.mode(
|
||||
labelIconColor ?? AppColor.mediumGreyDarkActive,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
secondChild: Container(
|
||||
padding: EdgeInsets.fromLTRB(8, 8, 12, 12),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: secondChild,
|
||||
),
|
||||
crossFadeState: selected ? CrossFadeState.showSecond : CrossFadeState.showFirst,
|
||||
duration: Duration(milliseconds: 300),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
right: -12,
|
||||
child: Container(
|
||||
width: index < 999 ? 24 : null,
|
||||
height: index < 999 ? 24 : null,
|
||||
padding: EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.greenLightHover,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(width: 0.50, color: AppColor.greenDarkActive),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
(index + 1).toString(),
|
||||
style: AppFonts.yekan12.copyWith(color: Colors.black),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ListItemWithOutCounter extends StatelessWidget {
|
||||
const ListItemWithOutCounter({
|
||||
super.key,
|
||||
required this.child,
|
||||
required this.secondChild,
|
||||
required this.labelColor,
|
||||
required this.labelIcon,
|
||||
required this.onTap,
|
||||
required this.selected,
|
||||
this.labelIconColor = AppColor.mediumGreyDarkHover,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
final Widget secondChild;
|
||||
final Color labelColor;
|
||||
final String labelIcon;
|
||||
final Color? labelIconColor;
|
||||
final VoidCallback onTap;
|
||||
final bool selected;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
|
||||
decoration: BoxDecoration(
|
||||
color: labelColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.lightGreyNormalHover),
|
||||
),
|
||||
child: AnimatedSize(
|
||||
duration: Duration(milliseconds: 400),
|
||||
alignment: Alignment.center,
|
||||
child: AnimatedSize(
|
||||
duration: Duration(milliseconds: 300),
|
||||
child: Container(
|
||||
width: Get.width - 30,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: AnimatedCrossFade(
|
||||
alignment: Alignment.center,
|
||||
firstChild: Container(
|
||||
height: 75,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.zero,
|
||||
bottomRight: Radius.circular(8),
|
||||
topLeft: Radius.zero,
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: child,
|
||||
),
|
||||
secondChild: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: secondChild,
|
||||
),
|
||||
crossFadeState: selected
|
||||
? CrossFadeState.showSecond
|
||||
: CrossFadeState.showFirst,
|
||||
duration: Duration(milliseconds: 300),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: selected==false,
|
||||
child: Container(
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: SvgGenImage.vec(labelIcon).svg(
|
||||
width: 16.w,
|
||||
height: 16.h,
|
||||
colorFilter: ColorFilter.mode(labelColor, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,17 @@ class _OverlayDropdownState<T> extends State<OverlayDropdownWidget<T>> {
|
||||
selectedItem = widget.selectedItem ?? widget.initialValue;
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant OverlayDropdownWidget<T> oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (widget.selectedItem != oldWidget.selectedItem) {
|
||||
setState(() {
|
||||
selectedItem = widget.selectedItem;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void _showOverlay() {
|
||||
final renderBox = _key.currentContext!.findRenderObject() as RenderBox;
|
||||
final size = renderBox.size;
|
||||
|
||||
@@ -24,3 +24,8 @@ export 'vec_widget.dart';
|
||||
export 'list_row_item.dart';
|
||||
//inputs
|
||||
export 'inputs/inputs.dart';
|
||||
//list_item
|
||||
export 'list_item/list_item.dart';
|
||||
export 'list_item/list_item2.dart';
|
||||
export 'list_item/list_item_with_out_number.dart';
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
library;
|
||||
|
||||
export 'presentation/filter/logic.dart';
|
||||
export 'presentation/filter/view.dart';
|
||||
export 'presentation/routes/app_pages.dart';
|
||||
export 'presentation/pages/pages.dart';
|
||||
export 'presentation/routes/app_routes.dart';
|
||||
|
||||
export 'presentation/routes/app_pages.dart';
|
||||
|
||||
@@ -1,726 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class ActionPage extends GetView<ActionLogic> {
|
||||
const ActionPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColor.bgLight,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 20),
|
||||
ObxValue((data) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: List.generate(4, (index) {
|
||||
return headerWidget(
|
||||
icon: controller.headersIcons[index],
|
||||
title: controller.headersTitle[index],
|
||||
onTap: () {
|
||||
controller.updateSelectedIndex(index);
|
||||
},
|
||||
isSelected: controller.selectedIndex.value == index,
|
||||
);
|
||||
}),
|
||||
);
|
||||
}, controller.selectedIndex),
|
||||
Expanded(
|
||||
child: ObxValue((index) {
|
||||
if (index.value == 3) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: Text(
|
||||
'از سامانه خارج می شوید؟',
|
||||
style: AppFonts.yekan18.copyWith(
|
||||
color: AppColor.lightGreyDarkActive,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Expanded(
|
||||
child: RElevated(
|
||||
text: 'بله',
|
||||
onPressed: () {
|
||||
exit(0);
|
||||
},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: ROutlinedElevated(
|
||||
text: 'خیر',
|
||||
onPressed: () {
|
||||
controller.updateSelectedIndex(
|
||||
controller.previousIndex.value,
|
||||
);
|
||||
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
return switch (index.value) {
|
||||
0 => profileWidget(),
|
||||
1 => supervisionHistoryWidget(),
|
||||
2 => statisticsWidget(),
|
||||
|
||||
int() => Container(),
|
||||
};
|
||||
}, controller.selectedIndex),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Container statisticsWidget() => Container(
|
||||
margin: EdgeInsets.only(top: 50),
|
||||
padding: EdgeInsets.symmetric(vertical: 50),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(30),
|
||||
topRight: Radius.circular(30),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 32,
|
||||
margin: EdgeInsets.symmetric(horizontal: 22, vertical: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 10,
|
||||
children: [
|
||||
Expanded(
|
||||
child: ROutlinedElevatedIcon(
|
||||
icon: FaIcon(FontAwesomeIcons.calendar),
|
||||
onPressed: () {},
|
||||
text: 'از تاریخ',
|
||||
textStyle: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: ROutlinedElevatedIcon(
|
||||
icon: FaIcon(FontAwesomeIcons.calendar),
|
||||
onPressed: () {},
|
||||
text: 'تا تاریخ',
|
||||
textStyle: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
optionWidget(
|
||||
selected: controller.filter1Index,
|
||||
title: 'فیلترتراکنش ها',
|
||||
options: controller.tmpLs,
|
||||
),
|
||||
optionWidget(
|
||||
selected: controller.filter2Index,
|
||||
title: 'فیلتر شهرستان',
|
||||
options: controller.hamadanCities,
|
||||
),
|
||||
|
||||
SizedBox(height: 10),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
vecWidgetWithOnTap(
|
||||
child: Assets.vec.pdfDownloadSvg.svg(),
|
||||
onTap: () {},
|
||||
width: 64,
|
||||
height: 64,
|
||||
),
|
||||
vecWidgetWithOnTap(
|
||||
child: Assets.vec.excelDownloadSvg.svg(),
|
||||
onTap: () {},
|
||||
width: 64,
|
||||
height: 64,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 20,
|
||||
children: [
|
||||
headerInfo(title: 'تعداد تراکنش ها', description: '183 '),
|
||||
headerInfo(
|
||||
title: 'جمع تراکنش ها',
|
||||
description: '183 ریال',
|
||||
background: AppColor.green1Light,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Widget supervisionHistoryWidget() {
|
||||
return ObxValue((data) {
|
||||
return ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
return historyItem(data[index], () {
|
||||
data[index] = !data[index];
|
||||
});
|
||||
},
|
||||
shrinkWrap: true,
|
||||
physics: BouncingScrollPhysics(),
|
||||
itemCount: data.length,
|
||||
);
|
||||
}, controller.supervisionHistoryList);
|
||||
}
|
||||
|
||||
Column profileWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
slidableWidgetOne(),
|
||||
slidableWidgetOne(),
|
||||
slidableWidgetOne(),
|
||||
slidableWidgetOne(),
|
||||
slidableWidgetOne(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget headerWidget({
|
||||
required Widget icon,
|
||||
required String title,
|
||||
required VoidCallback onTap,
|
||||
bool isSelected = false,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: ShapeDecoration(
|
||||
color: isSelected ? AppColor.blueLightActive : AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: icon,
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color:
|
||||
isSelected ? AppColor.blueNormalActive : AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget slidableWidgetOne() {
|
||||
if (controller.showSlideHint) {
|
||||
controller.triggerSlidableAnimation();
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
|
||||
child: Slidable(
|
||||
key: Key('selectedLocationWidget'),
|
||||
controller: controller.slidController.value,
|
||||
endActionPane: ActionPane(
|
||||
motion: StretchMotion(),
|
||||
children: [
|
||||
CustomSlidableAction(
|
||||
onPressed: (context) {},
|
||||
backgroundColor: AppColor.redNormal,
|
||||
foregroundColor: Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
autoClose: true,
|
||||
child: Assets.vec.trashSvg.svg(
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: GestureDetector(
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
height: 62,
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.blackLightHover),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'داود خرم مهری پور',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'03295224154',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'افزودن کاربر',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'ثبت بازرسی',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'همدان',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'همدان',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget slidableWidgetTwo({required VoidCallback onTap}) {
|
||||
return Slidable(
|
||||
key: Key('selectedLocationWidget'),
|
||||
controller: controller.slidController.value,
|
||||
endActionPane: ActionPane(
|
||||
motion: StretchMotion(),
|
||||
children: [
|
||||
CustomSlidableAction(
|
||||
onPressed: (context) {},
|
||||
backgroundColor: AppColor.blueNormal,
|
||||
foregroundColor: Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(8),
|
||||
bottomRight: Radius.circular(8),
|
||||
),
|
||||
autoClose: true,
|
||||
child: Assets.vec.trashSvg.svg(
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
),
|
||||
CustomSlidableAction(
|
||||
onPressed: (context) {},
|
||||
backgroundColor: AppColor.redNormal,
|
||||
foregroundColor: Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(8),
|
||||
bottomLeft: Radius.circular(8),
|
||||
),
|
||||
autoClose: true,
|
||||
child: Assets.vec.trashSvg.svg(
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
height: 62,
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.blackLightHover),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'داود خرم مهری پور',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'03295224154',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'افزودن کاربر',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'ثبت بازرسی',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'همدان',
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'همدان',
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget historyItem(bool isExpanded, VoidCallback onTap) {
|
||||
return AnimatedContainer(
|
||||
margin: EdgeInsets.symmetric(horizontal: 30, vertical: 10),
|
||||
curve: Curves.easeInOut,
|
||||
duration: Duration(seconds: 1),
|
||||
height: isExpanded ? 364 : 62,
|
||||
child:
|
||||
isExpanded
|
||||
? markerDetailsWidget(ontap: onTap)
|
||||
: slidableWidgetTwo(onTap: onTap),
|
||||
);
|
||||
}
|
||||
|
||||
Widget markerDetailsWidget({required VoidCallback ontap}) {
|
||||
return GestureDetector(
|
||||
onTap: ontap,
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 15,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
spacing: 12,
|
||||
children: [
|
||||
vecWidgetWithOnTap(
|
||||
child: Assets.vec.editSvg.svg(),
|
||||
onTap: () {},
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
Text(
|
||||
'سوابق بازرسی من',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
vecWidgetWithOnTap(
|
||||
child: Assets.vec.trashSvg.svg(),
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.redNormal,
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'تاریخ بازرسی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'1403/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'شماره همراه',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0326598653',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'آخرین فعالیت',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
|
||||
Text(
|
||||
'1409/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'موجودی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'5کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
...List.generate(
|
||||
5,
|
||||
(index) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'فروش رفته',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Column optionWidget({
|
||||
required RxInt selected,
|
||||
required String title,
|
||||
required List<String> options,
|
||||
}) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 22, vertical: 10),
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
child: Wrap(
|
||||
runSpacing: 8,
|
||||
spacing: 8,
|
||||
children:
|
||||
options
|
||||
.map(
|
||||
(e) => ObxValue((data) {
|
||||
return ChoiceChip(
|
||||
onSelected: (value) {
|
||||
selected.value = options.indexOf(e);
|
||||
},
|
||||
selectedColor: AppColor.blueNormal,
|
||||
labelStyle:
|
||||
data.value == options.indexOf(e)
|
||||
? AppFonts.yekan13.copyWith(
|
||||
color: AppColor.whiteLight,
|
||||
)
|
||||
: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.darkGreyNormalActive,
|
||||
),
|
||||
checkmarkColor: Colors.white,
|
||||
label: Text(e),
|
||||
selected: options.indexOf(e) == data.value,
|
||||
);
|
||||
}, selected),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Container headerInfo({
|
||||
required String title,
|
||||
required String description,
|
||||
Color? background,
|
||||
}) {
|
||||
return Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
decoration: ShapeDecoration(
|
||||
color: background ?? AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blackLightHover),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
alignment: AlignmentDirectional.center,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 10,
|
||||
children: [
|
||||
Text(title, style: AppFonts.yekan10),
|
||||
|
||||
Text(description, style: AppFonts.yekan12),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -10,16 +10,14 @@ class ActionLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
|
||||
List<String> headersTitle = [
|
||||
'کاربران',
|
||||
'سوابق بازرسی من',
|
||||
'سوابق',
|
||||
'آمار',
|
||||
'خروج از سامانه',
|
||||
];
|
||||
|
||||
List<Widget> headersIcons = [
|
||||
Assets.vec.profileUserSvg.svg(),
|
||||
Assets.vec.calendarSearchSvg.svg(),
|
||||
Assets.vec.diagramSvg.svg(),
|
||||
Assets.vec.logoutSvg.svg(),
|
||||
List<String> headersIcons = [
|
||||
Assets.vec.profileUserSvg.path,
|
||||
Assets.vec.calendarSearchSvg.path,
|
||||
Assets.vec.diagramSvg.path,
|
||||
];
|
||||
|
||||
RxList<bool> supervisionHistoryList = [false, false, false, false].obs;
|
||||
443
packages/inspection/lib/presentation/pages/action/view.dart
Normal file
443
packages/inspection/lib/presentation/pages/action/view.dart
Normal file
@@ -0,0 +1,443 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_inspection/presentation/pages/records/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/pages/statistics/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/pages/users/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/widget/base_page/view.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class ActionPage extends GetView<ActionLogic> {
|
||||
const ActionPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BasePage(
|
||||
hasBack: false,
|
||||
hasFilter: true,
|
||||
hasSearch: true,
|
||||
widgets: [
|
||||
SizedBox(height: 20),
|
||||
ObxValue((data) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: List.generate(controller.headersIcons.length, (index) {
|
||||
return headerWidget(
|
||||
iconPath: controller.headersIcons[index],
|
||||
title: controller.headersTitle[index],
|
||||
onTap: () {
|
||||
controller.updateSelectedIndex(index);
|
||||
},
|
||||
isSelected: controller.selectedIndex.value == index,
|
||||
);
|
||||
}),
|
||||
);
|
||||
}, controller.selectedIndex),
|
||||
Expanded(
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
child: ObxValue((index) {
|
||||
return switch (index.value) {
|
||||
0 => UsersPage(),
|
||||
1 => RecordsPage(),
|
||||
2 => StatisticsPage(),
|
||||
int() => throw UnimplementedError(),
|
||||
};
|
||||
}, controller.selectedIndex),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Widget supervisionHistoryWidget() {
|
||||
return ObxValue((data) {
|
||||
return ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
return historyItem(data[index], () {
|
||||
data[index] = !data[index];
|
||||
});
|
||||
},
|
||||
shrinkWrap: true,
|
||||
physics: BouncingScrollPhysics(),
|
||||
itemCount: data.length,
|
||||
);
|
||||
}, controller.supervisionHistoryList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Widget headerWidget({
|
||||
required String iconPath,
|
||||
required String title,
|
||||
required VoidCallback onTap,
|
||||
bool isSelected = false,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: 93.w,
|
||||
height: 104.h,
|
||||
margin: EdgeInsets.symmetric(horizontal: 8.w),
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 8.h),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? Colors.white : Colors.transparent,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 8,
|
||||
children: [
|
||||
Container(
|
||||
width: 48.w,
|
||||
height: 48.h,
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: ShapeDecoration(
|
||||
color: isSelected ? AppColor.blueLightActive : Colors.transparent,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: SvgGenImage.vec(iconPath).svg(
|
||||
width: 24.w,
|
||||
height: 24.h,
|
||||
colorFilter: ColorFilter.mode(
|
||||
isSelected ? AppColor.blueNormalActive : AppColor.blueNormal,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Text(
|
||||
title,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
|
||||
color: isSelected ? AppColor.blueNormalActive : AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Widget slidableWidgetTwo({required VoidCallback onTap}) {
|
||||
return Slidable(
|
||||
key: Key('selectedLocationWidget'),
|
||||
controller: controller.slidController.value,
|
||||
endActionPane: ActionPane(
|
||||
motion: StretchMotion(),
|
||||
children: [
|
||||
CustomSlidableAction(
|
||||
onPressed: (context) {},
|
||||
backgroundColor: AppColor.blueNormal,
|
||||
foregroundColor: Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(8),
|
||||
bottomRight: Radius.circular(8),
|
||||
),
|
||||
autoClose: true,
|
||||
child: Assets.vec.trashSvg.svg(width: 24, height: 24),
|
||||
),
|
||||
CustomSlidableAction(
|
||||
onPressed: (context) {},
|
||||
backgroundColor: AppColor.redNormal,
|
||||
foregroundColor: Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(8),
|
||||
bottomLeft: Radius.circular(8),
|
||||
),
|
||||
autoClose: true,
|
||||
child: Assets.vec.trashSvg.svg(width: 24, height: 24),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
height: 62,
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.blackLightHover),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'داود خرم مهری پور',
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
'03295224154',
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'افزودن کاربر',
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
'ثبت بازرسی',
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text('همدان', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
||||
Text(
|
||||
'همدان',
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget historyItem(bool isExpanded, VoidCallback onTap) {
|
||||
return AnimatedContainer(
|
||||
margin: EdgeInsets.symmetric(horizontal: 30, vertical: 10),
|
||||
curve: Curves.easeInOut,
|
||||
duration: Duration(seconds: 1),
|
||||
height: isExpanded ? 364 : 62,
|
||||
child: isExpanded ? markerDetailsWidget(ontap: onTap) : slidableWidgetTwo(onTap: onTap),
|
||||
);
|
||||
}
|
||||
|
||||
Widget markerDetailsWidget({required VoidCallback ontap}) {
|
||||
return GestureDetector(
|
||||
onTap: ontap,
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 15,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
spacing: 12,
|
||||
children: [
|
||||
vecWidgetWithOnTap(
|
||||
child: Assets.vec.editSvg.svg(),
|
||||
onTap: () {},
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
Text(
|
||||
'سوابق بازرسی من',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
vecWidgetWithOnTap(
|
||||
child: Assets.vec.trashSvg.svg(),
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.redNormal,
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'تاریخ بازرسی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Text(
|
||||
'1403/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'شماره همراه',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Text(
|
||||
'0326598653',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'آخرین فعالیت',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
|
||||
Text(
|
||||
'1409/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'موجودی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Text(
|
||||
'5کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
...List.generate(
|
||||
5,
|
||||
(index) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'فروش رفته',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Column optionWidget({
|
||||
required RxInt selected,
|
||||
required String title,
|
||||
required List<String> options,
|
||||
}) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 22, vertical: 10),
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
child: Wrap(
|
||||
runSpacing: 8,
|
||||
spacing: 8,
|
||||
children: options
|
||||
.map(
|
||||
(e) => ObxValue((data) {
|
||||
return ChoiceChip(
|
||||
onSelected: (value) {
|
||||
selected.value = options.indexOf(e);
|
||||
},
|
||||
selectedColor: AppColor.blueNormal,
|
||||
labelStyle: data.value == options.indexOf(e)
|
||||
? AppFonts.yekan13.copyWith(color: AppColor.whiteLight)
|
||||
: AppFonts.yekan12.copyWith(color: AppColor.darkGreyNormalActive),
|
||||
checkmarkColor: Colors.white,
|
||||
label: Text(e),
|
||||
selected: options.indexOf(e) == data.value,
|
||||
);
|
||||
}, selected),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Container headerInfo({required String title, required String description, Color? background}) {
|
||||
return Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
decoration: ShapeDecoration(
|
||||
color: background ?? AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blackLightHover),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
alignment: AlignmentDirectional.center,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 10,
|
||||
children: [
|
||||
Text(title, style: AppFonts.yekan10),
|
||||
|
||||
Text(description, style: AppFonts.yekan12),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_inspection/data/utils/marker_generator.dart';
|
||||
import 'package:rasadyar_inspection/presentation/filter/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/pages/filter/view.dart';
|
||||
|
||||
|
||||
class InspectorFilterLogic extends GetxController
|
||||
with GetTickerProviderStateMixin {
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
|
||||
import 'package:rasadyar_inspection/presentation/routes/app_routes.dart';
|
||||
import 'package:rasadyar_inspection/presentation/widget/custom_chips.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
@@ -440,31 +441,6 @@ Widget markerDetailsWidget() {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget customChip({bool isSelected = false, required String title, required int index, required Function(int) onTap}) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onTap.call(index);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? AppColor.blueNormal : AppColor.whiteGreyNormal,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: isSelected
|
||||
? Border.fromBorderSide(BorderSide.none)
|
||||
: Border.all(width: 0.25, color: const Color(0xFFB0B0B0)),
|
||||
),
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: isSelected ? AppFonts.yekan10.copyWith(color: AppColor.whiteLight) : AppFonts.yekan10,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget selectedLocationWidget({
|
||||
required bool showHint,
|
||||
required SlidableController sliderController,
|
||||
@@ -1,8 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_inspection/presentation/pages/filter/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/routes/app_routes.dart';
|
||||
import 'package:rasadyar_inspection/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/widget/list_item/list_item.dart';
|
||||
import 'package:rasadyar_inspection/presentation/widget/custom_chips.dart';
|
||||
import 'package:rasadyar_inspection/presentation/widget/search.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
@@ -118,35 +119,6 @@ class InspectionMapPage extends GetView<InspectionMapLogic> {
|
||||
return BaseBottomSheet(
|
||||
height: data.value ? 450.h : 150.h,
|
||||
child: ListItemWithOutCounter(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'داود خرم مهری پور',
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
'گوشت و مرغ',
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Assets.vec.scanBarcodeSvg.svg(),
|
||||
],
|
||||
),
|
||||
secondChild: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
@@ -256,13 +228,7 @@ class InspectionMapPage extends GetView<InspectionMapLogic> {
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
onPressed: () {
|
||||
buildDeleteDialog(
|
||||
onConfirm: () async {
|
||||
// controller.denyAllocation(item.key ?? '');
|
||||
//await controller.deleteAllocation(item);
|
||||
},
|
||||
onRefresh: () async {},
|
||||
);
|
||||
buildDeleteDialog(onConfirm: () async {}, onRefresh: () async {});
|
||||
},
|
||||
borderColor: AppColor.bgIcon,
|
||||
child: Row(
|
||||
@@ -293,6 +259,35 @@ class InspectionMapPage extends GetView<InspectionMapLogic> {
|
||||
labelIconColor: AppColor.bgIcon,
|
||||
onTap: () => data.value = !data.value,
|
||||
selected: data.value,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'داود خرم مهری پور',
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
'گوشت و مرغ',
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Assets.vec.scanBarcodeSvg.svg(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}, controller.isSelectedDetailsLocation);
|
||||
@@ -428,6 +423,7 @@ Widget filterWidget({required RxInt filterIndex, required RxInt showIndex}) {
|
||||
},
|
||||
index: 1,
|
||||
),
|
||||
|
||||
customChip(
|
||||
isSelected: data.value == 2,
|
||||
title: 'بازرسی شده ها',
|
||||
@@ -524,225 +520,6 @@ Widget cardWithLabel({
|
||||
);
|
||||
}
|
||||
|
||||
Widget markerDetailsWidget() {
|
||||
return Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
margin: EdgeInsets.all(35),
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 15,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
spacing: 12,
|
||||
children: [
|
||||
Text(
|
||||
'داود خرم پور',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Spacer(),
|
||||
vecWidgetWithOnTap(
|
||||
child: Assets.vec.mapSvg.svg(),
|
||||
onTap: () {
|
||||
Get.toNamed(InspectionRoutes.inspectionLocationDetails);
|
||||
},
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
vecWidgetWithOnTap(
|
||||
child: Assets.vec.messageAddSvg.svg(),
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.greenNormal,
|
||||
onTap: () {
|
||||
Get.toNamed(InspectionRoutes.inspectionAddSupervision);
|
||||
},
|
||||
),
|
||||
|
||||
vecWidgetWithOnTap(
|
||||
child: Assets.vec.securityTimeSvg.svg(),
|
||||
color: AppColor.warning,
|
||||
height: 24,
|
||||
width: 24,
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'باقی مانده',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'شماره همراه',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Text(
|
||||
'0326598653',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'آخرین فعالیت',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
|
||||
Text(
|
||||
'1409/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'موجودی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Text(
|
||||
'5کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
...List.generate(
|
||||
5,
|
||||
(index) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'فروش رفته',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget customChip({
|
||||
bool isSelected = false,
|
||||
required String title,
|
||||
required int index,
|
||||
required Function(int) onTap,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onTap.call(index);
|
||||
},
|
||||
child: Container(
|
||||
height: 32.h,
|
||||
padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 8.h),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.whiteGreyNormal,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: isSelected ? AppColor.blueNormal : AppColor.blackLightActive,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
height: 12.h,
|
||||
child: Transform.scale(
|
||||
scale: 0.70,
|
||||
child: Checkbox(
|
||||
value: isSelected,
|
||||
side: BorderSide(color: AppColor.whiteDarkHover, width: 1),
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity.compact,
|
||||
overlayColor: WidgetStateProperty.all<Color>(AppColor.blueNormal),
|
||||
fillColor: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return AppColor.blueNormal;
|
||||
} else {
|
||||
return AppColor.whiteGreyNormal;
|
||||
}
|
||||
}),
|
||||
|
||||
onChanged: (value) {
|
||||
onTap.call(index);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8.w),
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: isSelected ? AppColor.blueNormal : AppColor.whiteDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget selectedLocationWidget({
|
||||
required bool showHint,
|
||||
22
packages/inspection/lib/presentation/pages/pages.dart
Normal file
22
packages/inspection/lib/presentation/pages/pages.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
export 'action/logic.dart';
|
||||
export 'action/view.dart';
|
||||
export 'add_mobile_inspector/logic.dart';
|
||||
export 'add_mobile_inspector/view.dart';
|
||||
export 'add_supervision/logic.dart';
|
||||
export 'add_supervision/view.dart';
|
||||
export 'display_information/logic.dart';
|
||||
export 'display_information/view.dart';
|
||||
export 'inspection_map/logic.dart';
|
||||
export 'inspection_map/view.dart';
|
||||
export 'location_details/logic.dart';
|
||||
export 'location_details/view.dart';
|
||||
export 'profile/logic.dart';
|
||||
export 'profile/view.dart';
|
||||
export 'records/logic.dart';
|
||||
export 'records/view.dart';
|
||||
export 'registration_of_violation/logic.dart';
|
||||
export 'registration_of_violation/view.dart';
|
||||
export 'root/logic.dart';
|
||||
export 'root/view.dart';
|
||||
export 'statistics/logic.dart';
|
||||
export 'statistics/view.dart';
|
||||
@@ -0,0 +1,32 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class RecordsLogic extends GetxController {
|
||||
Rx<Resource<PaginationModel<int>>> countList = Resource<PaginationModel<int>>.success(
|
||||
PaginationModel(results: [1, 2, 3, 4, 5, 6], count: 1, next: null, previous: null),
|
||||
).obs;
|
||||
|
||||
RxBool isLoadingMore = false.obs;
|
||||
RxInt currentPage = 1.obs;
|
||||
RxInt indexExpanded = (-1).obs;
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
void toggleExpandedList(int index) {
|
||||
if (indexExpanded.value == index) {
|
||||
indexExpanded.value = -1;
|
||||
} else {
|
||||
indexExpanded.value = index;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
184
packages/inspection/lib/presentation/pages/records/view.dart
Normal file
184
packages/inspection/lib/presentation/pages/records/view.dart
Normal file
@@ -0,0 +1,184 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class RecordsPage extends GetView<RecordsLogic> {
|
||||
const RecordsPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: ObxValue((data) {
|
||||
return RPaginatedListView(
|
||||
listType: ListType.separated,
|
||||
resource: data.value,
|
||||
hasMore: data.value.data?.next != null,
|
||||
isPaginating: controller.isLoadingMore.value,
|
||||
onRefresh: () async {
|
||||
controller.currentPage.value = 1;
|
||||
//await controller.getAllocatedMade();
|
||||
},
|
||||
onLoadMore: () async {
|
||||
controller.currentPage.value++;
|
||||
iLog(controller.currentPage.value);
|
||||
// await controller.getAllocatedMade(true);
|
||||
},
|
||||
padding: EdgeInsets.fromLTRB(8, 12, 8, 80),
|
||||
itemBuilder: (context, index) {
|
||||
var item = data.value.data!.results![index];
|
||||
return ObxValue((val) {
|
||||
return ListItem2(
|
||||
selected: val.value == index,
|
||||
onTap: () => controller.toggleExpandedList(index),
|
||||
index: index,
|
||||
labelColor: AppColor.blueLight,
|
||||
labelIcon: Assets.vec.calendarSearchOutlineSvg.path,
|
||||
labelIconColor: AppColor.bgIcon,
|
||||
secondChild: itemListExpandedWidget(item, index),
|
||||
child: itemListWidget(item),
|
||||
);
|
||||
}, controller.indexExpanded);
|
||||
},
|
||||
itemCount: data.value.data?.results?.length ?? 0,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||
);
|
||||
}, controller.countList),
|
||||
floatingActionButton: RFab.add(onPressed: () {}),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
|
||||
);
|
||||
}
|
||||
|
||||
Widget itemListWidget(int item) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text('داود خرم مهری پور', style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal)),
|
||||
Text(
|
||||
'09302545455',
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
||||
Text('0 کیلوگرم', style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover)),
|
||||
],
|
||||
),
|
||||
Assets.vec.scanBarcodeSvg.svg(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget itemListExpandedWidget(int item, int index) {
|
||||
return Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'داوود خرم پور',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.greenDark),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32.h,
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1.w, color: AppColor.blueLightHover),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
'تاریخ بازرسی',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
|
||||
Text(
|
||||
'1403/12/12',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
buildRow(
|
||||
title: 'تلفن خریدار',
|
||||
value: '0326598653',
|
||||
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
buildRow(title: 'آخرین فعالیت', value: '1409/12/12'),
|
||||
buildRow(title: 'موجودی', value: '5KG'),
|
||||
buildRow(title: 'فروش رفته', value: '5KG'),
|
||||
],
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 16.w,
|
||||
children: [
|
||||
RElevated(
|
||||
text: 'ویرایش',
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
|
||||
onPressed: () {
|
||||
/* controller.setEditData(item);
|
||||
Get.bottomSheet(
|
||||
addOrEditBottomSheet(true),
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
).whenComplete(() {
|
||||
controller.clearForm();
|
||||
});*/
|
||||
},
|
||||
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
|
||||
backgroundColor: AppColor.blueDark,
|
||||
),
|
||||
ROutlinedElevated(
|
||||
text: 'حذف',
|
||||
textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal),
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
onPressed: () {
|
||||
buildDeleteDialog(
|
||||
onConfirm: () async {
|
||||
// controller.isExpandedList.remove(index);
|
||||
// controller.denyAllocation(item.key ?? '');
|
||||
//await controller.deleteAllocation(item);
|
||||
},
|
||||
onRefresh: () async {},
|
||||
);
|
||||
},
|
||||
borderColor: AppColor.redNormal,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_inspection/presentation/routes/app_routes.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
|
||||
import 'package:rasadyar_inspection/presentation/routes/app_routes.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class RegistrationOfViolationPage
|
||||
extends GetView<RegistrationOfViolationLogic> {
|
||||
class RegistrationOfViolationPage extends GetView<RegistrationOfViolationLogic> {
|
||||
const RegistrationOfViolationPage({super.key});
|
||||
|
||||
@override
|
||||
@@ -15,17 +13,12 @@ class RegistrationOfViolationPage
|
||||
backgroundColor: AppColor.bgLight,
|
||||
appBar: RAppBar(
|
||||
title: 'ثبت تخلف',
|
||||
leading: Assets.vec.messageAddSvg.svg(
|
||||
leading: Assets.vec.messageAddSvg.svg(
|
||||
width: 16,
|
||||
height: 16,
|
||||
colorFilter: ColorFilter.mode(
|
||||
Colors.white,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
additionalActions: [
|
||||
RFab.smallAdd(onPressed: () => controller.countViolation.value++),
|
||||
],
|
||||
additionalActions: [RFab.smallAdd(onPressed: () => controller.countViolation.value++)],
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
@@ -34,7 +27,7 @@ class RegistrationOfViolationPage
|
||||
Expanded(
|
||||
child: ObxValue((data) {
|
||||
return ListView.separated(
|
||||
itemBuilder: (context, index) => violationWidget(),
|
||||
itemBuilder: (context, index) => violationWidget22(),
|
||||
separatorBuilder: (context, index) => SizedBox(height: 15),
|
||||
itemCount: data.value,
|
||||
);
|
||||
@@ -61,7 +54,7 @@ class RegistrationOfViolationPage
|
||||
}
|
||||
}
|
||||
|
||||
Container violationWidget() {
|
||||
Container violationWidget22() {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
|
||||
decoration: BoxDecoration(
|
||||
@@ -71,13 +64,13 @@ Container violationWidget() {
|
||||
child: Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
RTextField(
|
||||
RTextField(
|
||||
controller: TextEditingController(),
|
||||
label: 'عنوان تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
),
|
||||
RTextField(
|
||||
RTextField(
|
||||
controller: TextEditingController(),
|
||||
label: 'توضیحات تخلف',
|
||||
filled: true,
|
||||
@@ -85,19 +78,19 @@ Container violationWidget() {
|
||||
maxLines: 3,
|
||||
minLines: 3,
|
||||
),
|
||||
RTextField(
|
||||
RTextField(
|
||||
controller: TextEditingController(),
|
||||
label: 'عنوان تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
),
|
||||
RTextField(
|
||||
RTextField(
|
||||
controller: TextEditingController(),
|
||||
label: 'عنوان تخلف',
|
||||
filled: true,
|
||||
filledColor: AppColor.whiteLight,
|
||||
),
|
||||
RTextField(
|
||||
RTextField(
|
||||
controller: TextEditingController(),
|
||||
label: 'توضیحات تخلف',
|
||||
filled: true,
|
||||
@@ -111,7 +104,9 @@ Container violationWidget() {
|
||||
child: Row(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Expanded(child: RElevated(text: 'ثبت', onPressed: () {})),
|
||||
Expanded(
|
||||
child: RElevated(text: 'ثبت', onPressed: () {}),
|
||||
),
|
||||
Expanded(
|
||||
child: ROutlinedElevated(text: 'انصراف', onPressed: () {}),
|
||||
),
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart' ;
|
||||
import 'package:rasadyar_inspection/presentation/action/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/filter/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/inspection_map/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/profile/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_inspection/presentation/pages/action/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/pages/inspection_map/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/pages/profile/view.dart';
|
||||
|
||||
|
||||
enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
||||
|
||||
@@ -37,19 +37,16 @@ class RootLogic extends GetxController {
|
||||
requestResult != LocationPermission.deniedForever;
|
||||
|
||||
case LocationPermission.deniedForever:
|
||||
|
||||
return request ? await Geolocator.openAppSettings() : false;
|
||||
|
||||
case LocationPermission.always:
|
||||
case LocationPermission.whileInUse:
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
eLog(e);
|
||||
return await Geolocator.openLocationSettings();
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class StatisticsLogic extends GetxController {
|
||||
List<String> transactionFilters = ['همه', 'دارای تراکنش', 'بدون تراکنش'];
|
||||
RxList<int> transactionFiltersSelected = RxList();
|
||||
RxList<String> iranProvinces = [
|
||||
'آذربایجان شرقی',
|
||||
'آذربایجان غربی',
|
||||
'اردبیل',
|
||||
'اصفهان',
|
||||
'البرز',
|
||||
'ایلام',
|
||||
'بوشهر',
|
||||
'تهران',
|
||||
'چهارمحال و بختیاری',
|
||||
'خراسان جنوبی',
|
||||
'خراسان رضوی',
|
||||
'خراسان شمالی',
|
||||
'خوزستان',
|
||||
'زنجان',
|
||||
'سمنان',
|
||||
'سیستان و بلوچستان',
|
||||
'فارس',
|
||||
'قزوین',
|
||||
'قم',
|
||||
'کردستان',
|
||||
'کرمان',
|
||||
'کرمانشاه',
|
||||
'کهگیلویه و بویراحمد',
|
||||
'گلستان',
|
||||
'گیلان',
|
||||
'لرستان',
|
||||
'مازندران',
|
||||
'مرکزی',
|
||||
'هرمزگان',
|
||||
'همدان',
|
||||
'یزد',
|
||||
].obs;
|
||||
RxnString iranProvincesSelected = RxnString();
|
||||
RxInt s1 =2536524448.obs;
|
||||
RxInt s2 =2536524448.obs;
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
void onTransactionFilterSelected(int index) {
|
||||
if (transactionFiltersSelected.contains(index)) {
|
||||
transactionFiltersSelected.remove(index);
|
||||
} else {
|
||||
transactionFiltersSelected.add(index);
|
||||
}
|
||||
update();
|
||||
}
|
||||
}
|
||||
324
packages/inspection/lib/presentation/pages/statistics/view.dart
Normal file
324
packages/inspection/lib/presentation/pages/statistics/view.dart
Normal file
@@ -0,0 +1,324 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_inspection/presentation/widget/custom_chips.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class StatisticsPage extends GetView<StatisticsLogic> {
|
||||
const StatisticsPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 10,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 32.h,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(horizontal: 11.w, vertical: 4.h),
|
||||
child: Row(
|
||||
children: [
|
||||
Assets.vec.calendarSvg.svg(
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
SizedBox(width: 4.w),
|
||||
Text('از', style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal)),
|
||||
SizedBox(width: 22.w),
|
||||
|
||||
Text(
|
||||
'1404/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.lightGreyNormalActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 32.h,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(horizontal: 11.w, vertical: 4.h),
|
||||
child: Row(
|
||||
children: [
|
||||
Assets.vec.calendarSvg.svg(
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
SizedBox(width: 4.w),
|
||||
Text('تا', style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal)),
|
||||
SizedBox(width: 22.w),
|
||||
|
||||
Text(
|
||||
'1404/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.lightGreyNormalActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 16.h),
|
||||
|
||||
Container(
|
||||
height: 80.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.lightGreyNormalHover, width: 1),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 8,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'فیلتر تراکنش ها',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder: (context, index) => ObxValue((selectedIndex) {
|
||||
return customChip(
|
||||
title: controller.transactionFilters[index],
|
||||
isSelected: selectedIndex.contains(index),
|
||||
index: index,
|
||||
onTap: (data) => controller.onTransactionFilterSelected(data),
|
||||
);
|
||||
}, controller.transactionFiltersSelected),
|
||||
separatorBuilder: (context, index) => SizedBox(width: 8),
|
||||
itemCount: controller.transactionFilters.length,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8.h),
|
||||
Container(
|
||||
height: 80.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.lightGreyNormalHover, width: 1),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 8,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'فیلتر شهرستان',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(child: _provinceDropdownWidget()),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8.h),
|
||||
Container(
|
||||
height: 152.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.lightGreyNormalHover, width: 1),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 10, 0, 13),
|
||||
child: Row(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Expanded(
|
||||
child: ObxValue(
|
||||
(data) => _informationLabelCard(
|
||||
title: 'تعداد تراکنش ها',
|
||||
titleColor: AppColor.blueNormal,
|
||||
isLoading: data.value == null,
|
||||
description: 25369654.separatedByComma,
|
||||
iconPath: Assets.vec.cubeSearchSvg.path,
|
||||
iconColor: AppColor.blueNormal,
|
||||
bgDescriptionColor: Colors.white,
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [AppColor.blueLight, Colors.white],
|
||||
),
|
||||
),
|
||||
controller.s1,
|
||||
),
|
||||
),
|
||||
|
||||
Expanded(
|
||||
child: ObxValue((data) {
|
||||
return _informationLabelCard(
|
||||
title: 'جمع تراکنش ها',
|
||||
isLoading: data.value == null,
|
||||
description: data.value.separatedByComma ?? '0',
|
||||
unit: 'ريال',
|
||||
iconPath: Assets.vec.cubeWattingSvg.path,
|
||||
bgDescriptionColor: Colors.white,
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [const Color(0xFFFFE7BB), Colors.white],
|
||||
),
|
||||
);
|
||||
}, controller.s2),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _provinceDropdownWidget() {
|
||||
return ObxValue((data) {
|
||||
return OverlayDropdownWidget<String>(
|
||||
items: data,
|
||||
onChanged: (value) {
|
||||
controller.iranProvincesSelected.value = value;
|
||||
controller.iranProvincesSelected.refresh();
|
||||
},
|
||||
selectedItem: controller.iranProvincesSelected.value,
|
||||
itemBuilder: (item) => Text(
|
||||
item ?? 'بدون نام',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarker),
|
||||
),
|
||||
labelBuilder: (item) =>
|
||||
Text('انتخاب استان', style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight)),
|
||||
);
|
||||
}, controller.iranProvinces);
|
||||
}
|
||||
|
||||
Container _informationLabelCard({
|
||||
required String title,
|
||||
required String description,
|
||||
required String iconPath,
|
||||
required Color bgDescriptionColor,
|
||||
String? unit,
|
||||
bool isLoading = false,
|
||||
Color? iconColor,
|
||||
Color? titleColor,
|
||||
Color? bgLabelColor,
|
||||
LinearGradient? gradient,
|
||||
}) {
|
||||
return Container(
|
||||
height: 82.h,
|
||||
margin: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.lightGreyNormalHover, width: 1),
|
||||
),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Row(
|
||||
children: [
|
||||
// Left side with icon and title
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Container(
|
||||
height: 82.h,
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: gradient == null ? bgLabelColor : null,
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(8),
|
||||
bottomRight: Radius.circular(8),
|
||||
),
|
||||
gradient: gradient,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 4,
|
||||
children: [
|
||||
SvgGenImage.vec(iconPath).svg(
|
||||
width: 24,
|
||||
height: 24,
|
||||
colorFilter: iconColor != null
|
||||
? ColorFilter.mode(iconColor, BlendMode.srcIn)
|
||||
: null,
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: titleColor ?? AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// Right side with description and unit
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: bgDescriptionColor,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(8),
|
||||
bottomLeft: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
child: isLoading
|
||||
? Center(child: CupertinoActivityIndicator())
|
||||
: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
description,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
Visibility(
|
||||
visible: unit != null,
|
||||
child: Text(
|
||||
unit,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
33
packages/inspection/lib/presentation/pages/users/logic.dart
Normal file
33
packages/inspection/lib/presentation/pages/users/logic.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class UsersLogic extends GetxController {
|
||||
Rx<Resource<PaginationModel<int>>> countList = Resource<PaginationModel<int>>.success(
|
||||
PaginationModel(results: [1, 2, 3, 4, 5, 6], count: 1, next: null, previous: null),
|
||||
).obs;
|
||||
|
||||
RxBool isLoadingMore = false.obs;
|
||||
RxInt currentPage = 1.obs;
|
||||
RxInt indexExpanded = (-1).obs;
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void toggleExpandedList(int index) {
|
||||
if (indexExpanded.value == index) {
|
||||
indexExpanded.value = -1;
|
||||
} else {
|
||||
indexExpanded.value = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
190
packages/inspection/lib/presentation/pages/users/view.dart
Normal file
190
packages/inspection/lib/presentation/pages/users/view.dart
Normal file
@@ -0,0 +1,190 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class UsersPage extends GetView<UsersLogic> {
|
||||
const UsersPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: ObxValue((data) {
|
||||
return RPaginatedListView(
|
||||
listType: ListType.separated,
|
||||
resource: data.value,
|
||||
hasMore: data.value.data?.next != null,
|
||||
isPaginating: controller.isLoadingMore.value,
|
||||
onRefresh: () async {
|
||||
controller.currentPage.value = 1;
|
||||
//await controller.getAllocatedMade();
|
||||
},
|
||||
onLoadMore: () async {
|
||||
controller.currentPage.value++;
|
||||
iLog(controller.currentPage.value);
|
||||
// await controller.getAllocatedMade(true);
|
||||
},
|
||||
padding: EdgeInsets.fromLTRB(8, 12, 8, 80),
|
||||
itemBuilder: (context, index) {
|
||||
var item = data.value.data!.results![index];
|
||||
return ObxValue((val) {
|
||||
return ListItem2(
|
||||
selected: val.value == index,
|
||||
onTap: () => controller.toggleExpandedList(index),
|
||||
index: index,
|
||||
labelColor: AppColor.blueLight,
|
||||
labelIcon: Assets.vec.profile2OutlineSvg.path,
|
||||
labelIconColor: AppColor.bgIcon,
|
||||
secondChild: itemListExpandedWidget(item, index),
|
||||
child: itemListWidget(item),
|
||||
);
|
||||
}, controller.indexExpanded);
|
||||
},
|
||||
itemCount: data.value.data?.results?.length ?? 0,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||
);
|
||||
}, controller.countList),
|
||||
floatingActionButton: RFab.add(onPressed: () {}),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
|
||||
);
|
||||
}
|
||||
|
||||
Widget itemListWidget(int item) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
'داود خرم مهری پور',
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
'09302545455',
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
Assets.vec.scanBarcodeSvg.svg(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget itemListExpandedWidget(int item, int index) {
|
||||
return Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'داوود خرم پور',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.greenDark),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32.h,
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1.w, color: AppColor.blueLightHover),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
'تاریخ بازرسی',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
|
||||
Text(
|
||||
'1403/12/12',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
buildRow(
|
||||
title: 'تلفن خریدار',
|
||||
value: '0326598653',
|
||||
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
buildRow(title: 'آخرین فعالیت', value: '1409/12/12'),
|
||||
buildRow(title: 'موجودی', value: '5KG'),
|
||||
buildRow(title: 'فروش رفته', value: '5KG'),
|
||||
],
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:true,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 16.w,
|
||||
children: [
|
||||
RElevated(
|
||||
text: 'ویرایش',
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
|
||||
onPressed: () {
|
||||
/* controller.setEditData(item);
|
||||
Get.bottomSheet(
|
||||
addOrEditBottomSheet(true),
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
).whenComplete(() {
|
||||
controller.clearForm();
|
||||
});*/
|
||||
},
|
||||
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
|
||||
backgroundColor: AppColor.blueDark,
|
||||
),
|
||||
ROutlinedElevated(
|
||||
text: 'حذف',
|
||||
textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal),
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
onPressed: () {
|
||||
buildDeleteDialog(
|
||||
onConfirm: () async {
|
||||
// controller.isExpandedList.remove(index);
|
||||
// controller.denyAllocation(item.key ?? '');
|
||||
//await controller.deleteAllocation(item);
|
||||
},
|
||||
onRefresh: () async{}
|
||||
);
|
||||
},
|
||||
borderColor: AppColor.redNormal,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,7 @@
|
||||
import 'package:rasadyar_auth/auth.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_inspection/presentation/action/logic.dart';
|
||||
import 'package:rasadyar_inspection/presentation/add_mobile_inspector/logic.dart';
|
||||
import 'package:rasadyar_inspection/presentation/add_mobile_inspector/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/add_supervision/logic.dart';
|
||||
import 'package:rasadyar_inspection/presentation/add_supervision/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/display_information/logic.dart';
|
||||
import 'package:rasadyar_inspection/presentation/display_information/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/filter/logic.dart';
|
||||
import 'package:rasadyar_inspection/presentation/inspection_map/logic.dart';
|
||||
import 'package:rasadyar_inspection/presentation/location_details/logic.dart';
|
||||
import 'package:rasadyar_inspection/presentation/location_details/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/profile/logic.dart';
|
||||
import 'package:rasadyar_inspection/presentation/profile/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/registration_of_violation/logic.dart';
|
||||
import 'package:rasadyar_inspection/presentation/registration_of_violation/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/root/logic.dart';
|
||||
import 'package:rasadyar_inspection/presentation/root/view.dart';
|
||||
import 'package:rasadyar_inspection/presentation/pages/filter/logic.dart';
|
||||
import 'package:rasadyar_inspection/presentation/pages/pages.dart';
|
||||
import 'package:rasadyar_inspection/presentation/pages/users/logic.dart';
|
||||
import 'package:rasadyar_inspection/presentation/routes/app_routes.dart';
|
||||
import 'package:rasadyar_inspection/presentation/widget/base_page/logic.dart';
|
||||
|
||||
@@ -29,10 +14,13 @@ sealed class InspectionPages {
|
||||
page: () => RootPage(),
|
||||
|
||||
binding: BindingsBuilder(() {
|
||||
Get.put(RootLogic());
|
||||
Get.put(InspectorFilterLogic());
|
||||
Get.lazyPut(()=>InspectionMapLogic());
|
||||
Get.lazyPut(()=>BaseLogic());
|
||||
Get.lazyPut(() =>RootLogic());
|
||||
Get.lazyPut(() =>InspectorFilterLogic());
|
||||
Get.lazyPut(() => InspectionMapLogic());
|
||||
Get.lazyPut(() => BaseLogic());
|
||||
Get.lazyPut(() => UsersLogic());
|
||||
Get.lazyPut(() => RecordsLogic());
|
||||
Get.lazyPut(() => StatisticsLogic());
|
||||
Get.lazyPut(() => LocationDetailsLogic(), fenix: true);
|
||||
Get.lazyPut(() => ActionLogic(), fenix: true);
|
||||
Get.lazyPut(() => ProfileLogic(), fenix: true);
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
Widget customChip({
|
||||
bool isSelected = false,
|
||||
required String title,
|
||||
required int index,
|
||||
required Function(int) onTap,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onTap.call(index);
|
||||
},
|
||||
child: Container(
|
||||
height: 32.h,
|
||||
padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 8.h),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.whiteGreyNormal,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: isSelected ? AppColor.blueNormal : AppColor.blackLightActive,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
height: 12.h,
|
||||
child: Transform.scale(
|
||||
scale: 0.70,
|
||||
child: Checkbox(
|
||||
value: isSelected,
|
||||
side: BorderSide(color: AppColor.whiteDarkHover, width: 1),
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity.compact,
|
||||
overlayColor: WidgetStateProperty.all<Color>(AppColor.blueNormal),
|
||||
fillColor: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return AppColor.blueNormal;
|
||||
} else {
|
||||
return AppColor.whiteGreyNormal;
|
||||
}
|
||||
}),
|
||||
|
||||
onChanged: (value) {
|
||||
onTap.call(index);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8.w),
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: isSelected ? AppColor.blueNormal : AppColor.whiteDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1,343 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ListItem extends StatelessWidget {
|
||||
const ListItem({
|
||||
super.key,
|
||||
required this.index,
|
||||
required this.child,
|
||||
required this.secondChild,
|
||||
required this.labelColor,
|
||||
required this.labelIcon,
|
||||
required this.onTap,
|
||||
required this.selected,
|
||||
this.labelIconColor = AppColor.mediumGreyDarkHover,
|
||||
});
|
||||
|
||||
final int index;
|
||||
final Widget child;
|
||||
final Widget secondChild;
|
||||
final Color labelColor;
|
||||
final String labelIcon;
|
||||
final Color? labelIconColor;
|
||||
final VoidCallback onTap;
|
||||
final bool selected;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
|
||||
decoration: BoxDecoration(
|
||||
color: labelColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.lightGreyNormalHover),
|
||||
),
|
||||
child: AnimatedSize(
|
||||
duration: Duration(milliseconds: 400),
|
||||
alignment: Alignment.center,
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.centerRight,
|
||||
children: [
|
||||
AnimatedSize(
|
||||
duration: Duration(milliseconds: 300),
|
||||
child: Container(
|
||||
width: Get.width - 30,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: AnimatedCrossFade(
|
||||
alignment: Alignment.center,
|
||||
firstChild: Container(
|
||||
height: 75,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.zero,
|
||||
bottomRight: Radius.circular(8),
|
||||
topLeft: Radius.zero,
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: child,
|
||||
),
|
||||
secondChild: Container(
|
||||
padding: EdgeInsets.fromLTRB(8, 12, 14, 12),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: secondChild,
|
||||
),
|
||||
crossFadeState: selected
|
||||
? CrossFadeState.showSecond
|
||||
: CrossFadeState.showFirst,
|
||||
duration: Duration(milliseconds: 300),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: SvgGenImage.vec(labelIcon).svg(
|
||||
width: 16.w,
|
||||
height: 16.h,
|
||||
colorFilter: ColorFilter.mode(labelColor, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
right: -12,
|
||||
child: Container(
|
||||
width: index < 999 ? 24 : null,
|
||||
height: index < 999 ? 24 : null,
|
||||
padding: EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.greenLightHover,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(width: 0.50, color: AppColor.greenDarkActive),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
(index + 1).toString(),
|
||||
style: AppFonts.yekan12.copyWith(color: Colors.black),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ListItemWithOutCounter extends StatelessWidget {
|
||||
const ListItemWithOutCounter({
|
||||
super.key,
|
||||
required this.child,
|
||||
required this.secondChild,
|
||||
required this.labelColor,
|
||||
required this.labelIcon,
|
||||
required this.onTap,
|
||||
required this.selected,
|
||||
this.labelIconColor = AppColor.mediumGreyDarkHover,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
final Widget secondChild;
|
||||
final Color labelColor;
|
||||
final String labelIcon;
|
||||
final Color? labelIconColor;
|
||||
final VoidCallback onTap;
|
||||
final bool selected;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
|
||||
decoration: BoxDecoration(
|
||||
color: labelColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.lightGreyNormalHover),
|
||||
),
|
||||
child: AnimatedSize(
|
||||
duration: Duration(milliseconds: 400),
|
||||
alignment: Alignment.center,
|
||||
child: AnimatedSize(
|
||||
duration: Duration(milliseconds: 300),
|
||||
child: Container(
|
||||
width: Get.width - 30,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: AnimatedCrossFade(
|
||||
alignment: Alignment.center,
|
||||
firstChild: Container(
|
||||
height: 75,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.zero,
|
||||
bottomRight: Radius.circular(8),
|
||||
topLeft: Radius.zero,
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: child,
|
||||
),
|
||||
secondChild: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: secondChild,
|
||||
),
|
||||
crossFadeState: selected
|
||||
? CrossFadeState.showSecond
|
||||
: CrossFadeState.showFirst,
|
||||
duration: Duration(milliseconds: 300),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: selected==false,
|
||||
child: Container(
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: SvgGenImage.vec(labelIcon).svg(
|
||||
width: 16.w,
|
||||
height: 16.h,
|
||||
colorFilter: ColorFilter.mode(labelColor, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ListItem2 extends StatelessWidget {
|
||||
const ListItem2({
|
||||
super.key,
|
||||
required this.index,
|
||||
required this.child,
|
||||
required this.secondChild,
|
||||
required this.labelColor,
|
||||
required this.labelIcon,
|
||||
required this.onTap,
|
||||
required this.selected,
|
||||
this.labelIconColor = AppColor.mediumGreyDarkHover,
|
||||
});
|
||||
|
||||
final int index;
|
||||
final Widget child;
|
||||
final Widget secondChild;
|
||||
final Color labelColor;
|
||||
final String labelIcon;
|
||||
final Color? labelIconColor;
|
||||
final VoidCallback onTap;
|
||||
final bool selected;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
|
||||
decoration: BoxDecoration(
|
||||
color: labelColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.lightGreyNormalHover),
|
||||
),
|
||||
child: AnimatedSize(
|
||||
duration: Duration(milliseconds: 400),
|
||||
alignment: Alignment.center,
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.centerRight,
|
||||
children: [
|
||||
AnimatedCrossFade(
|
||||
firstChild: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 75,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.zero,
|
||||
bottomRight: Radius.circular(8),
|
||||
topLeft: Radius.zero,
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: SvgGenImage.vec(labelIcon).svg(
|
||||
width: 16.w,
|
||||
height: 16.h,
|
||||
//TODO
|
||||
colorFilter: ColorFilter.mode(
|
||||
labelIconColor ?? AppColor.mediumGreyDarkActive,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
secondChild: Container(
|
||||
padding: EdgeInsets.fromLTRB(8, 8, 12, 12),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: secondChild,
|
||||
),
|
||||
crossFadeState: selected ? CrossFadeState.showSecond : CrossFadeState.showFirst,
|
||||
duration: Duration(milliseconds: 300),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
right: -12,
|
||||
child: Container(
|
||||
width: index < 999 ? 24 : null,
|
||||
height: index < 999 ? 24 : null,
|
||||
padding: EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.greenLightHover,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(width: 0.50, color: AppColor.greenDarkActive),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
(index + 1).toString(),
|
||||
style: AppFonts.yekan12.copyWith(color: Colors.black),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -74,3 +74,7 @@ find "$sourcePath" -type f | xargs -P 10 -I {} bash -c '
|
||||
'
|
||||
|
||||
git add .
|
||||
|
||||
cd ../
|
||||
|
||||
dart run build_runner build --delete-conflicting-outputs
|
||||
|
||||
Reference in New Issue
Block a user