TF-297 Add LanguageAndRegionView and inject in ManageAccountDashboard
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -8,6 +7,7 @@ import 'package:get/get.dart';
|
||||
import 'package:jmap_dart_client/jmap/identities/identity.dart';
|
||||
import 'package:tmail_ui_user/features/base/mixin/app_loader_mixin.dart';
|
||||
import 'package:tmail_ui_user/features/base/mixin/popup_menu_widget_mixin.dart';
|
||||
import 'package:tmail_ui_user/features/base/widget/drop_down_button_widget.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/profiles/identities/identities_controller.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/profiles/identities/widgets/identity_bottom_sheet_action_tile_builder.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/profiles/identities/widgets/identity_info_tile_builder.dart';
|
||||
@@ -23,49 +23,11 @@ class IdentitiesView extends GetWidget<IdentitiesController> with PopupMenuWidge
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final buttonSelectIdentity = Row(children: [
|
||||
Expanded(child: Obx(() => DropdownButtonHideUnderline(
|
||||
child: DropdownButton2<Identity>(
|
||||
isExpanded: true,
|
||||
hint: Row(
|
||||
children: [
|
||||
Expanded(child: Text(
|
||||
controller.identitySelected.value?.name ?? '',
|
||||
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.normal, color: Colors.black),
|
||||
maxLines: 1,
|
||||
overflow: BuildUtils.isWeb ? null : TextOverflow.ellipsis,
|
||||
)),
|
||||
],
|
||||
),
|
||||
items: controller.listAllIdentities.map((item) => DropdownMenuItem<Identity>(
|
||||
value: item,
|
||||
child: Text(
|
||||
item.name ?? '',
|
||||
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.normal, color: Colors.black),
|
||||
maxLines: 1,
|
||||
overflow: BuildUtils.isWeb ? null : TextOverflow.ellipsis,
|
||||
),
|
||||
)).toList(),
|
||||
value: controller.identitySelected.value,
|
||||
Expanded(child: Obx(() => DropDownButtonWidget<Identity>(
|
||||
items: controller.listAllIdentities,
|
||||
itemSelected: controller.identitySelected.value,
|
||||
onChanged: (newIdentity) => controller.selectIdentity(newIdentity),
|
||||
icon: SvgPicture.asset(_imagePaths.icDropDown),
|
||||
buttonPadding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
buttonDecoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: AppColor.colorInputBorderCreateMailbox, width: 0.5),
|
||||
color: AppColor.colorInputBackgroundCreateMailbox),
|
||||
itemHeight: 44,
|
||||
buttonHeight: 44,
|
||||
selectedItemHighlightColor: Colors.black12,
|
||||
itemPadding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
dropdownMaxHeight: 200,
|
||||
dropdownDecoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.white),
|
||||
dropdownElevation: 4,
|
||||
scrollbarRadius: const Radius.circular(40),
|
||||
scrollbarThickness: 6,
|
||||
),
|
||||
))),
|
||||
supportSelectionIcon: true))),
|
||||
if (!_responsiveUtils.isMobile(context)) const SizedBox(width: 12),
|
||||
if (!_responsiveUtils.isMobile(context))
|
||||
(ButtonBuilder(_imagePaths.icAddIdentity)
|
||||
|
||||
@@ -15,50 +15,61 @@ class ProfilesView extends GetWidget<ProfilesController> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: _responsiveUtils.isDesktop(context) ? AppColor.colorBgDesktop : Colors.white,
|
||||
backgroundColor: _responsiveUtils.isWebDesktop(context)
|
||||
? AppColor.colorBgDesktop
|
||||
: Colors.white,
|
||||
body: Container(
|
||||
margin: _responsiveUtils.isDesktop(context)
|
||||
margin: _responsiveUtils.isWebDesktop(context)
|
||||
? const EdgeInsets.only(left: 48, right: 24, top: 24, bottom: 24)
|
||||
: EdgeInsets.zero,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: _responsiveUtils.isDesktop(context) ? BorderRadius.circular(20) : null,
|
||||
border: _responsiveUtils.isDesktop(context) ? Border.all(color: AppColor.colorBorderBodyThread, width: 1) : null,
|
||||
color: Colors.white),
|
||||
padding: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
||||
child: DefaultTabController(
|
||||
initialIndex: 0,
|
||||
length: 1,
|
||||
child: Scaffold(
|
||||
appBar: TabBar(
|
||||
unselectedLabelColor: AppColor.colorTextButtonHeaderThread,
|
||||
unselectedLabelStyle: const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: AppColor.colorTextButtonHeaderThread),
|
||||
labelStyle: const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColor.primaryColor),
|
||||
labelColor: AppColor.primaryColor,
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
isScrollable: true,
|
||||
indicator: const CustomIndicator(
|
||||
indicatorHeight: 4,
|
||||
indicatorColor: AppColor.primaryColor,
|
||||
indicatorSize: CustomIndicatorSize.full),
|
||||
onTap: (index) {},
|
||||
tabs: [
|
||||
Tab(text: ProfilesTabType.identities.getName(context)),
|
||||
color: _responsiveUtils.isWebDesktop(context) ? null : Colors.white,
|
||||
decoration: _responsiveUtils.isWebDesktop(context)
|
||||
? BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(color: AppColor.colorBorderBodyThread, width: 1),
|
||||
color: Colors.white)
|
||||
: null,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
_responsiveUtils.isWebDesktop(context) ? 20 : 0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
||||
child: DefaultTabController(
|
||||
initialIndex: 0,
|
||||
length: 1,
|
||||
child: Scaffold(
|
||||
appBar: TabBar(
|
||||
unselectedLabelColor: AppColor.colorTextButtonHeaderThread,
|
||||
unselectedLabelStyle: const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: AppColor.colorTextButtonHeaderThread),
|
||||
labelStyle: const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColor.primaryColor),
|
||||
labelColor: AppColor.primaryColor,
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
isScrollable: true,
|
||||
indicator: const CustomIndicator(
|
||||
indicatorHeight: 4,
|
||||
indicatorColor: AppColor.primaryColor,
|
||||
indicatorSize: CustomIndicatorSize.full),
|
||||
onTap: (index) {},
|
||||
tabs: [
|
||||
Tab(text: ProfilesTabType.identities.getName(context)),
|
||||
]),
|
||||
body: Column(children: [
|
||||
const Divider(color: AppColor.colorDividerMailbox, height: 0.5, thickness: 0.2),
|
||||
Expanded(child: TabBarView(
|
||||
children: [
|
||||
IdentitiesView(),
|
||||
],
|
||||
))
|
||||
]),
|
||||
body: Column(children: [
|
||||
const Divider(color: AppColor.colorDividerMailbox, height: 0.5, thickness: 0.2),
|
||||
Expanded(child: TabBarView(
|
||||
children: [
|
||||
IdentitiesView(),
|
||||
],
|
||||
))
|
||||
]),
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user