Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
signature_section.dart
Go to the documentation of this file.
1import 'package:easy_localization/easy_localization.dart';
2import 'package:flutter/material.dart';
3import 'package:flutter_screenutil/flutter_screenutil.dart';
4import 'package:signature/signature.dart';
5
6import '../../../../../../core/ui/theme/color_palette.dart';
7
8class SignatureSection extends StatelessWidget {
9 final bool isDrawingMode;
10 final VoidCallback onDrawingModeToggle;
11 final VoidCallback onClear;
12 final SignatureController controller;
13
15 super.key,
16 required this.isDrawingMode,
17 required this.onDrawingModeToggle,
18 required this.onClear,
19 required this.controller,
20 });
21
22 @override
23 Widget build(BuildContext context) {
24 return Column(
25 crossAxisAlignment: CrossAxisAlignment.start,
26 children: [
27 Row(
28 mainAxisAlignment: MainAxisAlignment.spaceBetween,
29 children: [
30 Text(
31 'full_fill_collection.signature'.tr(),
32 style: Theme.of(context).textTheme.titleSmall?.copyWith(
34 ),
35 ),
36 Row(
37 children: [
38 TextButton(
40 child: Row(
41 children: [
42 Icon(
43 isDrawingMode ? Icons.edit_off : Icons.edit,
45 size: 16.sp,
46 ),
47 SizedBox(width: 4.sp),
48 Text(
49 isDrawingMode ? 'full_fill_collection.exit_drawing'.tr() : 'full_fill_collection.start_drawing'.tr(),
50 style: TextStyle(
51 fontSize: 14.sp,
53 ),
54 ),
55 ],
56 ),
57 ),
58 SizedBox(width: 8.sp),
59 TextButton(
61 child: Row(
62 children: [
63 Icon(Icons.clear, color: ColorPalette.red, size: 16.sp),
64 Text(
65 'full_fill_collection.clear'.tr(),
66 style: TextStyle(
67 fontSize: 14.sp,
69 ),
70 ),
71 ],
72 ),
73 ),
74 ],
75 ),
76 ],
77 ),
78 SizedBox(height: 8.sp),
79 Stack(
80 children: [
81 Container(
82 decoration: BoxDecoration(
83 borderRadius: BorderRadius.circular(20.sp),
84 border: Border.all(
86 ? ColorPalette.darkGreen.withValues(alpha: 0.5)
87 : ColorPalette.grey.withValues(alpha: 0.2)
88 ),
89 color: Colors.white,
90 ),
91 height: 200.sp,
92 child: ClipRRect(
93 borderRadius: BorderRadius.circular(20.sp),
94 child: AbsorbPointer(
95 absorbing: !isDrawingMode,
96 child: Signature(
98 backgroundColor: Colors.white,
99 ),
100 ),
101 ),
102 ),
103 if (!isDrawingMode)
104 Positioned.fill(
105 child: Container(
106 decoration: BoxDecoration(
107 borderRadius: BorderRadius.circular(20.sp),
108 color: Colors.transparent,
109 ),
110 ),
111 ),
112 ],
113 ),
114 ],
115 );
116 }
117}
static const red
static const darkGreen
static const grey
const SignatureSection({ super.key, required this.isDrawingMode, required this.onDrawingModeToggle, required this.onClear, required this.controller, })
final VoidCallback onPressed
final TextEditingController controller
final Widget child
override Widget build(BuildContext context)
final VoidCallback onDrawingModeToggle
final VoidCallback onClear
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,),),),],)