Skip to content

Commit 15470e2

Browse files
committed
feat: Tambahkan menu user registration setting di halaman setting_page.dart
1 parent b0ec53d commit 15470e2

File tree

1 file changed

+62
-218
lines changed

1 file changed

+62
-218
lines changed

lib/feature/presentation/page/setting/setting_page.dart

Lines changed: 62 additions & 218 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import 'package:dipantau_desktop_client/feature/presentation/page/setting_discor
1616
import 'package:dipantau_desktop_client/feature/presentation/page/setting_member_blur_screenshot/setting_member_blur_screenshot_page.dart';
1717
import 'package:dipantau_desktop_client/feature/presentation/page/setup_credential/setup_credential_page.dart';
1818
import 'package:dipantau_desktop_client/feature/presentation/page/splash/splash_page.dart';
19+
import 'package:dipantau_desktop_client/feature/presentation/page/user_registration_setting/user_registration_setting_page.dart';
1920
import 'package:dipantau_desktop_client/feature/presentation/widget/widget_custom_circular_progress_indicator.dart';
2021
import 'package:dipantau_desktop_client/feature/presentation/widget/widget_primary_button.dart';
2122
import 'package:dipantau_desktop_client/feature/presentation/widget/widget_theme_container.dart';
@@ -732,6 +733,8 @@ class _SettingPageState extends State<SettingPage> {
732733
buildWidgetDiscordChannelId(),
733734
const SizedBox(height: 16),
734735
buildWidgetMemberBlurScreenshot(),
736+
const SizedBox(height: 16),
737+
buildWidgetUserRegistration(),
735738
],
736739
);
737740
}
@@ -775,54 +778,17 @@ class _SettingPageState extends State<SettingPage> {
775778
}
776779

777780
Widget buildWidgetSetHostName() {
778-
return Row(
779-
crossAxisAlignment: CrossAxisAlignment.start,
780-
children: [
781-
Expanded(
782-
child: Column(
783-
crossAxisAlignment: CrossAxisAlignment.start,
784-
children: [
785-
Text(
786-
'hostname'.tr(),
787-
style: Theme.of(context).textTheme.bodyLarge,
788-
),
789-
Text(
790-
hostname,
791-
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
792-
color: Colors.grey,
793-
),
794-
maxLines: 1,
795-
overflow: TextOverflow.ellipsis,
796-
),
797-
],
798-
),
799-
),
800-
const SizedBox(width: 16),
801-
InkWell(
802-
borderRadius: BorderRadius.circular(999),
803-
onTap: () {
804-
context.pushNamed(
805-
SetupCredentialPage.routeName,
806-
extra: {
807-
SetupCredentialPage.parameterIsShowWarning: true,
808-
},
809-
);
781+
return buildWidgetItemSettingArrow(
782+
'hostname'.tr(),
783+
hostname,
784+
onTap: () {
785+
context.pushNamed(
786+
SetupCredentialPage.routeName,
787+
extra: {
788+
SetupCredentialPage.parameterIsShowWarning: true,
810789
},
811-
child: Container(
812-
padding: const EdgeInsets.symmetric(
813-
horizontal: 16,
814-
vertical: 8,
815-
),
816-
decoration: BoxDecoration(
817-
borderRadius: BorderRadius.circular(999),
818-
),
819-
child: const Icon(
820-
Icons.keyboard_arrow_right,
821-
color: Colors.grey,
822-
),
823-
),
824-
),
825-
],
790+
);
791+
},
826792
);
827793
}
828794

@@ -1179,188 +1145,58 @@ class _SettingPageState extends State<SettingPage> {
11791145
}
11801146

11811147
Widget buildWidgetMember() {
1182-
return Row(
1183-
crossAxisAlignment: CrossAxisAlignment.start,
1184-
children: [
1185-
Expanded(
1186-
child: Column(
1187-
crossAxisAlignment: CrossAxisAlignment.start,
1188-
children: [
1189-
Text(
1190-
'members'.tr(),
1191-
style: Theme.of(context).textTheme.bodyLarge,
1192-
),
1193-
Text(
1194-
'add_edit_or_remove_member'.tr(),
1195-
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
1196-
color: Colors.grey,
1197-
),
1198-
),
1199-
],
1200-
),
1201-
),
1202-
const SizedBox(width: 16),
1203-
InkWell(
1204-
borderRadius: BorderRadius.circular(999),
1205-
onTap: () {
1206-
context.pushNamed(MemberSettingPage.routeName);
1207-
},
1208-
child: Container(
1209-
padding: const EdgeInsets.symmetric(
1210-
horizontal: 16,
1211-
vertical: 8,
1212-
),
1213-
decoration: BoxDecoration(
1214-
borderRadius: BorderRadius.circular(999),
1215-
),
1216-
child: const Icon(
1217-
Icons.keyboard_arrow_right,
1218-
color: Colors.grey,
1219-
),
1220-
),
1221-
),
1222-
],
1148+
return buildWidgetItemSettingArrow(
1149+
'members'.tr(),
1150+
'add_edit_or_remove_member'.tr(),
1151+
onTap: () {
1152+
context.pushNamed(MemberSettingPage.routeName);
1153+
},
12231154
);
12241155
}
12251156

12261157
Widget buildWidgetProject() {
1227-
return Row(
1228-
crossAxisAlignment: CrossAxisAlignment.start,
1229-
children: [
1230-
Expanded(
1231-
child: Column(
1232-
crossAxisAlignment: CrossAxisAlignment.start,
1233-
children: [
1234-
Text(
1235-
'projects'.tr(),
1236-
style: Theme.of(context).textTheme.bodyLarge,
1237-
),
1238-
Text(
1239-
'add_edit_or_remove_project'.tr(),
1240-
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
1241-
color: Colors.grey,
1242-
),
1243-
),
1244-
],
1245-
),
1246-
),
1247-
const SizedBox(width: 16),
1248-
InkWell(
1249-
borderRadius: BorderRadius.circular(999),
1250-
onTap: () {
1251-
// TODO: Arahkan ke halaman project_setting_page.dart
1252-
widgetHelper.showSnackBar(context, 'coming_soon'.tr());
1253-
},
1254-
child: Container(
1255-
padding: const EdgeInsets.symmetric(
1256-
horizontal: 16,
1257-
vertical: 8,
1258-
),
1259-
decoration: BoxDecoration(
1260-
borderRadius: BorderRadius.circular(999),
1261-
),
1262-
child: const Icon(
1263-
Icons.keyboard_arrow_right,
1264-
color: Colors.grey,
1265-
),
1266-
),
1267-
),
1268-
],
1158+
return buildWidgetItemSettingArrow(
1159+
'projects'.tr(),
1160+
'add_edit_or_remove_project'.tr(),
1161+
onTap: () {
1162+
// TODO: Arahkan ke halaman project_setting_page.dart
1163+
widgetHelper.showSnackBar(context, 'coming_soon'.tr());
1164+
},
12691165
);
12701166
}
12711167

12721168
Widget buildWidgetTask() {
1273-
return Row(
1274-
crossAxisAlignment: CrossAxisAlignment.start,
1275-
children: [
1276-
Expanded(
1277-
child: Column(
1278-
crossAxisAlignment: CrossAxisAlignment.start,
1279-
children: [
1280-
Text(
1281-
'tasks_2'.tr(),
1282-
style: Theme.of(context).textTheme.bodyLarge,
1283-
),
1284-
Text(
1285-
'add_edit_or_remove_task'.tr(),
1286-
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
1287-
color: Colors.grey,
1288-
),
1289-
),
1290-
],
1291-
),
1292-
),
1293-
const SizedBox(width: 16),
1294-
InkWell(
1295-
borderRadius: BorderRadius.circular(999),
1296-
onTap: () {
1297-
// TODO: Arahkan ke halaman task_setting_page.dart
1298-
widgetHelper.showSnackBar(context, 'coming_soon'.tr());
1299-
},
1300-
child: Container(
1301-
padding: const EdgeInsets.symmetric(
1302-
horizontal: 16,
1303-
vertical: 8,
1304-
),
1305-
decoration: BoxDecoration(
1306-
borderRadius: BorderRadius.circular(999),
1307-
),
1308-
child: const Icon(
1309-
Icons.keyboard_arrow_right,
1310-
color: Colors.grey,
1311-
),
1312-
),
1313-
),
1314-
],
1169+
return buildWidgetItemSettingArrow(
1170+
'tasks_2'.tr(),
1171+
'add_edit_or_remove_task'.tr(),
1172+
onTap: () {
1173+
// TODO: Arahkan ke halaman task_setting_page.dart
1174+
widgetHelper.showSnackBar(context, 'coming_soon'.tr());
1175+
},
13151176
);
13161177
}
13171178

13181179
Widget buildWidgetDiscordChannelId() {
1319-
return Row(
1320-
crossAxisAlignment: CrossAxisAlignment.start,
1321-
children: [
1322-
Expanded(
1323-
child: Column(
1324-
crossAxisAlignment: CrossAxisAlignment.start,
1325-
children: [
1326-
Text(
1327-
'discord_channel_id'.tr(),
1328-
style: Theme.of(context).textTheme.bodyLarge,
1329-
),
1330-
Text(
1331-
'subtitle_discord_channel_id'.tr(),
1332-
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
1333-
color: Colors.grey,
1334-
),
1335-
),
1336-
],
1337-
),
1338-
),
1339-
const SizedBox(width: 16),
1340-
InkWell(
1341-
borderRadius: BorderRadius.circular(999),
1342-
onTap: () {
1343-
context.pushNamed(SettingDiscordPage.routeName);
1344-
},
1345-
child: Container(
1346-
padding: const EdgeInsets.symmetric(
1347-
horizontal: 16,
1348-
vertical: 8,
1349-
),
1350-
decoration: BoxDecoration(
1351-
borderRadius: BorderRadius.circular(999),
1352-
),
1353-
child: const Icon(
1354-
Icons.keyboard_arrow_right,
1355-
color: Colors.grey,
1356-
),
1357-
),
1358-
),
1359-
],
1180+
return buildWidgetItemSettingArrow(
1181+
'discord_channel_id'.tr(),
1182+
'subtitle_discord_channel_id'.tr(),
1183+
onTap: () {
1184+
context.pushNamed(SettingDiscordPage.routeName);
1185+
},
13601186
);
13611187
}
13621188

13631189
Widget buildWidgetMemberBlurScreenshot() {
1190+
return buildWidgetItemSettingArrow(
1191+
'screenshot_blur'.tr(),
1192+
'subtitle_screenshot_blur'.tr(),
1193+
onTap: () {
1194+
context.pushNamed(SettingMemberBlurScreenshotPage.routeName);
1195+
},
1196+
);
1197+
}
1198+
1199+
Widget buildWidgetItemSettingArrow(String title, String subtitle, {Function()? onTap}) {
13641200
return Row(
13651201
crossAxisAlignment: CrossAxisAlignment.start,
13661202
children: [
@@ -1369,11 +1205,11 @@ class _SettingPageState extends State<SettingPage> {
13691205
crossAxisAlignment: CrossAxisAlignment.start,
13701206
children: [
13711207
Text(
1372-
'screenshot_blur'.tr(),
1208+
title,
13731209
style: Theme.of(context).textTheme.bodyLarge,
13741210
),
13751211
Text(
1376-
'subtitle_screenshot_blur'.tr(),
1212+
subtitle,
13771213
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
13781214
color: Colors.grey,
13791215
),
@@ -1384,9 +1220,7 @@ class _SettingPageState extends State<SettingPage> {
13841220
const SizedBox(width: 16),
13851221
InkWell(
13861222
borderRadius: BorderRadius.circular(999),
1387-
onTap: () {
1388-
context.pushNamed(SettingMemberBlurScreenshotPage.routeName);
1389-
},
1223+
onTap: onTap,
13901224
child: Container(
13911225
padding: const EdgeInsets.symmetric(
13921226
horizontal: 16,
@@ -1405,6 +1239,16 @@ class _SettingPageState extends State<SettingPage> {
14051239
);
14061240
}
14071241

1242+
Widget buildWidgetUserRegistration() {
1243+
return buildWidgetItemSettingArrow(
1244+
'user_registration'.tr(),
1245+
'subtitle_user_registration'.tr(),
1246+
onTap: () {
1247+
context.pushNamed(UserRegistrationSettingPage.routeName);
1248+
},
1249+
);
1250+
}
1251+
14081252
void updateReminderTrack() async {
14091253
final isEnableReminderNotTrack = valueNotifierIsEnableReminderTrack.value;
14101254
await sharedPreferencesManager.putBool(SharedPreferencesManager.keyIsEnableReminderTrack, isEnableReminderNotTrack);

0 commit comments

Comments
 (0)