diff --git a/doc/EmptyWidget.png b/doc/EmptyWidget.png new file mode 100644 index 0000000..c7b4de0 Binary files /dev/null and b/doc/EmptyWidget.png differ diff --git a/doc/RErrorWidget.png b/doc/RErrorWidget.png new file mode 100644 index 0000000..0326572 Binary files /dev/null and b/doc/RErrorWidget.png differ diff --git a/lib/presentation/pages/test/logic.dart b/lib/presentation/pages/test/logic.dart new file mode 100644 index 0000000..2961539 --- /dev/null +++ b/lib/presentation/pages/test/logic.dart @@ -0,0 +1,15 @@ +import 'package:get/get.dart'; + +class TestLogic extends GetxController { + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } +} diff --git a/lib/presentation/pages/test/view.dart b/lib/presentation/pages/test/view.dart new file mode 100644 index 0000000..4c883d8 --- /dev/null +++ b/lib/presentation/pages/test/view.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class TestPage extends StatelessWidget { + const TestPage({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final TestLogic logic = Get.put(TestLogic()); + + return Scaffold(body: SafeArea( + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Column(children: [ + + Text('buildRow'), + buildRow( + title: "Test Row Item", + value: "Value", + titleLabel: "Title Label", + valueLabel: "Value Label", + titleLabelStyle: AppFonts.yekan14.copyWith(color: Colors.red), + valueLabelStyle: AppFonts.yekan14.copyWith(color: Colors.blue), + titleStyle: AppFonts.yekan16.copyWith(color: Colors.green), + valueStyle: AppFonts.yekan16.copyWith(color: Colors.purple), + ), + Divider(), + + + + + ]), + ), + )); + } +} diff --git a/lib/presentation/routes/app_pages.dart b/lib/presentation/routes/app_pages.dart index b122522..f3ec1d8 100644 --- a/lib/presentation/routes/app_pages.dart +++ b/lib/presentation/routes/app_pages.dart @@ -3,6 +3,8 @@ import 'package:rasadyar_app/presentation/pages/modules/view.dart'; import 'package:rasadyar_app/presentation/pages/splash/logic.dart'; import 'package:rasadyar_app/presentation/pages/splash/view.dart'; import 'package:rasadyar_app/presentation/pages/system_design/system_design.dart'; +import 'package:rasadyar_app/presentation/pages/test/logic.dart'; +import 'package:rasadyar_app/presentation/pages/test/view.dart'; import 'package:rasadyar_chicken/chicken.dart'; import 'package:rasadyar_chicken/data/di/chicken_di.dart'; import 'package:rasadyar_core/core.dart'; @@ -16,7 +18,8 @@ part 'app_paths.dart'; sealed class AppPages { AppPages._(); - static const String initRoutes = AppPaths.splash; + //static const String initRoutes = AppPaths.splash; + static const String initRoutes = AppPaths.test; static const String initDesignSystem = AppPaths.systemDesignPage; static List pages = [ @@ -38,13 +41,18 @@ sealed class AppPages { binding: BindingsBuilder.put(() => SplashLogic()), ), + GetPage( + name: AppPaths.test, + page: () => TestPage(), + binding: BindingsBuilder.put(() => TestLogic()), + ), + ...InspectionPages.pages, ...LiveStockPages.pages, ...ChickenPages.pages, ]; } - Map Function()?>?> getAuthTargetPage(Module? value) { switch (value) { case Module.inspection: diff --git a/lib/presentation/routes/app_paths.dart b/lib/presentation/routes/app_paths.dart index 2003dcd..10de0c4 100644 --- a/lib/presentation/routes/app_paths.dart +++ b/lib/presentation/routes/app_paths.dart @@ -6,4 +6,5 @@ sealed class AppPaths { static const String splash = '/splash'; static const String moduleList = '/moduleList'; static const String systemDesignPage = '/systemDesignPage'; + static const String test = '/test'; } diff --git a/packages/chicken/lib/presentation/pages/steward/home/view.dart b/packages/chicken/lib/presentation/pages/steward/home/view.dart index d682d5f..9d2117b 100644 --- a/packages/chicken/lib/presentation/pages/steward/home/view.dart +++ b/packages/chicken/lib/presentation/pages/steward/home/view.dart @@ -5,6 +5,7 @@ import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_in import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; import 'package:rasadyar_chicken/presentation/widget/steward/widely_used/view.dart'; import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/presentation/widget/error_widget.dart'; import 'logic.dart'; @@ -25,17 +26,6 @@ class HomePage extends GetView { SizedBox(height: 8.h), WidelyUsedWidget(), SizedBox(height: 20), - Wrap( - spacing: 8, - children: [ - buildColumn(CoreLoadingIndicator(), 'CoreLoadingIndicator'), - buildColumn(CoreLoadingIndicator.linear(), 'CoreLoadingIndicator.linear'), - buildColumn(CoreLoadingIndicator.lottie(), ' CoreLoadingIndicator.lottie'), - buildColumn(CoreLoadingIndicator.small(), ' CoreLoadingIndicator.small'), - - buildColumn(CoreLoadingIndicator.cupertino(), 'CoreLoadingIndicator.cupertino'), - ], - ), ], ), ), diff --git a/packages/core/lib/presentation/widget/empty_widget.dart b/packages/core/lib/presentation/widget/empty_widget.dart index 8a87f5d..94a0db9 100644 --- a/packages/core/lib/presentation/widget/empty_widget.dart +++ b/packages/core/lib/presentation/widget/empty_widget.dart @@ -1,31 +1,31 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; -class EmptyWidget extends StatelessWidget { - const EmptyWidget({super.key, this.onRefresh}); - final RefreshCallback? onRefresh; +/// see this link for UI reference: +/// [https://github.com/mirani95/rasadyarApp/blob/develop/doc/EmptyWidget.png] + +class EmptyWidget extends StatelessWidget { + const EmptyWidget({super.key}); + @override Widget build(BuildContext context) { - return RefreshIndicator( - onRefresh: onRefresh ?? () async {}, - child: SingleChildScrollView( - physics: AlwaysScrollableScrollPhysics(), - child: SizedBox( - height: MediaQuery.of(context).size.height / 1.5, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Row(), - Assets.vec.emptySvg.svg(height: 190.h), - Text( - 'داده ای یافت نشد!', - style: AppFonts.yekan20.copyWith(color: AppColor.textColor), - ), - ], - ), + return SingleChildScrollView( + physics: AlwaysScrollableScrollPhysics(), + child: SizedBox( + height: MediaQuery.of(context).size.height / 1.5, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row(), + Assets.vec.emptySvg.svg(height: 190.h), + Text( + 'داده ای یافت نشد!', + style: AppFonts.yekan20.copyWith(color: AppColor.textColor), + ), + ], ), ), ); diff --git a/packages/core/lib/presentation/widget/error_widget.dart b/packages/core/lib/presentation/widget/error_widget.dart index 75b657f..a80387d 100644 --- a/packages/core/lib/presentation/widget/error_widget.dart +++ b/packages/core/lib/presentation/widget/error_widget.dart @@ -1,8 +1,13 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; -class ErrorWidget extends StatelessWidget { - const ErrorWidget({super.key}); + +/// see this link for UI reference: +/// [https://github.com/mirani95/rasadyarApp/blob/develop/doc/RErrorWidget.png] + + +class RErrorWidget extends StatelessWidget { + const RErrorWidget({super.key}); @override Widget build(BuildContext context) {