Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
custom_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 CustomSlider extends StatelessWidget {
10 final String text;
11 final dynamic Function(ActionSliderController)? action;
12
14 super.key,
15 required this.text,
16 required this.action,
17 });
18
19 @override
20 Widget build(BuildContext context) {
21 final bool isRTL = Directionality.of(context) == TextDirection.rtl;
22
23 return ActionSlider.standard(
24 successIcon: const Icon(FluentIcons.checkmark_24_filled, color: ColorPalette.white,),
25 loadingIcon: const CircularProgressIndicator(
26 strokeWidth: 1,
27 valueColor: AlwaysStoppedAnimation<Color>(ColorPalette.white),
28 ),
29 foregroundBorderRadius: BorderRadius.circular(20),
30 backgroundBorderRadius: BorderRadius.circular(20),
31 boxShadow: [
32 BoxShadow(
33 color: ColorPalette.black.withValues(alpha:0.05),
34 blurRadius: 10,
35 offset: const Offset(0, 2),
36 ),
37 ],
38 icon: Icon(
39 isRTL ? FluentIcons.arrow_circle_left_12_filled : FluentIcons.arrow_circle_right_12_filled,
41 size: 24.sp,
42 ),
43 sliderBehavior: SliderBehavior.stretch,
44 backgroundColor: ColorPalette.white,
45 action: action,
46 direction: isRTL ? TextDirection.rtl : TextDirection.ltr,
47 child: Shimmer.fromColors(
48 direction: isRTL? ShimmerDirection.rtl : ShimmerDirection.ltr,
49 baseColor: ColorPalette.grey,
50 highlightColor: ColorPalette.darkGrey,
51 child: Text(
52 text,
53 style: Theme.of(context).textTheme.titleMedium?.copyWith(
55 fontWeight: FontWeight.w600,
56 ),
57 ),
58 ),
59 );
60 }
61}
static const darkGrey
static const black
static const white
static const grey
final String text
final Widget child
override Widget build(BuildContext context)
const CustomSlider({ super.key, required this.text, required this.action, })
final dynamic Function(ActionSliderController)? action
class Partner String
style Text( '${ 'scheduling.reference'.tr()}:${collection.internalCode}', style:Theme.of(context).textTheme.bodySmall,)