feat: role page
fix: import
This commit is contained in:
@@ -131,7 +131,7 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
);
|
||||
}
|
||||
|
||||
Get.offAndToNamed(ChickenRoutes.initSteward);
|
||||
Get.offAndToNamed(ChickenRoutes.role);
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
if (error is DioException) {
|
||||
|
||||
17
packages/chicken/lib/presentation/pages/role/logic.dart
Normal file
17
packages/chicken/lib/presentation/pages/role/logic.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class RoleLogic extends GetxController {
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
75
packages/chicken/lib/presentation/pages/role/view.dart
Normal file
75
packages/chicken/lib/presentation/pages/role/view.dart
Normal file
@@ -0,0 +1,75 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class RolePage extends GetView<RoleLogic> {
|
||||
const RolePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Assets.rive.shapes.rive(fit: BoxFit.cover),
|
||||
Positioned.fill(
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
|
||||
child: Container(color: Colors.white.withValues(alpha: 0.2)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 400.h,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Card(
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 12.h),
|
||||
Text(
|
||||
'انتخاب نقش',
|
||||
style: AppFonts.yekan20Bold.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
Expanded(
|
||||
child: GridView.builder(
|
||||
physics: BouncingScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent: 250,
|
||||
mainAxisSpacing: 12,
|
||||
crossAxisSpacing: 12,
|
||||
childAspectRatio: 1.5,
|
||||
),
|
||||
itemCount: 3,
|
||||
hitTestBehavior: HitTestBehavior.opaque,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return roleCard(title: index == 0 ? 'نasdsadasdقش $index' : "wlsp", onTap: null);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget roleCard({required String title, Function()? onTap}) {
|
||||
return Container(
|
||||
margin: EdgeInsets.all(8.w),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1.w),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Center(
|
||||
child: Text(title, style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/cupertino.dart' hide Image;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
@@ -10,7 +10,7 @@ import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/steward/inventory_widget.dart';
|
||||
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/core.dart' hide Image;
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/cupertino.dart' hide LinearGradient;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/cupertino.dart' hide Image;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/chicken.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/core.dart' hide Image;
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/chicken.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/steward/root/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/core.dart' hide LinearGradient;
|
||||
|
||||
class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
StewardRootPage({super.key});
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:rasadyar_chicken/presentation/pages/auth/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/auth/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/role/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/role/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/steward/steward.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';
|
||||
@@ -20,6 +22,14 @@ sealed class ChickenPages {
|
||||
}),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: ChickenRoutes.role,
|
||||
page: () => RolePage(),
|
||||
binding: BindingsBuilder(() {
|
||||
Get.lazyPut(() => RoleLogic());
|
||||
}),
|
||||
),
|
||||
|
||||
//region Steward Pages
|
||||
GetPage(
|
||||
name: ChickenRoutes.initSteward,
|
||||
@@ -124,8 +134,7 @@ sealed class ChickenPages {
|
||||
Get.lazyPut(() => BuyInProvinceAllLogic());
|
||||
}),
|
||||
),
|
||||
|
||||
//endregion
|
||||
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ sealed class ChickenRoutes {
|
||||
|
||||
static const auth = '/AuthChicken';
|
||||
static const _base = '/chicken';
|
||||
static const role = '$_base/role';
|
||||
|
||||
//region Steward Routes
|
||||
static const _steward = '$_base/steward';
|
||||
|
||||
@@ -8,8 +8,6 @@ export 'package:connectivity_plus/connectivity_plus.dart';
|
||||
export 'package:device_info_plus/device_info_plus.dart';
|
||||
export 'package:dio/dio.dart';
|
||||
export 'package:flutter_localizations/flutter_localizations.dart';
|
||||
export 'package:rive/rive.dart';
|
||||
|
||||
//map
|
||||
export 'package:flutter_map/flutter_map.dart';
|
||||
export 'package:flutter_map_animations/flutter_map_animations.dart';
|
||||
|
||||
@@ -13,6 +13,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart' as _svg;
|
||||
import 'package:lottie/lottie.dart' as _lottie;
|
||||
import 'package:rive/rive.dart' as _rive;
|
||||
import 'package:vector_graphics/vector_graphics.dart' as _vg;
|
||||
|
||||
class $AssetsAnimGen {
|
||||
@@ -417,6 +418,16 @@ class $AssetsLogosGen {
|
||||
List<AssetGenImage> get values => [finalLogo];
|
||||
}
|
||||
|
||||
class $AssetsRiveGen {
|
||||
const $AssetsRiveGen();
|
||||
|
||||
/// File path: assets/rive/shapes.riv
|
||||
RiveGenImage get shapes => const RiveGenImage('assets/rive/shapes.riv');
|
||||
|
||||
/// List of all assets
|
||||
List<RiveGenImage> get values => [shapes];
|
||||
}
|
||||
|
||||
class $AssetsVecGen {
|
||||
const $AssetsVecGen();
|
||||
|
||||
@@ -784,6 +795,7 @@ class Assets {
|
||||
static const $AssetsIconsGen icons = $AssetsIconsGen();
|
||||
static const $AssetsImagesGen images = $AssetsImagesGen();
|
||||
static const $AssetsLogosGen logos = $AssetsLogosGen();
|
||||
static const $AssetsRiveGen rive = $AssetsRiveGen();
|
||||
static const $AssetsVecGen vec = $AssetsVecGen();
|
||||
}
|
||||
|
||||
@@ -932,6 +944,44 @@ class SvgGenImage {
|
||||
String get keyName => _assetName;
|
||||
}
|
||||
|
||||
class RiveGenImage {
|
||||
const RiveGenImage(this._assetName, {this.flavors = const {}});
|
||||
|
||||
final String _assetName;
|
||||
final Set<String> flavors;
|
||||
|
||||
_rive.RiveAnimation rive({
|
||||
String? artboard,
|
||||
List<String> animations = const [],
|
||||
List<String> stateMachines = const [],
|
||||
BoxFit? fit,
|
||||
Alignment? alignment,
|
||||
Widget? placeHolder,
|
||||
bool antialiasing = true,
|
||||
bool useArtboardSize = false,
|
||||
List<_rive.RiveAnimationController> controllers = const [],
|
||||
_rive.OnInitCallback? onInit,
|
||||
}) {
|
||||
return _rive.RiveAnimation.asset(
|
||||
_assetName,
|
||||
artboard: artboard,
|
||||
animations: animations,
|
||||
stateMachines: stateMachines,
|
||||
fit: fit,
|
||||
alignment: alignment,
|
||||
placeHolder: placeHolder,
|
||||
antialiasing: antialiasing,
|
||||
useArtboardSize: useArtboardSize,
|
||||
controllers: controllers,
|
||||
onInit: onInit,
|
||||
);
|
||||
}
|
||||
|
||||
String get path => _assetName;
|
||||
|
||||
String get keyName => _assetName;
|
||||
}
|
||||
|
||||
class LottieGenImage {
|
||||
const LottieGenImage(this._assetName, {this.flavors = const {}});
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ flutter:
|
||||
- assets/icons/
|
||||
- assets/images/
|
||||
- assets/logos/
|
||||
- assets/rive/
|
||||
- assets/vec/
|
||||
- assets/anim/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user