Skip to content

Commit d7e0e2f

Browse files
committed
refactor(settings): cleanup unused code
1 parent 99785a4 commit d7e0e2f

File tree

7 files changed

+99
-317
lines changed

7 files changed

+99
-317
lines changed

lib/core/constants/constants.dart

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,6 @@ const String kAppTitle = 'Waterbus';
77
const String kGithubRepo = 'https://github.com/lambiengcode/waterbus';
88
const String kWaterbusDocs = 'https://docs.waterbus.tech';
99

10-
const vietnamese = 'aAeEoOuUiIdDyY';
11-
const String regExpspecialCharacters =
12-
r'(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])';
13-
final vietnameseRegex = <RegExp>[
14-
RegExp('à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ'),
15-
RegExp('À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ'),
16-
RegExp('è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ'),
17-
RegExp('È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ'),
18-
RegExp('ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ'),
19-
RegExp('Ò|Ó|Ọ|Ỏ|Õ|Ô|Ồ|Ố|Ộ|Ổ|Ỗ|Ơ|Ờ|Ớ|Ợ|Ở|Ỡ'),
20-
RegExp('ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ'),
21-
RegExp('Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ'),
22-
RegExp('ì|í|ị|ỉ|ĩ'),
23-
RegExp('Ì|Í|Ị|Ỉ|Ĩ'),
24-
RegExp('đ'),
25-
RegExp('Đ'),
26-
RegExp('ỳ|ý|ỵ|ỷ|ỹ'),
27-
RegExp('Ỳ|Ý|Ỵ|Ỷ|Ỹ'),
28-
RegExp('\u0300|\u0301|\u0303|\u0309|\u0323'),
29-
RegExp('\u02C6|\u0306|\u031B'),
30-
];
3110
// Aspect ratio meet view
3211
const double k35 = 3 / 5;
3312
const double k43 = 4 / 3;
@@ -42,8 +21,6 @@ final User kUserDefault = User(
4221
fullName: 'Waterbus',
4322
userName: 'waterbus.tech',
4423
externalId: 'waterbusId',
45-
// avatar:
46-
// 'https://is1-ssl.mzstatic.com/image/thumb/Purple126/v4/32/34/d4/3234d466-75a0-81fa-68f2-65591f2d385c/AppIcon-0-0-1x_U007emarketing-0-0-0-4-0-0-0-85-220.png/512x512bb.jpg',
4724
);
4825

4926
final List<String> backgrounds = [
@@ -67,7 +44,7 @@ final List<String> desktopBackgrounds = [
6744
];
6845

6946
// Tab Option Setting Screen
70-
const String profileTab = '/myProfile';
71-
const String appearanceTab = '/appearance';
72-
const String languageTab = '/language';
73-
const String callAndMeetingTab = '/callAndMeeting';
47+
// const String profileTab = '/myProfile';
48+
// const String appearanceTab = '/appearance';
49+
// const String languageTab = '/language';
50+
// const String callAndMeetingTab = '/callAndMeeting';

lib/core/navigator/app_router.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import 'package:waterbus/features/room/presentation/screens/room_screen.dart';
2727
import 'package:waterbus/features/settings/presentation/screens/call_settings_screen.dart';
2828
import 'package:waterbus/features/settings/presentation/screens/language_selector_screen.dart';
2929
import 'package:waterbus/features/settings/presentation/screens/notification_settings_screen.dart';
30-
import 'package:waterbus/features/settings/presentation/screens/settings_screen.dart';
3130
import 'package:waterbus/features/settings/presentation/screens/theme_selector_screen.dart';
3231
import 'package:waterbus/gen/assets.gen.dart';
3332

@@ -136,17 +135,6 @@ class CallSettingsRoute extends GoRouteData with _$CallSettingsRoute {
136135
}
137136
}
138137

139-
@TypedGoRoute<SettingsRoute>(
140-
path: Routes.settingsRoute,
141-
name: Routes.settingsRoute,
142-
)
143-
class SettingsRoute extends GoRouteData with _$SettingsRoute {
144-
@override
145-
Widget build(BuildContext context, GoRouterState state) {
146-
return const SettingsScreen();
147-
}
148-
}
149-
150138
@TypedGoRoute<NotificationSettingsRoute>(
151139
path: Routes.notificationSettings,
152140
name: Routes.notificationSettings,

lib/core/navigator/app_router.g.dart

Lines changed: 0 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/navigator/routes.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class Routes {
88
// Users
99
static const String profileRoute = '/profile';
1010
static const String usernameRoute = '/username';
11-
static const String settingsRoute = '/settings';
1211
static const String privacyRoute = '/privacy';
1312
static const String langRoute = '/language';
1413
static const String themeRoute = '/appearance';

lib/features/conversation/domain/entities/string_extension.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,11 @@ import 'package:toastification/toastification.dart';
44
import 'package:waterbus_sdk/utils/extensions/duration_extension.dart';
55

66
import 'package:waterbus/core/app/colors/app_color.dart';
7-
import 'package:waterbus/core/constants/constants.dart';
87
import 'package:waterbus/core/extensions/context_extensions.dart';
98
import 'package:waterbus/core/navigator/app_router.dart';
109
import 'package:waterbus/core/utils/sizer/sizer.dart';
1110

1211
extension StringExtension on String {
13-
String formatVietnamese() {
14-
var result = this;
15-
for (int i = 0; i < vietnameseRegex.length; i++) {
16-
result = result.replaceAll(
17-
vietnameseRegex[i],
18-
i > vietnamese.length - 1 ? '' : vietnamese[i],
19-
);
20-
}
21-
return result;
22-
}
23-
2412
void showToast(ToastificationType type) {
2513
toastification.show(
2614
title: Text(

lib/features/home/presentation/screens/home.dart

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -42,55 +42,8 @@ class _HomeState extends State<Home> {
4242

4343
return Scaffold(
4444
extendBody: true,
45-
bottomNavigationBar: context.isDesktop
46-
? const SizedBox()
47-
: SafeArea(
48-
bottom: false,
49-
child: ClipRRect(
50-
child: BackdropFilter(
51-
filter: ImageFilter.blur(
52-
sigmaX: 15,
53-
sigmaY: 25,
54-
),
55-
child: Container(
56-
height: WebRTC.platformIsIOS ? 64.sp : 60.sp,
57-
padding: EdgeInsets.symmetric(horizontal: 8.sp).add(
58-
EdgeInsets.only(
59-
bottom: WebRTC.platformIsIOS ? 0 : 12.sp,
60-
top: 10.sp,
61-
),
62-
),
63-
color: Theme.of(context)
64-
.scaffoldBackgroundColor
65-
.withValues(alpha: .8),
66-
alignment: Alignment.bottomCenter,
67-
child: Container(
68-
width: context.isDesktop ? 50.w : double.infinity,
69-
alignment: Alignment.center,
70-
child: Row(
71-
mainAxisAlignment: MainAxisAlignment.center,
72-
children: [
73-
_buildItemBottomBar(
74-
iconData: LucideIcons.presentation,
75-
label: Strings.home.i18n,
76-
),
77-
_buildItemBottomBar(
78-
iconData: LucideIcons.messagesSquare,
79-
label: Strings.chat.i18n,
80-
index: 1,
81-
),
82-
_buildItemBottomBar(
83-
iconData: LucideIcons.cog,
84-
label: Strings.settings.i18n,
85-
index: 2,
86-
),
87-
],
88-
),
89-
),
90-
),
91-
),
92-
),
93-
),
45+
bottomNavigationBar:
46+
context.isMobile ? _bodyInMobile(context) : SizedBox(),
9447
body: BlocBuilder<HomeBloc, HomeState>(
9548
builder: (context, state) {
9649
return _tabs[state.props[0]];
@@ -101,6 +54,55 @@ class _HomeState extends State<Home> {
10154
);
10255
}
10356

57+
SafeArea _bodyInMobile(BuildContext context) {
58+
return SafeArea(
59+
bottom: false,
60+
child: ClipRRect(
61+
child: BackdropFilter(
62+
filter: ImageFilter.blur(
63+
sigmaX: 15,
64+
sigmaY: 25,
65+
),
66+
child: Container(
67+
height: WebRTC.platformIsIOS ? 64.sp : 60.sp,
68+
padding: EdgeInsets.symmetric(horizontal: 8.sp).add(
69+
EdgeInsets.only(
70+
bottom: WebRTC.platformIsIOS ? 0 : 12.sp,
71+
top: 10.sp,
72+
),
73+
),
74+
color:
75+
Theme.of(context).scaffoldBackgroundColor.withValues(alpha: .8),
76+
alignment: Alignment.bottomCenter,
77+
child: Container(
78+
width: context.isDesktop ? 50.w : double.infinity,
79+
alignment: Alignment.center,
80+
child: Row(
81+
mainAxisAlignment: MainAxisAlignment.center,
82+
children: [
83+
_buildItemBottomBar(
84+
iconData: LucideIcons.presentation,
85+
label: Strings.home.i18n,
86+
),
87+
_buildItemBottomBar(
88+
iconData: LucideIcons.messagesSquare,
89+
label: Strings.chat.i18n,
90+
index: 1,
91+
),
92+
_buildItemBottomBar(
93+
iconData: LucideIcons.cog,
94+
label: Strings.settings.i18n,
95+
index: 2,
96+
),
97+
],
98+
),
99+
),
100+
),
101+
),
102+
),
103+
);
104+
}
105+
104106
Widget _buildItemBottomBar({
105107
required IconData iconData,
106108
required String label,

0 commit comments

Comments
 (0)