feat : home page chicken-Steward
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/chicken.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||
@@ -10,48 +11,558 @@ class RootPage extends GetView<RootLogic> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: RAppBar(title: 'مدیریت انبار', centerTitle: true, hasBack: false),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
inventoryWidget(),
|
||||
ObxValue(
|
||||
(data) => broadcastInformationWidget(data.value),
|
||||
controller.killHouseDistributionInfo,
|
||||
backgroundColor: AppColor.bgLight,
|
||||
appBar: RAppBar(
|
||||
title: 'رصدطیور',
|
||||
titleTextStyle:AppFonts.yekan16Bold.copyWith(color: Colors.white),
|
||||
centerTitle: true,
|
||||
hasBack: false,
|
||||
leading: Row(children: [Text('مباشر', style: AppFonts.yekan16Bold.copyWith(color: Colors.white))]),
|
||||
),
|
||||
body: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Card(
|
||||
margin: EdgeInsetsGeometry.all(6),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
side: BorderSide(width: 0.50, color: const Color(0xFFA9A9A9)),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
cardWidget(
|
||||
title: 'ورود به انبار',
|
||||
iconPath: Assets.icons.whareHouse.path,
|
||||
onTap: () {
|
||||
Get.toNamed(ChickenRoutes.enteringTheWarehouse);
|
||||
},
|
||||
Row(
|
||||
spacing: 8,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: ShapeDecoration(
|
||||
image: DecorationImage(image: AssetImage(Assets.images.chicken.path), fit: BoxFit.cover),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 0.25, color: const Color(0xFFB0B0B0)),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'مرغ گرم',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkActive),
|
||||
),
|
||||
Spacer(),
|
||||
AnimatedRotation(
|
||||
turns: 180,
|
||||
duration: Duration(milliseconds: 3000),
|
||||
child: Icon(CupertinoIcons.chevron_up, size: 18),
|
||||
),
|
||||
],
|
||||
),
|
||||
cardWidget(
|
||||
title: 'فروش داخل استان',
|
||||
iconPath: Assets.icons.inside.path,
|
||||
onTap: () {
|
||||
Get.toNamed(ChickenRoutes.salesWithinProvince);
|
||||
},
|
||||
SizedBox(height: 8),
|
||||
_todayShipmentWidget(),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 10, 0, 13),
|
||||
child: Row(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Expanded(
|
||||
child: _informationLabelCard(
|
||||
title: 'مانده انبار',
|
||||
description: '2،225،256',
|
||||
iconPath: Assets.vec.cubeSearchSvg.path,
|
||||
iconColor: const Color(0xFF426060),
|
||||
bgDescriptionColor: const Color(0xFFC7DFE0),
|
||||
bgLabelColor: const Color(0xFFA5D1D2),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: _informationLabelCard(
|
||||
title: 'توزیع شده',
|
||||
description: '2،225،256',
|
||||
iconPath: Assets.vec.cubeRotateSvg.path,
|
||||
iconColor: Color(0xFF5C4D64),
|
||||
bgLabelColor: Color(0xFFC8B8D1),
|
||||
bgDescriptionColor: Color(0xFFDAD4DD),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
cardWidget(
|
||||
title: 'فروش خارج استان',
|
||||
iconPath: Assets.icons.outside.path,
|
||||
onTap: () {
|
||||
Get.toNamed(ChickenRoutes.salesWithOutProvince);
|
||||
},
|
||||
|
||||
Row(
|
||||
children: [Text('اطلاعات بارها', textAlign: TextAlign.right, style: AppFonts.yekan16)],
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 13),
|
||||
child: Row(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Expanded(
|
||||
child: _informationLabelCard(
|
||||
title: 'داخل استان',
|
||||
description: '2،225،256',
|
||||
iconPath: Assets.vec.cubeSearchSvg.path,
|
||||
iconColor: const Color(0xFF6C5D60),
|
||||
bgDescriptionColor: const Color(0xFFEDDCE0),
|
||||
bgLabelColor: const Color(0xFFDDC0C7),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: _informationLabelCard(
|
||||
title: 'خارج استان',
|
||||
description: '2،225،256',
|
||||
iconPath: Assets.vec.cubeSearchSvg.path,
|
||||
iconColor: Color(0xFF2D5FFF),
|
||||
bgLabelColor: const Color(0xFFAFCBFF),
|
||||
bgDescriptionColor: const Color(0xFFCEDFFF),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Row(
|
||||
children: [Text('اطلاعات توزیع', textAlign: TextAlign.right, style: AppFonts.yekan16)],
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 13),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 8,
|
||||
children: [
|
||||
Expanded(
|
||||
child: _informationIconCard(
|
||||
title: 'توزیع داخل استان',
|
||||
description: '2،225،256',
|
||||
iconPath: Assets.vec.truckSvg.path,
|
||||
iconColor: const Color.fromRGBO(85, 97, 93, 1),
|
||||
bgDescriptionColor: const Color(0xFFE6FAF5),
|
||||
bgLabelColor: const Color(0xFFB0EFDF),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: _informationIconCard(
|
||||
title: 'توزیع خارج استان',
|
||||
description: '2،225،256',
|
||||
iconPath: Assets.vec.truckFastSvg.path,
|
||||
iconColor: Color(0xFF647379),
|
||||
bgDescriptionColor: const Color(0xFFEAEFFF),
|
||||
bgLabelColor: const Color(0xFFD4DEFF),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: _informationIconCard(
|
||||
title: 'قطعه بندی',
|
||||
description: '2،225،256',
|
||||
iconPath: Assets.vec.convertCubeSvg.path,
|
||||
iconColor: const Color(0xFF6F6164),
|
||||
bgDescriptionColor: const Color(0xFFEDDCE0),
|
||||
bgLabelColor: const Color(0xFFE0BCC5),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsetsGeometry.all(6),
|
||||
child: Row(
|
||||
children: [Text('پر کاربرد ها', textAlign: TextAlign.right, style: AppFonts.yekan16)],
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 70,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
physics: BouncingScrollPhysics(),
|
||||
children: [
|
||||
widelyUsed(
|
||||
title: 'خرید خارج استان',
|
||||
iconPath: Assets.vec.cubeSearchSvg.path,
|
||||
onTap: () {
|
||||
// Get.toNamed(ChickenRoutes.enteringTheWarehouse);
|
||||
},
|
||||
),
|
||||
SizedBox(width: 15),
|
||||
widelyUsed(
|
||||
title: 'عمده فروشی',
|
||||
iconPath: Assets.vec.truckFastSvg.path,
|
||||
onTap: () {
|
||||
//Get.toNamed(ChickenRoutes.salesWithinProvince);
|
||||
},
|
||||
),
|
||||
SizedBox(width: 15),
|
||||
widelyUsed(
|
||||
title: 'ثبت قطعه بندی',
|
||||
iconPath: Assets.vec.convertCubeSvg.path,
|
||||
onTap: () {
|
||||
// Get.toNamed(ChickenRoutes.salesWithOutProvince);
|
||||
},
|
||||
),
|
||||
SizedBox(width: 15),
|
||||
addWidelyUsed(onTap: () {}),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: WaveBottomNavigation(
|
||||
initPage: 2,
|
||||
items: [
|
||||
WaveBottomNavigationItem(
|
||||
title: 'بارها',
|
||||
icon: Assets.vec.truckFastSvg.svg(
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
WaveBottomNavigationItem(
|
||||
title: 'خارج استان',
|
||||
icon: Assets.vec.cubeSearchSvg.svg(
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
WaveBottomNavigationItem(
|
||||
title: 'خانه',
|
||||
icon: Assets.vec.homeSvg.svg(
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
WaveBottomNavigationItem(
|
||||
title: 'قطعه بندی',
|
||||
icon: Assets.vec.convertCubeSvg.svg(
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
WaveBottomNavigationItem(
|
||||
title: 'پروفایل',
|
||||
icon: Assets.vec.userSvg.svg(
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
],
|
||||
onPageChanged: (index) {
|
||||
// controller.changePage(index);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Container _todayShipmentWidget() {
|
||||
return Container(
|
||||
height: 70,
|
||||
width: Get.width / 2,
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [const Color(0xFFEAEFFF), Colors.white],
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 4,
|
||||
children: [
|
||||
Assets.icons.cubeScan.svg(width: 30, height: 30),
|
||||
Text(
|
||||
'بارهای امروز',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
'2،225،256',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
Text(
|
||||
'کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Container _informationLabelCard({
|
||||
required String title,
|
||||
required String description,
|
||||
String unit = 'کیلوگرم',
|
||||
required String iconPath,
|
||||
required Color iconColor,
|
||||
required Color bgDescriptionColor,
|
||||
required Color bgLabelColor,
|
||||
}) {
|
||||
return Container(
|
||||
height: 82,
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8)),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Row(
|
||||
children: [
|
||||
// Left side with icon and title
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 82,
|
||||
decoration: BoxDecoration(
|
||||
color: bgLabelColor,
|
||||
borderRadius: BorderRadius.only(topRight: Radius.circular(8), bottomRight: Radius.circular(8)),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 4,
|
||||
children: [
|
||||
SvgGenImage.vec(
|
||||
iconPath,
|
||||
).svg(width: 24, height: 24, colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn)),
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// Right side with description and unit
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: bgDescriptionColor,
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
description,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
Text(
|
||||
unit,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Container _informationIconCard({
|
||||
required String title,
|
||||
required String description,
|
||||
String unit = 'کیلوگرم',
|
||||
required String iconPath,
|
||||
required Color iconColor,
|
||||
required Color bgDescriptionColor,
|
||||
required Color bgLabelColor,
|
||||
}) {
|
||||
return Container(
|
||||
height: 110,
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8)),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Stack(
|
||||
alignment: Alignment.topCenter,
|
||||
children: [
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
left: 0,
|
||||
child: Container(
|
||||
height: 91,
|
||||
decoration: BoxDecoration(
|
||||
color: bgDescriptionColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 0.25, color: const Color(0xFFB4B4B4)),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
Text(
|
||||
description,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
Text(
|
||||
unit,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
child: Container(
|
||||
width: 32,
|
||||
height: 32,
|
||||
decoration: ShapeDecoration(
|
||||
color: bgLabelColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
side: BorderSide(width: 0.25, color: const Color(0xFFD5D5D5)),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: SvgGenImage.vec(
|
||||
iconPath,
|
||||
).svg(width: 24, height: 24, colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget widelyUsed({required String title, required String iconPath, required VoidCallback onTap}) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
spacing: 4,
|
||||
children: [
|
||||
Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: ShapeDecoration(
|
||||
color: const Color(0xFFBECDFF),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueNormal,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: SvgGenImage.vec(iconPath).svg(
|
||||
width: 24,
|
||||
height: 24,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(title, style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget addWidelyUsed({required VoidCallback onTap}) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
spacing: 4,
|
||||
children: [
|
||||
Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: ShapeDecoration(
|
||||
color: const Color(0xFFD9F7F0),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Assets.vec.messageAddSvg.svg(
|
||||
width: 40,
|
||||
height: 40,
|
||||
colorFilter: ColorFilter.mode(AppColor.greenNormal, BlendMode.srcIn),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Text('افزودن', style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Column oldPage() {
|
||||
return Column(
|
||||
children: [
|
||||
inventoryWidget(),
|
||||
ObxValue((data) => broadcastInformationWidget(data.value), controller.killHouseDistributionInfo),
|
||||
SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
cardWidget(
|
||||
title: 'ورود به انبار',
|
||||
iconPath: Assets.icons.whareHouse.path,
|
||||
onTap: () {
|
||||
Get.toNamed(ChickenRoutes.enteringTheWarehouse);
|
||||
},
|
||||
),
|
||||
cardWidget(
|
||||
title: 'فروش داخل استان',
|
||||
iconPath: Assets.icons.inside.path,
|
||||
onTap: () {
|
||||
Get.toNamed(ChickenRoutes.salesWithinProvince);
|
||||
},
|
||||
),
|
||||
cardWidget(
|
||||
title: 'فروش خارج استان',
|
||||
iconPath: Assets.icons.outside.path,
|
||||
onTap: () {
|
||||
Get.toNamed(ChickenRoutes.salesWithOutProvince);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -63,10 +574,7 @@ class RootPage extends GetView<RootLogic> {
|
||||
const SizedBox(height: 20),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
'موجودی انبار',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
child: Text('موجودی انبار', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)),
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
ObxValue(
|
||||
@@ -86,8 +594,7 @@ class RootPage extends GetView<RootLogic> {
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: controller.inventoryList.length,
|
||||
separatorBuilder: (context, index) =>
|
||||
const SizedBox(height: 8),
|
||||
separatorBuilder: (context, index) => const SizedBox(height: 8),
|
||||
itemBuilder: (context, index) {
|
||||
return ObxValue((expand) {
|
||||
return GestureDetector(
|
||||
@@ -97,8 +604,7 @@ class RootPage extends GetView<RootLogic> {
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: AnimatedContainer(
|
||||
onEnd: () {
|
||||
controller.inventoryExpandedList[index] =
|
||||
!controller.inventoryExpandedList[index]!;
|
||||
controller.inventoryExpandedList[index] = !controller.inventoryExpandedList[index]!;
|
||||
},
|
||||
margin: const EdgeInsets.symmetric(vertical: 2),
|
||||
padding: EdgeInsets.all(6),
|
||||
@@ -106,16 +612,12 @@ class RootPage extends GetView<RootLogic> {
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
color: AppColor.blueNormal,
|
||||
width: 1,
|
||||
),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
),
|
||||
duration: const Duration(seconds: 1),
|
||||
height: expand.keys.contains(index) ? 250 : 80,
|
||||
child: inventoryItem(
|
||||
isExpanded:
|
||||
expand.keys.contains(index) && expand[index]!,
|
||||
isExpanded: expand.keys.contains(index) && expand[index]!,
|
||||
index: index,
|
||||
model: controller.inventoryList[index],
|
||||
),
|
||||
@@ -131,11 +633,7 @@ class RootPage extends GetView<RootLogic> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget inventoryItem({
|
||||
required bool isExpanded,
|
||||
required int index,
|
||||
required InventoryModel model,
|
||||
}) {
|
||||
Widget inventoryItem({required bool isExpanded, required int index, required InventoryModel model}) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 8,
|
||||
@@ -147,26 +645,11 @@ class RootPage extends GetView<RootLogic> {
|
||||
spacing: 8,
|
||||
children: [
|
||||
buildRow('وزن خریدهای دولتی داخل استان (کیلوگرم)', '0326598653'),
|
||||
buildRow(
|
||||
'وزن خریدهای آزاد داخل استان (کیلوگرم)',
|
||||
model.receiveFreeCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'وزن خریدهای خارج استان (کیلوگرم)',
|
||||
model.freeBuyingCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'کل ورودی به انبار (کیلوگرم)',
|
||||
model.totalFreeBarsCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'کل فروش (کیلوگرم)',
|
||||
model.realAllocatedWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'مانده انبار (کیلوگرم)',
|
||||
model.totalRemainWeight.toString(),
|
||||
),
|
||||
buildRow('وزن خریدهای آزاد داخل استان (کیلوگرم)', model.receiveFreeCarcassesWeight.toString()),
|
||||
buildRow('وزن خریدهای خارج استان (کیلوگرم)', model.freeBuyingCarcassesWeight.toString()),
|
||||
buildRow('کل ورودی به انبار (کیلوگرم)', model.totalFreeBarsCarcassesWeight.toString()),
|
||||
buildRow('کل فروش (کیلوگرم)', model.realAllocatedWeight.toString()),
|
||||
buildRow('مانده انبار (کیلوگرم)', model.totalRemainWeight.toString()),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -185,9 +668,7 @@ class RootPage extends GetView<RootLogic> {
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
@@ -195,9 +676,7 @@ class RootPage extends GetView<RootLogic> {
|
||||
child: Text(
|
||||
value,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -223,19 +702,11 @@ class RootPage extends GetView<RootLogic> {
|
||||
Text(
|
||||
'اطلاعات ارسالی',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
buildRow(
|
||||
'فروش و توزیع داخل استان (کیلوگرم)',
|
||||
model.stewardAllocationsWeight!.toInt().toString(),
|
||||
),
|
||||
buildRow(
|
||||
'فروش و توزیع خارج استان (کیلوگرم)',
|
||||
model.freeSalesWeight!.toInt().toString(),
|
||||
),
|
||||
buildRow('فروش و توزیع داخل استان (کیلوگرم)', model.stewardAllocationsWeight!.toInt().toString()),
|
||||
buildRow('فروش و توزیع خارج استان (کیلوگرم)', model.freeSalesWeight!.toInt().toString()),
|
||||
],
|
||||
)
|
||||
: const Center(child: CircularProgressIndicator()),
|
||||
@@ -282,9 +753,7 @@ Widget markerDetailsWidget({required VoidCallback ontap}) {
|
||||
Text(
|
||||
'سوابق بازرسی من',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
vecWidgetWithOnTap(
|
||||
child: Assets.vec.trashSvg.svg(),
|
||||
@@ -301,9 +770,7 @@ Widget markerDetailsWidget({required VoidCallback ontap}) {
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||
),
|
||||
shape: RoundedRectangleBorder(side: BorderSide(width: 1, color: AppColor.blueLightHover)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -311,16 +778,12 @@ Widget markerDetailsWidget({required VoidCallback ontap}) {
|
||||
Text(
|
||||
'تاریخ بازرسی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Text(
|
||||
'1403/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -333,16 +796,12 @@ Widget markerDetailsWidget({required VoidCallback ontap}) {
|
||||
Text(
|
||||
'شماره همراه',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Text(
|
||||
'0326598653',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -354,17 +813,13 @@ Widget markerDetailsWidget({required VoidCallback ontap}) {
|
||||
Text(
|
||||
'آخرین فعالیت',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
|
||||
Text(
|
||||
'1409/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -376,16 +831,12 @@ Widget markerDetailsWidget({required VoidCallback ontap}) {
|
||||
Text(
|
||||
'موجودی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Text(
|
||||
'5کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -400,16 +851,12 @@ Widget markerDetailsWidget({required VoidCallback ontap}) {
|
||||
Text(
|
||||
'فروش رفته',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -420,11 +867,7 @@ Widget markerDetailsWidget({required VoidCallback ontap}) {
|
||||
);
|
||||
}
|
||||
|
||||
Widget cardWidget({
|
||||
required String title,
|
||||
required String iconPath,
|
||||
required VoidCallback onTap,
|
||||
}) {
|
||||
Widget cardWidget({required String title, required String iconPath, required VoidCallback onTap}) {
|
||||
return Container(
|
||||
width: Get.width / 4,
|
||||
height: 130,
|
||||
|
||||
@@ -362,6 +362,8 @@ class AppColor {
|
||||
|
||||
static const Color bgLight = Color(0xFFF5F5F5); // #083940 rgb(8, 57, 64)
|
||||
static const Color bgDark = Color(0xFF979797); // #083940 rgb(8, 57, 64)
|
||||
static const Color textColor = Color(0xFF5B5B5B); // #083940 rgb(8, 57, 64)
|
||||
|
||||
//endregion
|
||||
|
||||
//region --- category Colors ---
|
||||
|
||||
@@ -36,6 +36,21 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/call.svg
|
||||
SvgGenImage get call => const SvgGenImage('assets/icons/call.svg');
|
||||
|
||||
/// File path: assets/icons/convert_cube.svg
|
||||
SvgGenImage get convertCube => const SvgGenImage('assets/icons/convert_cube.svg');
|
||||
|
||||
/// File path: assets/icons/cube.svg
|
||||
SvgGenImage get cube => const SvgGenImage('assets/icons/cube.svg');
|
||||
|
||||
/// File path: assets/icons/cube_rotate.svg
|
||||
SvgGenImage get cubeRotate => const SvgGenImage('assets/icons/cube_rotate.svg');
|
||||
|
||||
/// File path: assets/icons/cube_scan.svg
|
||||
SvgGenImage get cubeScan => const SvgGenImage('assets/icons/cube_scan.svg');
|
||||
|
||||
/// File path: assets/icons/cube_search.svg
|
||||
SvgGenImage get cubeSearch => const SvgGenImage('assets/icons/cube_search.svg');
|
||||
|
||||
/// File path: assets/icons/diagram.svg
|
||||
SvgGenImage get diagram => const SvgGenImage('assets/icons/diagram.svg');
|
||||
|
||||
@@ -54,6 +69,9 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/gps.svg
|
||||
SvgGenImage get gps => const SvgGenImage('assets/icons/gps.svg');
|
||||
|
||||
/// File path: assets/icons/home.svg
|
||||
SvgGenImage get home => const SvgGenImage('assets/icons/home.svg');
|
||||
|
||||
/// File path: assets/icons/information.svg
|
||||
SvgGenImage get information => const SvgGenImage('assets/icons/information.svg');
|
||||
|
||||
@@ -126,9 +144,18 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/trash.svg
|
||||
SvgGenImage get trash => const SvgGenImage('assets/icons/trash.svg');
|
||||
|
||||
/// File path: assets/icons/truck.svg
|
||||
SvgGenImage get truck => const SvgGenImage('assets/icons/truck.svg');
|
||||
|
||||
/// File path: assets/icons/truck_fast.svg
|
||||
SvgGenImage get truckFast => const SvgGenImage('assets/icons/truck_fast.svg');
|
||||
|
||||
/// File path: assets/icons/user.svg
|
||||
SvgGenImage get user => const SvgGenImage('assets/icons/user.svg');
|
||||
|
||||
/// File path: assets/icons/user_raduis.svg
|
||||
SvgGenImage get userRaduis => const SvgGenImage('assets/icons/user_raduis.svg');
|
||||
|
||||
/// File path: assets/icons/user_square.svg
|
||||
SvgGenImage get userSquare => const SvgGenImage('assets/icons/user_square.svg');
|
||||
|
||||
@@ -147,12 +174,18 @@ class $AssetsIconsGen {
|
||||
calendar,
|
||||
calendarSearch,
|
||||
call,
|
||||
convertCube,
|
||||
cube,
|
||||
cubeRotate,
|
||||
cubeScan,
|
||||
cubeSearch,
|
||||
diagram,
|
||||
download,
|
||||
edit,
|
||||
excelDownload,
|
||||
filter,
|
||||
gps,
|
||||
home,
|
||||
information,
|
||||
inside,
|
||||
inspection,
|
||||
@@ -177,7 +210,10 @@ class $AssetsIconsGen {
|
||||
tagLabel,
|
||||
tagUser,
|
||||
trash,
|
||||
truck,
|
||||
truckFast,
|
||||
user,
|
||||
userRaduis,
|
||||
userSquare,
|
||||
virtual,
|
||||
whareHouse,
|
||||
@@ -187,6 +223,9 @@ class $AssetsIconsGen {
|
||||
class $AssetsImagesGen {
|
||||
const $AssetsImagesGen();
|
||||
|
||||
/// File path: assets/images/chicken.png
|
||||
AssetGenImage get chicken => const AssetGenImage('assets/images/chicken.png');
|
||||
|
||||
/// File path: assets/images/inner_splash.webp
|
||||
AssetGenImage get innerSplash => const AssetGenImage('assets/images/inner_splash.webp');
|
||||
|
||||
@@ -197,7 +236,17 @@ class $AssetsImagesGen {
|
||||
AssetGenImage get placeHolder => const AssetGenImage('assets/images/place_holder.png');
|
||||
|
||||
/// List of all assets
|
||||
List<AssetGenImage> get values => [innerSplash, outterSplash, placeHolder];
|
||||
List<AssetGenImage> get values => [chicken, innerSplash, outterSplash, placeHolder];
|
||||
}
|
||||
|
||||
class $AssetsLogosGen {
|
||||
const $AssetsLogosGen();
|
||||
|
||||
/// File path: assets/logos/final_logo.png
|
||||
AssetGenImage get finalLogo => const AssetGenImage('assets/logos/final_logo.png');
|
||||
|
||||
/// List of all assets
|
||||
List<AssetGenImage> get values => [finalLogo];
|
||||
}
|
||||
|
||||
class $AssetsVecGen {
|
||||
@@ -224,6 +273,21 @@ class $AssetsVecGen {
|
||||
/// File path: assets/vec/call.svg.vec
|
||||
SvgGenImage get callSvg => const SvgGenImage.vec('assets/vec/call.svg.vec');
|
||||
|
||||
/// File path: assets/vec/convert_cube.svg.vec
|
||||
SvgGenImage get convertCubeSvg => const SvgGenImage.vec('assets/vec/convert_cube.svg.vec');
|
||||
|
||||
/// File path: assets/vec/cube.svg.vec
|
||||
SvgGenImage get cubeSvg => const SvgGenImage.vec('assets/vec/cube.svg.vec');
|
||||
|
||||
/// File path: assets/vec/cube_rotate.svg.vec
|
||||
SvgGenImage get cubeRotateSvg => const SvgGenImage.vec('assets/vec/cube_rotate.svg.vec');
|
||||
|
||||
/// File path: assets/vec/cube_scan.svg.vec
|
||||
SvgGenImage get cubeScanSvg => const SvgGenImage.vec('assets/vec/cube_scan.svg.vec');
|
||||
|
||||
/// File path: assets/vec/cube_search.svg.vec
|
||||
SvgGenImage get cubeSearchSvg => const SvgGenImage.vec('assets/vec/cube_search.svg.vec');
|
||||
|
||||
/// File path: assets/vec/diagram.svg.vec
|
||||
SvgGenImage get diagramSvg => const SvgGenImage.vec('assets/vec/diagram.svg.vec');
|
||||
|
||||
@@ -242,9 +306,15 @@ class $AssetsVecGen {
|
||||
/// File path: assets/vec/gps.svg.vec
|
||||
SvgGenImage get gpsSvg => const SvgGenImage.vec('assets/vec/gps.svg.vec');
|
||||
|
||||
/// File path: assets/vec/home.svg.vec
|
||||
SvgGenImage get homeSvg => const SvgGenImage.vec('assets/vec/home.svg.vec');
|
||||
|
||||
/// File path: assets/vec/information.svg.vec
|
||||
SvgGenImage get informationSvg => const SvgGenImage.vec('assets/vec/information.svg.vec');
|
||||
|
||||
/// File path: assets/vec/inside.svg.vec
|
||||
SvgGenImage get insideSvg => const SvgGenImage.vec('assets/vec/inside.svg.vec');
|
||||
|
||||
/// File path: assets/vec/inspection.svg.vec
|
||||
SvgGenImage get inspectionSvg => const SvgGenImage.vec('assets/vec/inspection.svg.vec');
|
||||
|
||||
@@ -266,6 +336,9 @@ class $AssetsVecGen {
|
||||
/// File path: assets/vec/message_add.svg.vec
|
||||
SvgGenImage get messageAddSvg => const SvgGenImage.vec('assets/vec/message_add.svg.vec');
|
||||
|
||||
/// File path: assets/vec/outside.svg.vec
|
||||
SvgGenImage get outsideSvg => const SvgGenImage.vec('assets/vec/outside.svg.vec');
|
||||
|
||||
/// File path: assets/vec/pdf_download.svg.vec
|
||||
SvgGenImage get pdfDownloadSvg => const SvgGenImage.vec('assets/vec/pdf_download.svg.vec');
|
||||
|
||||
@@ -308,15 +381,27 @@ class $AssetsVecGen {
|
||||
/// File path: assets/vec/trash.svg.vec
|
||||
SvgGenImage get trashSvg => const SvgGenImage.vec('assets/vec/trash.svg.vec');
|
||||
|
||||
/// File path: assets/vec/truck.svg.vec
|
||||
SvgGenImage get truckSvg => const SvgGenImage.vec('assets/vec/truck.svg.vec');
|
||||
|
||||
/// File path: assets/vec/truck_fast.svg.vec
|
||||
SvgGenImage get truckFastSvg => const SvgGenImage.vec('assets/vec/truck_fast.svg.vec');
|
||||
|
||||
/// File path: assets/vec/user.svg.vec
|
||||
SvgGenImage get userSvg => const SvgGenImage.vec('assets/vec/user.svg.vec');
|
||||
|
||||
/// File path: assets/vec/user_raduis.svg.vec
|
||||
SvgGenImage get userRaduisSvg => const SvgGenImage.vec('assets/vec/user_raduis.svg.vec');
|
||||
|
||||
/// File path: assets/vec/user_square.svg.vec
|
||||
SvgGenImage get userSquareSvg => const SvgGenImage.vec('assets/vec/user_square.svg.vec');
|
||||
|
||||
/// File path: assets/vec/virtual.svg.vec
|
||||
SvgGenImage get virtualSvg => const SvgGenImage.vec('assets/vec/virtual.svg.vec');
|
||||
|
||||
/// File path: assets/vec/whare_house.svg.vec
|
||||
SvgGenImage get whareHouseSvg => const SvgGenImage.vec('assets/vec/whare_house.svg.vec');
|
||||
|
||||
/// List of all assets
|
||||
List<SvgGenImage> get values => [
|
||||
addSvg,
|
||||
@@ -326,13 +411,20 @@ class $AssetsVecGen {
|
||||
calendarSvg,
|
||||
calendarSearchSvg,
|
||||
callSvg,
|
||||
convertCubeSvg,
|
||||
cubeSvg,
|
||||
cubeRotateSvg,
|
||||
cubeScanSvg,
|
||||
cubeSearchSvg,
|
||||
diagramSvg,
|
||||
downloadSvg,
|
||||
editSvg,
|
||||
excelDownloadSvg,
|
||||
filterSvg,
|
||||
gpsSvg,
|
||||
homeSvg,
|
||||
informationSvg,
|
||||
insideSvg,
|
||||
inspectionSvg,
|
||||
keySvg,
|
||||
liveStockSvg,
|
||||
@@ -340,6 +432,7 @@ class $AssetsVecGen {
|
||||
mapSvg,
|
||||
mapMarkerSvg,
|
||||
messageAddSvg,
|
||||
outsideSvg,
|
||||
pdfDownloadSvg,
|
||||
pictureFrameSvg,
|
||||
placeHolderSvg,
|
||||
@@ -354,9 +447,13 @@ class $AssetsVecGen {
|
||||
tagLabelSvg,
|
||||
tagUserSvg,
|
||||
trashSvg,
|
||||
truckSvg,
|
||||
truckFastSvg,
|
||||
userSvg,
|
||||
userRaduisSvg,
|
||||
userSquareSvg,
|
||||
virtualSvg,
|
||||
whareHouseSvg,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -365,6 +462,7 @@ class Assets {
|
||||
|
||||
static const $AssetsIconsGen icons = $AssetsIconsGen();
|
||||
static const $AssetsImagesGen images = $AssetsImagesGen();
|
||||
static const $AssetsLogosGen logos = $AssetsLogosGen();
|
||||
static const $AssetsVecGen vec = $AssetsVecGen();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
class FontFamily {
|
||||
FontFamily._();
|
||||
|
||||
/// Font family: iranyekanregularfanum
|
||||
static const String iranyekanregularfanum = 'iranyekanregularfanum';
|
||||
/// Font family: yekan
|
||||
static const String yekan = 'yekan';
|
||||
}
|
||||
|
||||
@@ -9,21 +9,24 @@ class WaveBottomNavigationItem {
|
||||
}
|
||||
|
||||
class WaveBottomNavigation extends StatefulWidget {
|
||||
const WaveBottomNavigation({
|
||||
super.key,
|
||||
required this.items,
|
||||
required this.onPageChanged,
|
||||
});
|
||||
const WaveBottomNavigation({super.key, this.initPage = 0, required this.items, required this.onPageChanged});
|
||||
|
||||
final List<WaveBottomNavigationItem> items;
|
||||
final Function(int) onPageChanged;
|
||||
final int initPage;
|
||||
|
||||
@override
|
||||
State<WaveBottomNavigation> createState() => _WaveBottomNavigationState();
|
||||
}
|
||||
|
||||
class _WaveBottomNavigationState extends State<WaveBottomNavigation> {
|
||||
final PageController _controller = PageController(viewportFraction: 0.3);
|
||||
late PageController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = PageController(viewportFraction: 0.3, initialPage: widget.initPage);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@@ -85,19 +88,15 @@ class _WaveBottomNavigationState extends State<WaveBottomNavigation> {
|
||||
final WaveBottomNavigationItem item = widget.items[index];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
_controller.animateToPage(
|
||||
index,
|
||||
duration: Duration(milliseconds: 500),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
_controller.animateToPage(index, duration: Duration(milliseconds: 500), curve: Curves.easeInOut);
|
||||
},
|
||||
child: Center(
|
||||
child: AnimatedBuilder(
|
||||
animation: _controller,
|
||||
builder: (context, child) {
|
||||
double value = 0.0;
|
||||
final scale = _calculateScale(_controller.page ?? 0, index);
|
||||
value = index - (_controller.page ?? 0);
|
||||
final scale = _calculateScale(_controller.page ?? _controller.initialPage.toDouble() ?? 0.0, index);
|
||||
value = index - (_controller.page ?? _controller.initialPage.toDouble() ?? 0.0);
|
||||
value = (value).clamp(-1, 1);
|
||||
double offset = value * 30;
|
||||
if (value.abs() < 0.2 || value.abs() > 0.2) {
|
||||
@@ -110,10 +109,7 @@ class _WaveBottomNavigationState extends State<WaveBottomNavigation> {
|
||||
offset: Offset(0, offset),
|
||||
child: Column(
|
||||
children: [
|
||||
Tooltip(
|
||||
message: item.title,
|
||||
child: item.icon
|
||||
),
|
||||
Tooltip(message: item.title, child: item.icon),
|
||||
|
||||
/* Visibility(
|
||||
visible: (_controller.page ?? 0) == index,
|
||||
|
||||
Reference in New Issue
Block a user