TF-2311 Sync use variables in BaseController to avoid wasting memory

Signed-off-by: dab246 <tdvu@linagora.com>

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit 21ac80615f7bc9e832fd72cb8ae6875c967d3cea)
This commit is contained in:
dab246
2023-11-14 17:33:17 +07:00
committed by Dat Vu
parent 4ff601b4fc
commit fb47832225
57 changed files with 727 additions and 958 deletions
@@ -1,6 +1,5 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/presentation/utils/responsive_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_portal/flutter_portal.dart';
import 'package:get/get.dart';
@@ -12,24 +11,22 @@ import 'package:tmail_ui_user/main/utils/app_utils.dart';
class LanguageAndRegionView extends GetWidget<LanguageAndRegionController> {
final _responsiveUtils = Get.find<ResponsiveUtils>();
LanguageAndRegionView({Key? key}) : super(key: key);
const LanguageAndRegionView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Portal(
child: Scaffold(
backgroundColor: _responsiveUtils.isWebDesktop(context)
backgroundColor: controller.responsiveUtils.isWebDesktop(context)
? AppColor.colorBgDesktop
: Colors.white,
body: Container(
width: double.infinity,
margin: _responsiveUtils.isWebDesktop(context)
margin: controller.responsiveUtils.isWebDesktop(context)
? const EdgeInsets.all(24)
: EdgeInsets.symmetric(horizontal: SettingsUtils.getHorizontalPadding(context, _responsiveUtils)),
color: _responsiveUtils.isWebDesktop(context) ? null : Colors.white,
decoration: _responsiveUtils.isWebDesktop(context)
: EdgeInsets.symmetric(horizontal: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils)),
color: controller.responsiveUtils.isWebDesktop(context) ? null : Colors.white,
decoration: controller.responsiveUtils.isWebDesktop(context)
? BoxDecoration(
borderRadius: BorderRadius.circular(20),
border: Border.all(color: AppColor.colorBorderBodyThread, width: 1),
@@ -37,15 +34,15 @@ class LanguageAndRegionView extends GetWidget<LanguageAndRegionController> {
: null,
child: ClipRRect(
borderRadius: BorderRadius.circular(
_responsiveUtils.isWebDesktop(context) ? 20 : 0),
controller.responsiveUtils.isWebDesktop(context) ? 20 : 0),
child: Padding(
padding: EdgeInsets.only(
right: AppUtils.isDirectionRTL(context)
? _responsiveUtils.isWebDesktop(context) ? 24 : 0
? controller.responsiveUtils.isWebDesktop(context) ? 24 : 0
: 0,
left: AppUtils.isDirectionRTL(context)
? 0
: _responsiveUtils.isWebDesktop(context) ? 24 : 0,
: controller.responsiveUtils.isWebDesktop(context) ? 24 : 0,
top: 24
),
child: Column(