TF-460 Create ProfilesView and IdentitiesView
This commit is contained in:
@@ -62,6 +62,7 @@ export 'presentation/views/bottom_popup/confirmation_dialog_action_sheet_builder
|
||||
export 'presentation/views/modal_sheets/edit_text_modal_sheet_builder.dart';
|
||||
export 'presentation/views/search/search_bar_view.dart';
|
||||
export 'presentation/views/popup_menu/popup_menu_item_widget.dart';
|
||||
export 'presentation/views/tab_bar/custom_tab_indicator.dart';
|
||||
|
||||
// Resources
|
||||
export 'presentation/resources/assets_paths.dart';
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
enum CustomIndicatorSize {
|
||||
tiny,
|
||||
normal,
|
||||
full,
|
||||
}
|
||||
|
||||
class CustomIndicator extends Decoration {
|
||||
final double indicatorHeight;
|
||||
final Color indicatorColor;
|
||||
final CustomIndicatorSize indicatorSize;
|
||||
|
||||
const CustomIndicator({
|
||||
required this.indicatorHeight,
|
||||
required this.indicatorColor,
|
||||
required this.indicatorSize
|
||||
});
|
||||
|
||||
@override
|
||||
_CustomPainter createBoxPainter([VoidCallback? onChanged]) {
|
||||
return new _CustomPainter(this, onChanged);
|
||||
}
|
||||
}
|
||||
|
||||
class _CustomPainter extends BoxPainter {
|
||||
final CustomIndicator decoration;
|
||||
|
||||
_CustomPainter(this.decoration, VoidCallback? onChanged) : super(onChanged);
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Offset offset, ImageConfiguration configuration) {
|
||||
assert(configuration.size != null);
|
||||
|
||||
Rect? rect;
|
||||
if (decoration.indicatorSize == CustomIndicatorSize.full) {
|
||||
rect = Offset(offset.dx,
|
||||
(configuration.size!.height - decoration.indicatorHeight)) &
|
||||
Size(configuration.size!.width, decoration.indicatorHeight);
|
||||
} else if (decoration.indicatorSize == CustomIndicatorSize.normal) {
|
||||
rect = Offset(offset.dx + 6,
|
||||
(configuration.size!.height - decoration.indicatorHeight)) &
|
||||
Size(configuration.size!.width - 12, decoration.indicatorHeight);
|
||||
} else if (decoration.indicatorSize == CustomIndicatorSize.tiny) {
|
||||
rect = Offset(offset.dx + configuration.size!.width / 2 - 8,
|
||||
(configuration.size!.height - decoration.indicatorHeight)) &
|
||||
Size(16, decoration.indicatorHeight);
|
||||
}
|
||||
|
||||
if (rect != null) {
|
||||
final Paint paint = Paint();
|
||||
paint.color = decoration.indicatorColor;
|
||||
paint.style = PaintingStyle.fill;
|
||||
canvas.drawRRect(
|
||||
RRect.fromRectAndCorners(rect,
|
||||
topRight: Radius.circular(8),
|
||||
topLeft: Radius.circular(8)),
|
||||
paint);
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/content/manage_account_content_controller.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/account_properties/profiles/identities/identities_controller.dart';
|
||||
|
||||
class ManageAccountContentBindings extends BaseBindings {
|
||||
class IdentitiesBindings extends BaseBindings {
|
||||
|
||||
@override
|
||||
void bindingsController() {
|
||||
Get.lazyPut(() => ManageAccountContentController());
|
||||
Get.lazyPut(() => IdentitiesController());
|
||||
}
|
||||
|
||||
@override
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
|
||||
import 'package:tmail_ui_user/features/base/base_controller.dart';
|
||||
|
||||
class ManageAccountContentController extends BaseController {
|
||||
class IdentitiesController extends BaseController {
|
||||
|
||||
@override
|
||||
void onDone() {
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/account_properties/profiles/identities/identities_controller.dart';
|
||||
|
||||
class IdentitiesView extends GetWidget<IdentitiesController> {
|
||||
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
|
||||
IdentitiesView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(color: Colors.green);
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/account_properties/profiles/identities/identities_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/account_properties/profiles/profiles_controller.dart';
|
||||
|
||||
class ProfileBindings extends BaseBindings {
|
||||
|
||||
@override
|
||||
void dependencies() {
|
||||
super.dependencies();
|
||||
IdentitiesBindings();
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsController() {
|
||||
Get.lazyPut(() => ProfilesController());
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsDataSource() {
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsDataSourceImpl() {
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsInteractor() {
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsRepository() {
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsRepositoryImpl() {
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_controller.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/profiles_tab_type.dart';
|
||||
|
||||
class ProfilesController extends BaseController {
|
||||
|
||||
final tabTypeSelected = ProfilesTabType.identities.obs;
|
||||
|
||||
@override
|
||||
void onDone() {
|
||||
}
|
||||
|
||||
@override
|
||||
void onError(error) {
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/account_properties/profiles/identities/identities_view.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/account_properties/profiles/profiles_controller.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class ProfilesView extends GetWidget<ProfilesController> {
|
||||
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
|
||||
ProfilesView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: _responsiveUtils.isDesktop(context) ? AppColor.colorBgDesktop : Colors.white,
|
||||
body: Container(
|
||||
margin: _responsiveUtils.isDesktop(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.all(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.normal,
|
||||
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: AppLocalizations.of(context).identities),
|
||||
]),
|
||||
body: TabBarView(
|
||||
children: [
|
||||
IdentitiesView(),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/content/manage_account_content_controller.dart';
|
||||
|
||||
class ManageAccountContentView extends GetWidget<ManageAccountContentController> {
|
||||
|
||||
const ManageAccountContentView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(color: Colors.black);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -2,7 +2,7 @@ import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/credential_repository.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/usecases/get_user_profile_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/content/manage_account_content_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/account_properties/profiles/profiles_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/dashboard/manage_account_dashboard_controller.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/menu/manage_account_menu_bindings.dart';
|
||||
|
||||
@@ -12,7 +12,7 @@ class ManageAccountDashBoardBindings extends BaseBindings {
|
||||
void dependencies() {
|
||||
super.dependencies();
|
||||
ManageAccountMenuBindings().dependencies();
|
||||
ManageAccountContentBindings().dependencies();
|
||||
ProfileBindings().dependencies();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
+40
-3
@@ -1,11 +1,13 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/mixin/user_setting_popup_menu_mixin.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/content/manage_account_content_view.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/account_properties/profiles/profiles_view.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/dashboard/manage_account_dashboard_controller.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/menu/manage_account_menu_view.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/account_property.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
import 'package:tmail_ui_user/main/routes/route_navigation.dart';
|
||||
|
||||
@@ -71,11 +73,23 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(child: ManageAccountMenuView(), width: _responsiveUtils.defaultSizeMenuWidthWeb),
|
||||
const Expanded(child: ManageAccountContentView())
|
||||
Expanded(child: _manageAccountContentView())
|
||||
],
|
||||
))
|
||||
]),
|
||||
mobile: const ManageAccountContentView()
|
||||
mobile: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16, bottom: 16, left: 24, right: 32),
|
||||
child: _buildAppbar(context)),
|
||||
(SearchBarView(_imagePaths)
|
||||
..hintTextSearch(AppLocalizations.of(context).search_emails)
|
||||
..addMargin(const EdgeInsets.only(left: 32, right: 32))
|
||||
..addOnOpenSearchViewAction(() => {}))
|
||||
.build(),
|
||||
Expanded(child: Padding(
|
||||
padding: const EdgeInsets.only(left: 24, right: 24, bottom: 16),
|
||||
child: _manageAccountContentView()))
|
||||
])
|
||||
),
|
||||
]),
|
||||
);
|
||||
@@ -111,4 +125,27 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
||||
const SizedBox(width: 16)
|
||||
]);
|
||||
}
|
||||
|
||||
Widget _buildAppbar(BuildContext context) {
|
||||
return Row(children: [
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(_imagePaths.icMenuDrawer, fit: BoxFit.fill),
|
||||
onTap:() => controller.openMenuDrawer()),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: Text(
|
||||
AppLocalizations.of(context).manage_account,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontSize: 21, color: Colors.black, fontWeight: FontWeight.bold))),
|
||||
]);
|
||||
}
|
||||
|
||||
Widget _manageAccountContentView() {
|
||||
switch(controller.accountPropertySelected.value) {
|
||||
case AccountProperty.profiles:
|
||||
return ProfilesView();
|
||||
default:
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,36 @@ class ManageAccountMenuView extends GetWidget<ManageAccountMenuController> {
|
||||
backgroundColor: Colors.white,
|
||||
body: Column(
|
||||
children: [
|
||||
if (!_responsiveUtils.isDesktop(context))
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: const EdgeInsets.only(top: 16, bottom: 16, left: 16),
|
||||
child: Row(children: [
|
||||
(SloganBuilder(arrangedByHorizontal: true)
|
||||
..setSloganText(AppLocalizations.of(context).app_name)
|
||||
..setSloganTextAlign(TextAlign.center)
|
||||
..setSloganTextStyle(const TextStyle(color: Colors.black, fontSize: 20, fontWeight: FontWeight.bold))
|
||||
..setSizeLogo(24)
|
||||
..setLogo(_imagePaths.icLogoTMail))
|
||||
.build(),
|
||||
Obx(() {
|
||||
if (controller.dashBoardController.appInformation.value != null) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: Text(
|
||||
'v.${controller.dashBoardController.appInformation.value!.version}',
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.w500),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}),
|
||||
])
|
||||
),
|
||||
if (!_responsiveUtils.isDesktop(context))
|
||||
const Divider(color: AppColor.colorDividerMailbox, height: 0.5, thickness: 0.2),
|
||||
Expanded(child: Container(
|
||||
color: _responsiveUtils.isDesktop(context) ? AppColor.colorBgDesktop : Colors.white,
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
enum ProfilesTabType {
|
||||
personalInfo,
|
||||
identities,
|
||||
follower,
|
||||
}
|
||||
|
||||
extension ProfilesTabTypeExtension on ProfilesTabType {
|
||||
|
||||
String getName(BuildContext context) {
|
||||
switch(this) {
|
||||
case ProfilesTabType.personalInfo:
|
||||
return AppLocalizations.of(context).identities;
|
||||
case ProfilesTabType.identities:
|
||||
return AppLocalizations.of(context).identities;
|
||||
case ProfilesTabType.follower:
|
||||
return AppLocalizations.of(context).identities;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"@@last_modified": "2022-04-25T17:48:51.808593",
|
||||
"@@last_modified": "2022-04-25T19:06:15.088714",
|
||||
"initializing_data": "Initializing data...",
|
||||
"@initializing_data": {
|
||||
"type": "text",
|
||||
@@ -1113,5 +1113,11 @@
|
||||
"type": "text",
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
},
|
||||
"identities": "Identities",
|
||||
"@identities": {
|
||||
"type": "text",
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
}
|
||||
}
|
||||
@@ -1168,4 +1168,9 @@ class AppLocalizations {
|
||||
return Intl.message('Profiles',
|
||||
name: 'profiles');
|
||||
}
|
||||
|
||||
String get identities {
|
||||
return Intl.message('Identities',
|
||||
name: 'identities');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user