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

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