Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
terms_and_conditions_checkbox.dart
Go to the documentation of this file.
1import 'package:connect/core/localization/app_localizations.dart';
2import 'package:flutter/gestures.dart';
3import 'package:flutter/material.dart';
4import 'package:flutter_screenutil/flutter_screenutil.dart';
5
6import '/core/ui/widgets/custom_card.dart';
7
8import '/features/settings/presentation/settings_screen/widgets/privacy_policy.dart';
9import '/features/settings/presentation/settings_screen/widgets/terms_of_use.dart';
10
11class TermsAndConditionsCheckbox extends StatelessWidget {
13 super.key,
14 required this.isChecked,
15 required this.onCheckStatuschanged,
16 });
17
18 final bool isChecked;
19 final Function(bool? value) onCheckStatuschanged;
20
21 @override
22 Widget build(BuildContext context) {
23 return Row(
24 children: [
25 Checkbox(
27 onChanged: onCheckStatuschanged,
28 shape: RoundedRectangleBorder(
29 borderRadius: BorderRadius.circular(80),
30 ),
31 ),
32 Expanded(
33 child: RichText(
34 text: TextSpan(
35 style: Theme.of(context).textTheme.bodySmall?.copyWith(
36 color: Theme.of(context).hintColor,
37 fontSize: 11.5.sp,
38 ),
39 text:
40 "${AppLocalizations.of(context).translate('I have read and accept the')} ",
41 children: [
42 TextSpan(
43 text:
44 "${AppLocalizations.of(context).translate('Terms of use')} \n",
45 style: Theme.of(context).textTheme.bodySmall?.copyWith(
46 color: Theme.of(context).colorScheme.secondary,
47 fontSize: 11.sp,
48 ),
49 recognizer: TapGestureRecognizer()
50 ..onTap = () {
51 //TODO: REPLACE WITH REAL LINK
53 padding: EdgeInsets.all(15.sp),
54 body: TermsOfUseDisplayer(),
55 context: context,
56 );
57 },
58 ),
59 TextSpan(
60 text: " ${AppLocalizations.of(context).translate('and')} "),
61 TextSpan(
62 text:
63 AppLocalizations.of(context).translate('Privacy Policy'),
64 style: Theme.of(context).textTheme.bodySmall?.copyWith(
65 color: Theme.of(context).colorScheme.secondary,
66 fontSize: 11.sp,
67 ),
68 recognizer: TapGestureRecognizer()
69 ..onTap = () {
70 //TODO: REPLACE WITH REAL LINK
72 padding: EdgeInsets.all(15.sp),
74 context: context,
75 );
76 },
77 ),
78 const TextSpan(text: "."),
79 ],
80 ),
81 ),
82 ),
83 ],
84 );
85 }
86
88 required Widget body,
89 required BuildContext context,
90 EdgeInsets? padding,
91 }) {
92 return showModalBottomSheet(
93 context: context,
94 isScrollControlled: true,
95 backgroundColor: Colors.transparent,
96 builder: (context) => Padding(
97 padding: EdgeInsets.all(10.sp),
100 child: body,
101 ),
102 ),
103 );
104 }
105}
String translate(String key)
static AppLocalizations of(BuildContext context)
final Function(bool? value) onCheckStatuschanged
final VoidCallback onTap
const TermsAndConditionsCheckbox({ super.key, required this.isChecked, required this.onCheckStatuschanged, })
final Widget child
override Widget build(BuildContext context)
_buildBottomSheet({ required Widget body, required BuildContext context, EdgeInsets? padding, })
const PrivacyPolicyDisplayer({super.key})
const TermsOfUseDisplayer({super.key})
final Widget child
class CustomCard extends StatelessWidget GlassCustomCard({ super.key, required this.child, this.padding, })
final EdgeInsets padding
final Color backgroundColor