11import "package:flutter/material.dart" ;
22import "package:flutter_svg/flutter_svg.dart" ;
3+ import "package:frontend/common/shared_functions.dart" ;
34import "package:frontend/exports.dart" ;
45import "package:provider/provider.dart" ;
56
6- class SettingsRow extends StatelessWidget {
7+ class SettingsRow extends StatefulWidget {
78 const SettingsRow ({
89 super .key,
910 this .chose,
@@ -19,10 +20,16 @@ class SettingsRow extends StatelessWidget {
1920 final Widget ? choseDiffWidget;
2021 final void Function (bool )? onChanged;
2122
23+ @override
24+ State <SettingsRow > createState () => _SettingsRowState ();
25+ }
26+
27+ class _SettingsRowState extends State <SettingsRow > {
2228 @override
2329 Widget build (BuildContext context) {
2430 final scheme = Theme .of (context).colorScheme;
2531 final isPro = context.watch <ProVersionProvider >().isPro;
32+ final isTablet = SharedFunctions .isTablet (context);
2633 return Padding (
2734 padding: const EdgeInsets .only (bottom: 8 ),
2835 child: SizedBox (
@@ -33,17 +40,16 @@ class SettingsRow extends StatelessWidget {
3340 Row (
3441 children: [
3542 Text (
36- text,
43+ widget. text,
3744 style: TextStyles .body2.copyWith (
3845 color: isPro ? scheme.primary : ColorsConst .disabledColor,
46+ fontSize: isTablet ? 25 : 16 ,
3947 ),
4048 ),
41- const SizedBox (
42- width: 10 ,
43- ),
49+ SizedBox (width: isTablet ? 16 : 10 ),
4450 ProFunctionsTooltip (
4551 isPro: isPro,
46- modalHeader: modalHeader,
52+ modalHeader: widget. modalHeader,
4753 child: SvgPicture .asset (
4854 "assets/images/icons/question_icon.svg" ,
4955 colorFilter: ColorFilter .mode (
@@ -57,17 +63,22 @@ class SettingsRow extends StatelessWidget {
5763 ),
5864 Theme (
5965 data: ThemeData (useMaterial3: false ),
60- child: Switch (
61- materialTapTargetSize: MaterialTapTargetSize .shrinkWrap,
62- value: isPro ? chose! : false ,
63- inactiveThumbColor:
64- isPro ? scheme.surfaceTint : ColorsConst .disabledColor,
65- inactiveTrackColor: scheme.outline,
66- activeColor: scheme.inversePrimary,
67- activeTrackColor: ColorsConst .primaryColor100,
68- onChanged: onChanged,
66+ child: ProFunctionsTooltip (
67+ isPro: isPro,
68+ modalHeader: widget.modalHeader,
69+ child: Switch (
70+ materialTapTargetSize: MaterialTapTargetSize .shrinkWrap,
71+ value: isPro ? widget.chose! : false ,
72+ inactiveThumbColor:
73+ isPro ? scheme.surfaceTint : ColorsConst .disabledColor,
74+ inactiveTrackColor: scheme.outline,
75+ activeColor: scheme.inversePrimary,
76+ activeTrackColor: ColorsConst .primaryColor100,
77+ onChanged:
78+ isPro ? (value) => widget.onChanged? .call (value) : null ,
79+ ),
6980 ),
70- )
81+ ),
7182 ],
7283 ),
7384 ),
0 commit comments