TF-3678 Support accessibility for Set as default identity checkbox
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class CheckboxSemantics extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
final String label;
|
||||||
|
final bool value;
|
||||||
|
|
||||||
|
const CheckboxSemantics({
|
||||||
|
super.key,
|
||||||
|
required this.child,
|
||||||
|
required this.label,
|
||||||
|
required this.value,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Semantics(
|
||||||
|
label: label,
|
||||||
|
container: true,
|
||||||
|
checked: true,
|
||||||
|
value: '$value',
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
-5
@@ -1,5 +1,6 @@
|
|||||||
import 'package:core/presentation/extensions/color_extension.dart';
|
import 'package:core/presentation/extensions/color_extension.dart';
|
||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
|
import 'package:core/presentation/views/semantics/checkbox_semantics.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||||
@@ -23,10 +24,14 @@ class SetDefaultIdentityCheckboxBuilder extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Material(
|
CheckboxSemantics(
|
||||||
child: InkWell(
|
label: 'Set default identity checkbox',
|
||||||
onTap: onCheckboxChanged,
|
value: isCheck,
|
||||||
child: Container(
|
child: Material(
|
||||||
|
type: MaterialType.transparency,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: onCheckboxChanged,
|
||||||
|
child: Container(
|
||||||
width: 20,
|
width: 20,
|
||||||
height: 20,
|
height: 20,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@@ -39,7 +44,9 @@ class SetDefaultIdentityCheckboxBuilder extends StatelessWidget {
|
|||||||
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||||
width: 18,
|
width: 18,
|
||||||
height: 18,
|
height: 18,
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
|
|||||||
Reference in New Issue
Block a user