Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
custom_dual_slider.dart
Go to the documentation of this file.
1import 'package:action_slider/action_slider.dart';
2import 'package:fluentui_system_icons/fluentui_system_icons.dart';
3import 'package:flutter/material.dart';
4import 'package:flutter_screenutil/flutter_screenutil.dart';
5import 'package:shimmer/shimmer.dart';
6
7import '../theme/color_palette.dart';
8
9class CustomDualSlider extends StatelessWidget {
12 final dynamic Function(ActionSliderController)? startAction;
13 final dynamic Function(ActionSliderController)? endAction;
14
16 super.key,
17 required this.startText,
18 required this.endText,
19 required this.startAction,
20 required this.endAction,
21 });
22
23 @override
24 Widget build(BuildContext context) {
25 final bool isRTL = Directionality.of(context) == TextDirection.rtl;
26
27 return ActionSlider.dual(
28 successIcon: const Icon(FluentIcons.checkmark_24_filled, color: ColorPalette.white,),
29 loadingIcon: const CircularProgressIndicator(
30 strokeWidth: 1,
31 valueColor: AlwaysStoppedAnimation<Color>(ColorPalette.white),
32 ),
33 foregroundBorderRadius: BorderRadius.circular(20),
34 backgroundBorderRadius: BorderRadius.circular(20),
35 boxShadow: [
36 BoxShadow(
37 color: ColorPalette.black.withValues(alpha:0.05),
38 blurRadius: 10,
39 offset: const Offset(0, 2),
40 ),
41 ],
42 icon: Icon(
43 FluentIcons.arrows_bidirectional_20_filled,
45 size: 24.sp,
46 ),
47 backgroundColor: ColorPalette.white,
48 startChild: Shimmer.fromColors(
49 direction: isRTL ? ShimmerDirection.rtl : ShimmerDirection.ltr,
50 baseColor: ColorPalette.grey,
51 highlightColor: ColorPalette.darkGrey,
52 child: Text(
53 isRTL ? endText : startText,
54 style: Theme.of(context).textTheme.titleMedium?.copyWith(
55 fontSize: 11.sp,
57 fontWeight: FontWeight.w600,
58 ),
59 ),
60 ),
61 endChild: Shimmer.fromColors(
62 direction: isRTL ? ShimmerDirection.ltr : ShimmerDirection.rtl,
63 baseColor: ColorPalette.grey,
64 highlightColor: ColorPalette.darkGrey,
65 child: Text(
66 isRTL ? startText : endText,
67 style: Theme.of(context).textTheme.titleMedium?.copyWith(
68 fontSize: 11.sp,
70 fontWeight: FontWeight.w600,
71 ),
72 ),
73 ),
74 startAction: isRTL ? endAction : startAction,
75 endAction: isRTL ? startAction : endAction,
76 );
77 }
78}
static const darkGrey
static const black
static const white
static const grey
final dynamic Function(ActionSliderController)? endAction
const CustomDualSlider({ super.key, required this.startText, required this.endText, required this.startAction, required this.endAction, })
final Widget child
override Widget build(BuildContext context)
final dynamic Function(ActionSliderController)? startAction
class Partner String
style Text( '${ 'scheduling.reference'.tr()}:${collection.internalCode}', style:Theme.of(context).textTheme.bodySmall,)