From aca2722ee4adfb762a024972702e61a1d6d46815 Mon Sep 17 00:00:00 2001 From: Vaibhav Surve Date: Sat, 31 May 2025 16:46:10 +0530 Subject: [PATCH] refactor: Update Checkbox fill color handling and enhance agreement toggle interaction --- lib/view/auth/login_screen.dart | 12 +++++- lib/view/auth/request_demo_bottom_sheet.dart | 39 ++++++++++++-------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/lib/view/auth/login_screen.dart b/lib/view/auth/login_screen.dart index c3c6bb5..0c7f0e7 100644 --- a/lib/view/auth/login_screen.dart +++ b/lib/view/auth/login_screen.dart @@ -123,7 +123,17 @@ class _LoginScreenState extends State with UIMixin { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4), ), - fillColor: WidgetStatePropertyAll(contentTheme.secondary), + fillColor: MaterialStateProperty + .resolveWith( + (Set states) { + if (states + .contains(WidgetState.selected)) { + return Colors.blueAccent; + } + return Colors + .white; + }, + ), checkColor: contentTheme.onPrimary, visualDensity: getCompactDensity, materialTapTargetSize: diff --git a/lib/view/auth/request_demo_bottom_sheet.dart b/lib/view/auth/request_demo_bottom_sheet.dart index ffed24c..24c1dd6 100644 --- a/lib/view/auth/request_demo_bottom_sheet.dart +++ b/lib/view/auth/request_demo_bottom_sheet.dart @@ -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(