Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
detail_item.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';
4
5import '../../../../../../../core/ui/theme/color_palette.dart';
6
7class DetailItem extends StatelessWidget {
8 final String title;
9 final String? subtitle;
10 final String value;
11 final bool isReference;
12 final IconData? icon;
13 final bool isEditable;
14 final Function(String)? onValueChanged;
15
16 const DetailItem({
17 super.key,
18 required this.title,
19 this.subtitle,
20 required this.value,
21 this.isReference = false,
22 this.icon,
23 this.isEditable = false,
24 this.onValueChanged,
25 });
26
27 @override
28 Widget build(BuildContext context) {
29 return Column(
30 crossAxisAlignment: CrossAxisAlignment.start,
31 children: [
32 Row(
33 children: [
34 if (icon != null) ...[
35 Icon(icon, size: 20.sp, color: Colors.grey[600]),
36 SizedBox(width: 4.sp),
37 ],
38 Text(
39 title,
40 style: Theme.of(context).textTheme.titleSmall!.copyWith(
42 // fontSize: 12.sp,
43 ),
44 ),
45 ],
46 ),
47 if (subtitle != null)
48 Padding(
49 padding: EdgeInsets.only(top: 4.sp),
50 child: Text(
51 subtitle!,
52 style: Theme.of(context).textTheme.bodySmall!.copyWith(
53 color: Colors.grey[600],
54 fontSize: 12.sp,
55 ),
56 ),
57 ),
58 const SizedBox(height: 8),
59 Container(
60 width: double.infinity,
61 padding: EdgeInsets.symmetric(horizontal: 16.sp, vertical: 12.sp),
62 decoration: BoxDecoration(
64 borderRadius: BorderRadius.circular(12),
65 border: Border.all(color: Colors.grey[200]!),
66 ),
68 ? TextFormField(
69 initialValue: value.replaceAll(' L', ''),
70 keyboardType: TextInputType.number,
71 style: Theme.of(context).textTheme.bodySmall!.copyWith(
73 fontWeight: FontWeight.w500,
74 ),
75 decoration: InputDecoration(
76 border: InputBorder.none,
77 contentPadding: EdgeInsets.zero,
78 isDense: true,
79 suffix: Icon(
80 FluentIcons.edit_12_regular,
81 size: 13.sp,
82 color: Colors.grey,
83 ),
84 ),
85 onChanged: (newValue) {
86 if (onValueChanged != null) {
87 onValueChanged!(newValue);
88 }
89 },
90 )
91 : Text(
92 value,
93 style: Theme.of(context).textTheme.bodySmall!.copyWith(
94 color: isReference
95 ? ColorPalette.blue.withValues(alpha:0.9)
97 fontWeight:
98 isReference ? FontWeight.w600 : FontWeight.w500,
99 ),
100 ),
101 ),
102 ],
103 );
104 }
105}
static const darkGrey
static const black
static const lightGrey
static const white
static const blue
static const grey
final String title
final Widget child
final ValueChanged< int?> onChanged
final bool isReference
override Widget build(BuildContext context)
final TextInputType keyboardType
const DetailItem({ super.key, required this.title, this.subtitle, required this.value, this.isReference=false, this.icon, this.isEditable=false, this.onValueChanged, })
final Function(String)? onValueChanged
final EdgeInsets padding
final String subtitle
final bool isEditable
final String subtitle
class Partner String
final Color color
Definition failures.dart:1
final String title
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,),),),],)