doc : RErrorWidget and EmptyWidget

This commit is contained in:
2025-10-13 16:30:43 +03:30
parent 4da738eef6
commit 0901b45998
9 changed files with 94 additions and 36 deletions

View File

@@ -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<HomeLogic> {
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'),
],
),
],
),
),

View File

@@ -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),
),
],
),
),
);

View File

@@ -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) {