forget password changes & bugs number 10 & 15-18

This commit is contained in:
mohammad
2024-09-02 10:16:28 +03:00
parent 3ff6937116
commit ddcdd4891a
12 changed files with 180 additions and 160 deletions

View File

@ -10,6 +10,7 @@ class DynamicTable extends StatefulWidget {
final BoxDecoration? cellDecoration;
final Size size;
final bool withCheckBox;
final bool withSelectAll;
final bool isEmpty;
final void Function(bool?)? selectAll;
final void Function(int, bool, dynamic)? onRowSelected;
@ -21,6 +22,7 @@ class DynamicTable extends StatefulWidget {
required this.size,
required this.isEmpty,
required this.withCheckBox,
required this.withSelectAll,
this.headerDecoration,
this.cellDecoration,
this.selectAll,
@ -34,6 +36,7 @@ class DynamicTable extends StatefulWidget {
class _DynamicTableState extends State<DynamicTable> {
late List<bool> _selected;
bool _selectAll = false;
@override
void initState() {
@ -54,6 +57,17 @@ class _DynamicTableState extends State<DynamicTable> {
});
}
void _toggleSelectAll(bool? value) {
setState(() {
_selectAll = value ?? false;
_selected = List<bool>.filled(widget.data.length, _selectAll);
if (widget.selectAll != null) {
widget.selectAll!(_selectAll);
}
});
}
@override
Widget build(BuildContext context) {
return Container(
@ -148,7 +162,7 @@ class _DynamicTableState extends State<DynamicTable> {
),
child: Checkbox(
value: _selected.every((element) => element == true),
onChanged: null,
onChanged:widget.withSelectAll?_toggleSelectAll:null,
),
);
}

View File

@ -32,21 +32,19 @@ class CustomWebTextField extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (isRequired)
Row(
children: [
Text(
'* ',
if (isRequired)
Text('* ',
style: Theme.of(context)
.textTheme
.bodyMedium!
.textTheme.bodyMedium!
.copyWith(color: Colors.red),
),
Text(
textFieldName,
style: Theme.of(context)
.textTheme
.bodySmall!
.textTheme.bodySmall!
.copyWith(color: Colors.black, fontSize: 13),
),
],
@ -70,15 +68,17 @@ class CustomWebTextField extends StatelessWidget {
),
Container(
height: height ?? 35,
decoration: containerDecoration
.copyWith(color: const Color(0xFFF5F6F7), boxShadow: [
decoration: containerDecoration.copyWith(
color: const Color(0xFFF5F6F7),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
spreadRadius: 2,
blurRadius: 3,
offset: const Offset(1, 1), // changes position of shadow
),
]),
]
),
child: TextFormField(
validator: validator,
controller: controller,