Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
error_widget.dart
Go to the documentation of this file.
1import 'package:fluentui_system_icons/fluentui_system_icons.dart';
2import 'package:flutter/material.dart';
3import 'package:flutter_screenutil/flutter_screenutil.dart';
4import 'package:lottie/lottie.dart';
5import '../../constants/assets.dart';
6import '../theme/color_palette.dart';
7
8class CustomErrorWidget extends StatelessWidget {
10 final VoidCallback onReload;
11
13 super.key,
14 required this.message,
15 required this.onReload,
16 });
17
18 @override
19 Widget build(BuildContext context) {
20 return Center(
22 mainAxisSize: MainAxisSize.min,
23 mainAxisAlignment: MainAxisAlignment.center,
24 children: [
25 Lottie.asset(
27 height: 180.sp,
28 repeat: true,
29 animate: true,
30 ),
31 Text(
32 message,
33 textAlign: TextAlign.center,
34 style: TextStyle(
35 fontSize: 18.sp,
36 color: Colors.grey[800],
37 height: 1.5,
38 letterSpacing: 0.3,
39 fontWeight: FontWeight.w500,
40 ),
41 ),
42 SizedBox(height: 32.sp),
43 Container(
44 decoration: BoxDecoration(
45 gradient: LinearGradient(
46 colors: [
47 ColorPalette.darkGrey.withValues(alpha: 0.7),
48 ColorPalette.darkGrey.withValues(alpha: 0.5),
49 ],
50 ),
51 borderRadius: BorderRadius.circular(15.sp),
52 ),
53 child: Material(
54 color: Colors.transparent,
55 child: InkWell(
57 borderRadius: BorderRadius.circular(15.sp),
58 child: Padding(
59 padding: EdgeInsets.symmetric(
60 horizontal: 32.sp,
61 vertical: 16.sp,
62 ),
63 child: Row(
64 mainAxisSize: MainAxisSize.min,
65 children: [
66 Icon(
67 FluentIcons.arrow_sync_circle_16_filled,
68 size: 24.sp,
69 color: Colors.white,
70 ),
71 SizedBox(width: 12.sp),
72 Text(
73 'Try Again',
74 style: TextStyle(
75 fontSize: 16.sp,
76 color: Colors.white,
77 fontWeight: FontWeight.w600,
78 letterSpacing: 0.5,
79 ),
80 ),
81 ],
82 ),
83 ),
84 ),
85 ),
86 ),
87 ],
88 ),
89 );
90 }
91}
static const String failureLottie
Definition assets.dart:19
static const darkGrey
const CustomErrorWidget({ super.key, required this.message, required this.onReload, })
final VoidCallback onTap
final VoidCallback onReload
final Widget child
final LinearGradient gradient
override Widget build(BuildContext context)
final EdgeInsets padding
final String message
class Partner String
style Text( '${ 'scheduling.reference'.tr()}:${collection.internalCode}', style:Theme.of(context).textTheme.bodySmall,)
style SizedBox(height:2.h)
style Column(crossAxisAlignment:CrossAxisAlignment.end, children:[Container(padding:EdgeInsets.symmetric(horizontal:8.w, vertical:4.h), decoration:BoxDecoration(color:ColorPalette.tiffanyBlue.withValues(alpha:0.1), borderRadius:BorderRadius.circular(12),), child:Text(collection.type ?? '', style:Theme.of(context).textTheme.bodySmall?.copyWith(color:ColorPalette.tiffanyBlue, fontWeight:FontWeight.bold,),),),],)