Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
faild_to_fetch_data_view.dart
Go to the documentation of this file.
1import 'package:aidra_drive/core/ui/widgets/custom_slider.dart';
2
3import '/core/ui/widgets/custom_card.dart';
4import 'package:flutter/material.dart';
5import 'package:flutter_screenutil/flutter_screenutil.dart';
6
7class FailedToFetchDataView extends StatelessWidget {
8 final VoidCallback onRetry;
10 final EdgeInsets? padding;
11
13 super.key,
14 required this.onRetry,
15 this.failureMessage,
16 this.padding,
17 });
18
19 @override
20 Widget build(BuildContext context) {
21 return Padding(
23 EdgeInsets.symmetric(
24 horizontal: 15.sp,
25 vertical: 10.sp,
26 ),
29 crossAxisAlignment: CrossAxisAlignment.start,
30 mainAxisSize: MainAxisSize.min,
31 children: [
32 Text(
33 'Oops! Something went wrong',
34 style: Theme.of(context).textTheme.displaySmall?.copyWith(
35 color: Theme.of(context).colorScheme.error,
36 ),
37 ),
38 SizedBox(height: 10.sp),
39 Text(
40 'We encountered an issue while processing your request. Please retry.',
41 style: Theme.of(context).textTheme.bodySmall?.copyWith(),
42 ),
43 SizedBox(height: 15.sp),
44 Visibility(
45 visible: failureMessage != null,
46 child: Container(
47 width: MediaQuery.of(context).size.width,
48 margin: EdgeInsets.only(bottom: 15.sp),
49 decoration: BoxDecoration(
50 color: Theme.of(context).scaffoldBackgroundColor,
51 borderRadius: BorderRadius.circular(5),
52 ),
53 padding: EdgeInsets.all(10.sp),
54 child: Text(
55 '$failureMessage',
56 style: Theme.of(context).textTheme.bodySmall,
57 ),
58 ),
59 ),
61 // color: Theme.of(context).colorScheme.error,
62 text: 'TRY AGAIN',
63 action: (action) {},
64 ),
65 ],
66 ),
67 ),
68 );
69 }
70}
const CustomCard({ super.key, required this.child, this.padding, this.bgColor, })
final String text
final Widget child
override Widget build(BuildContext context)
final VoidCallback onRetry
final EdgeInsets padding
const FailedToFetchDataView({ super.key, required this.onRetry, this.failureMessage, this.padding, })
const CustomSlider({ super.key, required this.text, required this.action, })
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,),),),],)