-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: retouched the birthday ui page
- Loading branch information
Showing
8 changed files
with
120 additions
and
51 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
export 'pages/pages.dart'; |
This file was deleted.
Oops, something went wrong.
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,65 @@ | ||
import 'package:get/get.dart'; | ||
import 'package:intl/intl.dart'; | ||
import 'package:academia/exports/barrel.dart'; | ||
import 'package:lottie/lottie.dart'; | ||
|
||
class BirthDayPage extends StatelessWidget { | ||
BirthDayPage({super.key}); | ||
|
||
final UserController userController = Get.find<UserController>(); | ||
int get years { | ||
DateFormat inputFormat = DateFormat('yyyy-MM-dd'); | ||
|
||
var dob = | ||
inputFormat.parse(userController.user.value!.dateOfBirth.toString()); | ||
return DateTime.now().year - dob.year; | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: CustomScrollView( | ||
slivers: [ | ||
SliverAppBar( | ||
leading: IconButton.outlined( | ||
onPressed: () { | ||
Navigator.pop(context); | ||
}, | ||
icon: const Icon(Ionicons.close), | ||
), | ||
), | ||
const SliverPadding( | ||
padding: EdgeInsets.all(16), | ||
sliver: SliverToBoxAdapter( | ||
child: ProfilePictureWidget( | ||
profileSize: 80, | ||
), | ||
), | ||
), | ||
SliverPadding( | ||
padding: const EdgeInsets.all(16), | ||
sliver: SliverToBoxAdapter( | ||
child: Text( | ||
"Happy birthday ${userController.user.value!.firstName} ${Emojis.activites_confetti_ball}", | ||
textAlign: TextAlign.center, | ||
style: Theme.of(context).textTheme.headlineLarge, | ||
), | ||
), | ||
), | ||
SliverToBoxAdapter( | ||
child: Lottie.asset("assets/lotties/birthday.json"), | ||
), | ||
SliverPadding( | ||
padding: const EdgeInsets.all(12), | ||
sliver: SliverToBoxAdapter( | ||
child: Text( | ||
"""Academia wishes you a happy $years birthday!Remember you're one year older from your birth and one closer to your death\nWe celebrate you!""", | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
) | ||
], | ||
), | ||
); | ||
} | ||
} |
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 @@ | ||
export 'birthday_page.dart'; |
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