refactor: Update Checkbox fill color handling and enhance agreement toggle interaction
This commit is contained in:
parent
706726c787
commit
aca2722ee4
@ -123,7 +123,17 @@ class _LoginScreenState extends State<LoginScreen> with UIMixin {
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
fillColor: WidgetStatePropertyAll(contentTheme.secondary),
|
||||
fillColor: MaterialStateProperty
|
||||
.resolveWith<Color>(
|
||||
(Set<WidgetState> states) {
|
||||
if (states
|
||||
.contains(WidgetState.selected)) {
|
||||
return Colors.blueAccent;
|
||||
}
|
||||
return Colors
|
||||
.white;
|
||||
},
|
||||
),
|
||||
checkColor: contentTheme.onPrimary,
|
||||
visualDensity: getCompactDensity,
|
||||
materialTapTargetSize:
|
||||
|
@ -147,22 +147,29 @@ class _OrganizationFormState extends State<_OrganizationForm> {
|
||||
'Please select industry',
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: _agreed,
|
||||
onChanged: (val) => setState(() => _agreed = val ?? false),
|
||||
fillColor: MaterialStateProperty.all(Colors.white),
|
||||
checkColor: Colors.white,
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
(states) =>
|
||||
BorderSide(color: Colors.blueAccent, width: 2),
|
||||
),
|
||||
),
|
||||
const Expanded(
|
||||
child: Text('I agree to privacy policy & terms')),
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () => setState(() => _agreed = !_agreed),
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: _agreed,
|
||||
onChanged: (val) => setState(() => _agreed = val ?? false),
|
||||
fillColor: MaterialStateProperty.resolveWith((states) {
|
||||
if (states.contains(MaterialState.selected)) {
|
||||
return Colors.blueAccent;
|
||||
}
|
||||
return Colors.white;
|
||||
}),
|
||||
checkColor: Colors.white,
|
||||
side: const BorderSide(color: Colors.blueAccent, width: 2),
|
||||
),
|
||||
const Expanded(
|
||||
child: Text('I agree to privacy policy & terms'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 10),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
Loading…
x
Reference in New Issue
Block a user