Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
95dc638
chore: replace Color.withOpacity with Color.withValues for alpha tran…
May 24, 2025
1e6a194
refactor: consolidate reusable UI components into core/ui directory a…
May 24, 2025
8850678
chore: split CustomButton into CustomFilledButton and CustomTextButto…
May 24, 2025
4728b31
chore: removed redundant padding
May 24, 2025
b072ff3
patch: add chat navigation and improve bottom sheet UI across Android…
May 24, 2025
1e66e32
Add GeneralSettingsScreen and folders for specific settings
untreu2 May 19, 2025
83bb7bb
patch: fixed font issues
May 20, 2025
9a4f56e
chore: fixed imports
May 20, 2025
dd28e14
feat: add profile bottomsheet
May 21, 2025
6983969
feat: added profile switcher tile om profile
May 21, 2025
efae507
feat: implement profile switching functionality with bottom sheet UI
May 21, 2025
f7e8e2d
feat: implement profile editing screen with custom UI components
May 22, 2025
c524710
feat: nostr keys screen
May 23, 2025
769ee95
patch: created reusable widget for icon button
May 23, 2025
d1902b2
feat: implement network settings screen with relay management
May 23, 2025
fdfcacf
patch: extracted out info box to make it reusable
May 24, 2025
2d71a4a
feat: implement wallet screen
May 24, 2025
dfd0495
chore: update dependencies and add iOS configuration for plugins
May 26, 2025
b6b6452
refactor: update color scheme to use glitch palette and replace Custo…
May 26, 2025
c5c023d
style: update color scheme for chat list appbar and bottom sheet title
May 26, 2025
289f657
feat: add settings routes and UI adjustments across profile and chat …
May 26, 2025
3c0ccca
Merge branch 'master' into feature/profile-screens
Quwaysim May 27, 2025
bd1b395
refactor: replace custom SettingsButton with CustomFilledButton in no…
May 27, 2025
4682c2d
fix: adjust height factor of remove nostr keys bottom sheet from 0.4 …
May 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ linter:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

formatter:
trailing_commas: preserve
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
Binary file added assets/fonts/OverusedGrotesk-Roman.ttf
Binary file not shown.
Binary file removed assets/fonts/OverusedGrotesk-VF.woff2
Binary file not shown.
Binary file added assets/pngs/profile_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 2 additions & 7 deletions assets/svgs/ic_add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/svgs/ic_connected.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/svgs/ic_copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions assets/svgs/ic_delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/svgs/ic_disconnected.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/svgs/ic_edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/svgs/ic_expand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/svgs/ic_help.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/svgs/ic_paste.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions assets/svgs/ic_scan.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/svgs/ic_view.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/svgs/ic_warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 29 additions & 1 deletion lib/routing/router_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ import 'package:whitenoise/ui/auth_flow/logged_screen.dart';
import 'package:whitenoise/ui/auth_flow/login_screen.dart';
import 'package:whitenoise/ui/auth_flow/welcome_screen.dart';
import 'package:whitenoise/ui/chat/chat_screen.dart';
import 'package:whitenoise/ui/settings/general_settings_screen.dart';
import 'package:whitenoise/ui/settings/profile/edit_profile_screen.dart';
import 'package:whitenoise/ui/settings/network/network_screen.dart';
import 'package:whitenoise/ui/settings/nostr_keys/nostr_keys_screen.dart';
import 'package:whitenoise/ui/settings/wallet/wallet_screen.dart';

import '../domain/dummy_data/dummy_messages.dart';
import '../domain/dummy_data/dummy_contacts.dart';
import 'package:whitenoise/ui/contact_list/chat_list_screen.dart';

final routerProvider = Provider<GoRouter>((ref) {
Expand Down Expand Up @@ -82,7 +88,29 @@ final routerProvider = Provider<GoRouter>((ref) {
),
],
),
// TODO: Add settings and other routes as needed
// Settings
GoRoute(
path: Routes.settings,
builder: (context, state) => const GeneralSettingsScreen(),
routes: [
GoRoute(
path: 'profile',
builder: (context, state) => EditProfileScreen(profile: dummyContacts.first),
),
GoRoute(
path: 'network',
builder: (context, state) => const NetworkScreen(),
),
GoRoute(
path: 'keys',
builder: (context, state) => const NostrKeysScreen(),
),
GoRoute(
path: 'wallet',
builder: (context, state) => const WalletScreen(),
),
],
),
Comment on lines +91 to +113
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Review the settings route structure and dummy data usage.

The route structure is well-organized, but there are a couple of concerns:

  1. Dummy data in production routes: Using dummyContacts.first for the profile editing route may not be appropriate for production code.
  2. Route consistency: All child routes are properly nested under the settings path.

Consider refactoring the profile route to handle real user data:

  GoRoute(
    path: 'profile',
-   builder: (context, state) => EditProfileScreen(profile: dummyContacts.first),
+   builder: (context, state) {
+     // TODO: Get actual user profile from state management
+     final userProfile = ref.read(userProfileProvider);
+     return EditProfileScreen(profile: userProfile);
+   },
  ),

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In lib/routing/router_provider.dart between lines 91 and 113, the profile
editing route uses dummyContacts.first, which is not suitable for production.
Refactor this route to obtain and pass real user profile data dynamically, such
as fetching the current user's profile from the app state or a user service,
instead of relying on hardcoded dummy data. Ensure the route builder accesses
actual user information to maintain data consistency and correctness.

],
);
});
23 changes: 23 additions & 0 deletions lib/shared/custom_icon_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:whitenoise/ui/core/themes/colors.dart';

class CustomIconButton extends StatelessWidget {
final void Function()? onTap;
final String iconPath;

const CustomIconButton({required this.onTap, required this.iconPath, super.key});

@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(
height: 40.h,
decoration: BoxDecoration(border: Border.all(color: AppColors.glitch200)),
child: Padding(padding: EdgeInsets.all(12.w), child: SvgPicture.asset(iconPath, width: 16.w, height: 16.w)),
),
);
}
}
47 changes: 47 additions & 0 deletions lib/shared/info_box.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:gap/gap.dart';
import 'package:whitenoise/ui/core/themes/assets.dart';

class InfoBox extends StatelessWidget {
const InfoBox({super.key, required this.colorTheme, required this.title, required this.description});

final Color colorTheme;
final String title;
final String description;

@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(16.w),
decoration: BoxDecoration(color: colorTheme.withValues(alpha: 0.1)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 4.w),
child: SvgPicture.asset(
AssetsPaths.icWarning,
width: 16.w,
height: 16.w,
colorFilter: ColorFilter.mode(colorTheme, BlendMode.srcIn),
),
),
Gap(12.w),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(title, style: TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w600, color: colorTheme)),
Gap(8.h),
Text(description, style: TextStyle(fontSize: 14.sp, color: colorTheme)),
],
),
),
],
),
);
}
}
16 changes: 14 additions & 2 deletions lib/ui/contact_list/widgets/chat_list_appbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:gap/gap.dart';
import 'package:go_router/go_router.dart';
import 'package:whitenoise/routing/routes.dart';
import 'package:whitenoise/ui/core/themes/assets.dart';
import 'package:whitenoise/ui/core/themes/colors.dart';
import 'package:whitenoise/ui/contact_list/new_chat_bottom_sheet.dart';
Expand All @@ -27,7 +29,14 @@ class ChatListAppBar extends StatelessWidget implements PreferredSizeWidget {
child: SafeArea(
child: Row(
children: [
Image.asset(AssetsPaths.icImage, width: 32.w, height: 32.w),
GestureDetector(
onTap: () => GoRouter.of(context).go(Routes.settings),
child: Image.asset(
AssetsPaths.icImage,
width: 32.w,
height: 32.w,
),
),
const Spacer(),
GestureDetector(
onTap: () => SearchChatBottomSheet.show(context),
Expand All @@ -36,7 +45,10 @@ class ChatListAppBar extends StatelessWidget implements PreferredSizeWidget {
Gap(24.w),
GestureDetector(
onTap: () => NewChatBottomSheet.show(context),
child: SvgPicture.asset(AssetsPaths.icAdd),
child: SvgPicture.asset(
AssetsPaths.icAdd,
colorFilter: ColorFilter.mode(AppColors.glitch50, BlendMode.srcIn),
),
),
],
),
Expand Down
Loading