Skip to content

Commit

Permalink
feat: switch account screen (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-hades authored Feb 28, 2024
1 parent 0af73b4 commit 8997dbd
Show file tree
Hide file tree
Showing 24 changed files with 474 additions and 121 deletions.
4 changes: 4 additions & 0 deletions app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
"profile_articles_desc",
"profile_bookmarks",
"profile_bookmarks_desc",
"profile_switch_user_header",
"profile_create_new_account",
"profile_add_nostr_account",
"profile_log_out",
"trending_videos"
]
}
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048

COCOAPODS: 1.15.2
COCOAPODS: 1.14.3
22 changes: 4 additions & 18 deletions lib/app/components/modal_wrapper/modal_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,17 @@ import 'package:ice/app/extensions/num.dart';

class ModalWrapper extends StatelessWidget {
const ModalWrapper({super.key, required this.child});

final Widget child;

@override
Widget build(BuildContext context) {
return Align(
alignment: Alignment.bottomCenter,
child: KeyboardHider(
child: Container(
height: MediaQuery.of(context).size.height - 74.0.s,
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.vertical(top: Radius.circular(30.0.s)),
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5.0.s,
blurRadius: 7.0.s,
offset: Offset(0, 3.0.s),
),
],
),
child: ClipRRect(
borderRadius: BorderRadius.vertical(top: Radius.circular(30.0.s)),
child: child,
),
child: ClipRRect(
borderRadius: BorderRadius.vertical(top: Radius.circular(30.0.s)),
child: child,
),
),
);
Expand Down
97 changes: 47 additions & 50 deletions lib/app/features/dapps/views/pages/dapps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,63 +9,60 @@ import 'package:ice/app/features/dapps/views/components/favourites.dart';
import 'package:ice/app/features/dapps/views/components/featured.dart';
import 'package:ice/app/features/dapps/views/components/wallet_header/wallet_header.dart';
import 'package:ice/app/features/dapps/views/pages/mocks/mocked_apps.dart';
import 'package:ice/app/features/user/pages/pull_right_menu_page/pull_right_menu_handler.dart';
import 'package:ice/app/router/app_routes.dart';

class DAppsPage extends IceSimplePage {
const DAppsPage(super.route, super.payload);

@override
Widget buildPage(BuildContext context, WidgetRef ref, __) {
return PullRightMenuHandler(
child: SingleChildScrollView(
child: DecoratedBox(
decoration:
BoxDecoration(color: context.theme.appColors.secondaryBackground),
child: Column(
children: <Widget>[
const WalletHeader(),
const Featured(),
const Categories(),
Apps(
title: context.i18n.dapps_section_title_highest_ranked,
items: featured,
onPress: () {
IceRoutes.appsList.go(
context,
payload: AppsRouteData(
title: context.i18n.dapps_section_title_highest_ranked,
items: featured,
),
);
},
),
Apps(
title: context.i18n.dapps_section_title_recently_added,
items: featured,
onPress: () {
IceRoutes.appsList.go(
context,
payload: AppsRouteData(
title: context.i18n.dapps_section_title_recently_added,
items: featured,
),
);
},
),
Favourites(
onPress: () {
IceRoutes.appsList.go(
context,
payload: AppsRouteData(
title: context.i18n.dapps_section_title_favourites,
items: featured,
),
);
},
),
],
),
return SingleChildScrollView(
child: DecoratedBox(
decoration:
BoxDecoration(color: context.theme.appColors.secondaryBackground),
child: Column(
children: <Widget>[
const WalletHeader(),
const Featured(),
const Categories(),
Apps(
title: context.i18n.dapps_section_title_highest_ranked,
items: featured,
onPress: () {
IceRoutes.appsList.go(
context,
payload: AppsRouteData(
title: context.i18n.dapps_section_title_highest_ranked,
items: featured,
),
);
},
),
Apps(
title: context.i18n.dapps_section_title_recently_added,
items: featured,
onPress: () {
IceRoutes.appsList.go(
context,
payload: AppsRouteData(
title: context.i18n.dapps_section_title_recently_added,
items: featured,
),
);
},
),
Favourites(
onPress: () {
IceRoutes.appsList.go(
context,
payload: AppsRouteData(
title: context.i18n.dapps_section_title_favourites,
items: featured,
),
);
},
),
],
),
),
);
Expand Down
71 changes: 37 additions & 34 deletions lib/app/features/feed/views/pages/feed_page/feed_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:ice/app/features/feed/views/pages/feed_page/components/feed_cont
import 'package:ice/app/features/feed/views/pages/feed_page/components/list_separator/list_separator.dart';
import 'package:ice/app/features/feed/views/pages/feed_page/components/stories/stories.dart';
import 'package:ice/app/features/feed/views/pages/feed_page/components/trending_videos/trending_videos.dart';
import 'package:ice/app/features/user/pages/pull_right_menu_page/pull_right_menu_handler.dart';

enum FeedType { feed, videos, stories }

Expand All @@ -17,42 +18,44 @@ class FeedPage extends IceSimplePage {
Widget buildPage(BuildContext context, WidgetRef ref, __) {
final ScrollController scrollController = useScrollController();

return Scaffold(
body: SafeArea(
child: CustomScrollView(
controller: scrollController,
slivers: <Widget>[
SliverToBoxAdapter(
child: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 9.0.s),
child: FeedControls(
pageScrollController: scrollController,
return PullRightMenuHandler(
child: Scaffold(
body: SafeArea(
child: CustomScrollView(
controller: scrollController,
slivers: <Widget>[
SliverToBoxAdapter(
child: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 9.0.s),
child: FeedControls(
pageScrollController: scrollController,
),
),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 16.0.s),
child: const Stories(),
),
const FeedListSeparator(),
const TrendingVideos(),
const FeedListSeparator(),
],
Padding(
padding: EdgeInsets.symmetric(vertical: 16.0.s),
child: const Stories(),
),
const FeedListSeparator(),
const TrendingVideos(),
const FeedListSeparator(),
],
),
),
SliverList.separated(
itemCount: 20,
separatorBuilder: (BuildContext context, int index) {
return const FeedListSeparator();
},
itemBuilder: (BuildContext context, int index) {
return const Placeholder(
fallbackHeight: 150,
);
},
),
),
SliverList.separated(
itemCount: 20,
separatorBuilder: (BuildContext context, int index) {
return const FeedListSeparator();
},
itemBuilder: (BuildContext context, int index) {
return const Placeholder(
fallbackHeight: 150,
);
},
),
],
],
),
),
),
);
Expand Down
2 changes: 2 additions & 0 deletions lib/app/features/user/model/user_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ part 'user_data.freezed.dart';
@Freezed(copyWith: true)
class UserData with _$UserData {
const factory UserData({
required String id,
required String nickname,
required String name,
required String whoInvitedNickname,
required String profilePicture,
int? following,
int? followers,
bool? isVerified,
}) = _UserData;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:ice/app/extensions/num.dart';
import 'package:ice/app/features/user/pages/pull_right_menu_page/components/header/header_action.dart';
import 'package:ice/app/router/app_routes.dart';
import 'package:ice/generated/assets.gen.dart';

class Header extends StatelessWidget {
Expand Down Expand Up @@ -30,7 +31,9 @@ class Header extends StatelessWidget {
),
SizedBox(width: 12.0.s),
HeaderAction(
onPressed: () {},
onPressed: () {
IceRoutes.switchAccount.go(context);
},
assetName: Assets.images.icons.iconSwitchProfile.path,
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import 'package:ice/app/features/user/model/user_data.dart';
import 'package:ice/app/features/user/pages/pull_right_menu_page/components/decorations.dart';
import 'package:ice/app/features/user/pages/pull_right_menu_page/components/profile_info/components/profile_details/profile_details_cell.dart';
import 'package:ice/app/features/user/providers/user_data_provider.dart';
import 'package:ice/generated/assets.gen.dart';

class ProfileDetails extends HookConsumerWidget {
const ProfileDetails({
super.key,
});

double get verifiedIconSize => 16.0.s;

@override
Widget build(BuildContext context, WidgetRef ref) {
final UserData userData = ref.watch(userDataNotifierProvider);
Expand All @@ -24,11 +27,21 @@ class ProfileDetails extends HookConsumerWidget {
decoration: Decorations.borderBoxDecoration(context),
child: Column(
children: <Widget>[
Text(
userData.name,
style: context.theme.appTextThemes.title.copyWith(
color: context.theme.appColors.primaryText,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
userData.name,
style: context.theme.appTextThemes.title.copyWith(
color: context.theme.appColors.primaryText,
),
),
if (userData.isVerified == true) ...<Widget>[
SizedBox(width: 6.0.s),
Assets.images.icons.iconBadgeVerify
.image(width: verifiedIconSize, height: verifiedIconSize),
],
],
),
SizedBox(height: 3.0.s),
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PullRightMenuHandler extends StatelessWidget {
if (details.velocity.pixelsPerSecond.dx > 100 &&
details.velocity.pixelsPerSecond.dx >
details.velocity.pixelsPerSecond.dy) {
IceRoutes.pullRightMenu.push(context);
IceRoutes.pullRightMenu.go(context);
}
},
child: child,
Expand Down
Loading

0 comments on commit 8997dbd

Please sign in to comment.