-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create ui for side menu screen (#62)
- Loading branch information
1 parent
7120e4e
commit 390a652
Showing
22 changed files
with
385 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
part of '../side_menu_module.dart'; | ||
|
||
class Actions extends StatelessWidget { | ||
const Actions({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final state = context.findAncestorStateOfType<_SideMenuViewImplState>()!; | ||
|
||
return PlatformButton( | ||
onPressed: () => state.delegate?.logoutButtonDidTap.add(null), | ||
cupertino: (_, __) => CupertinoButtonData( | ||
padding: EdgeInsets.zero, | ||
), | ||
materialFlat: (_, __) => MaterialFlatButtonData( | ||
color: Colors.transparent, | ||
), | ||
child: Text( | ||
AppLocalizations.of(context)!.sideMenuLogoutButtonTitle, | ||
style: TextStyle( | ||
fontSize: 20, | ||
color: Colors.white.withOpacity(0.5), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
part of '../side_menu_module.dart'; | ||
|
||
class Content extends StatelessWidget { | ||
const Content({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Screen( | ||
body: Container( | ||
color: const Color(0xFF1E1E1E).withOpacity(0.9), | ||
padding: const EdgeInsets.symmetric(horizontal: 20), | ||
child: SafeArea( | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const SizedBox( | ||
height: 40, | ||
), | ||
const User(), | ||
const SizedBox( | ||
height: 20, | ||
), | ||
Container( | ||
color: Colors.white.withOpacity(0.2), | ||
height: 1, | ||
), | ||
const SizedBox( | ||
height: 35, | ||
), | ||
const Actions(), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
part of '../side_menu_module.dart'; | ||
|
||
class User extends StatelessWidget { | ||
const User({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final state = context.findAncestorStateOfType<_SideMenuViewImplState>()!; | ||
|
||
return StreamsSelector0<UserInfo>.value( | ||
stream: state._user, | ||
builder: (_, user, __) { | ||
return Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Flexible( | ||
child: Text( | ||
user.email!, | ||
maxLines: 10, | ||
style: const TextStyle( | ||
color: Colors.white, | ||
fontSize: 34, | ||
fontWeight: FontWeight.w800, | ||
), | ||
), | ||
), | ||
ConstrainedBox( | ||
constraints: const BoxConstraints(minWidth: 8), | ||
), | ||
Container( | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(18), | ||
color: Colors.grey, | ||
), | ||
width: 36, | ||
height: 36, | ||
child: ClipRRect( | ||
borderRadius: BorderRadius.circular(18), | ||
child: Image( | ||
image: NetworkImage(user.avatarUrl!), | ||
), | ||
), | ||
) | ||
], | ||
); | ||
}); | ||
} | ||
} |
Oops, something went wrong.