-
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.
- Loading branch information
Showing
7 changed files
with
193 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,32 @@ | ||
import 'package:academia/exports/barrel.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
class MembershipPage extends StatefulWidget { | ||
const MembershipPage({super.key}); | ||
|
||
@override | ||
State<MembershipPage> createState() => _MembershipPageState(); | ||
} | ||
|
||
class _MembershipPageState extends State<MembershipPage> { | ||
final UserController userController = Get.find<UserController>(); | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text("Your Memberships"), | ||
), | ||
body: SafeArea( | ||
minimum: const EdgeInsets.symmetric(horizontal: 8), | ||
child: Center( | ||
child: Hero( | ||
tag: "membership", | ||
child: SchoolIDCard( | ||
user: userController.user.value!, | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
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,145 @@ | ||
import 'package:academia/exports/barrel.dart'; | ||
import 'package:academia/models/user/user.dart'; | ||
import 'package:google_fonts/google_fonts.dart'; | ||
|
||
class SchoolIDCard extends StatelessWidget { | ||
const SchoolIDCard({super.key, required this.user}); | ||
final User user; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(8), | ||
border: Border.all( | ||
color: Theme.of(context).colorScheme.shadow, | ||
), | ||
), | ||
padding: const EdgeInsets.all(16), | ||
constraints: BoxConstraints( | ||
maxWidth: MediaQuery.of(context).size.width, | ||
maxHeight: 250, | ||
), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
Row( | ||
children: [ | ||
Image.asset( | ||
"assets/logos/du-logo.png", | ||
width: 80, | ||
), | ||
const Spacer(), | ||
Text( | ||
"STUDENT", | ||
style: Theme.of(context).textTheme.titleLarge?.copyWith( | ||
color: Colors.red, | ||
fontWeight: FontWeight.w700, | ||
), | ||
) | ||
], | ||
), | ||
const SizedBox(height: 4), | ||
Text( | ||
user.name!.toUpperCase(), | ||
style: Theme.of(context).textTheme.titleMedium?.copyWith( | ||
fontFamily: GoogleFonts.jetBrainsMono().fontFamily, | ||
), | ||
textAlign: TextAlign.left, | ||
), | ||
const SizedBox(height: 8), | ||
Row( | ||
children: [ | ||
Flexible( | ||
flex: 1, | ||
child: ClipRRect( | ||
borderRadius: BorderRadius.circular(200), | ||
child: CircleAvatar( | ||
radius: 60, | ||
child: Image.memory( | ||
Uint8List.fromList( | ||
base64Decode(user.profile! | ||
.replaceFirst("data:image/gif;base64,", "")), | ||
), | ||
fit: BoxFit.contain, | ||
), | ||
), | ||
), | ||
), | ||
const SizedBox(width: 12), | ||
Flexible( | ||
flex: 2, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
Row( | ||
children: [ | ||
Text( | ||
"ID/ Passport: ", | ||
style: | ||
Theme.of(context).textTheme.bodySmall?.copyWith( | ||
fontWeight: FontWeight.bold, | ||
fontFamily: | ||
GoogleFonts.jetBrainsMono().fontFamily, | ||
), | ||
), | ||
Text( | ||
user.idno!, | ||
style: | ||
Theme.of(context).textTheme.bodySmall?.copyWith( | ||
fontFamily: | ||
GoogleFonts.jetBrainsMono().fontFamily, | ||
), | ||
), | ||
], | ||
), | ||
const SizedBox(height: 8), | ||
Row( | ||
children: [ | ||
Text( | ||
"Admission: ", | ||
style: | ||
Theme.of(context).textTheme.bodySmall?.copyWith( | ||
fontWeight: FontWeight.bold, | ||
fontFamily: | ||
GoogleFonts.jetBrainsMono().fontFamily, | ||
), | ||
), | ||
Text( | ||
user.regno!, | ||
style: | ||
Theme.of(context).textTheme.bodySmall?.copyWith( | ||
fontFamily: | ||
GoogleFonts.jetBrainsMono().fontFamily, | ||
), | ||
), | ||
], | ||
), | ||
const SizedBox(height: 8), | ||
Text( | ||
user.regno!, | ||
textAlign: TextAlign.left, | ||
style: Theme.of(context).textTheme.displayLarge?.copyWith( | ||
fontWeight: FontWeight.bold, | ||
fontFamily: | ||
GoogleFonts.libreBarcode128().fontFamily, | ||
), | ||
), | ||
], | ||
), | ||
) | ||
], | ||
), | ||
const Spacer(), | ||
Text( | ||
"*Note that this is a duplicate, data provided here is as is", | ||
style: Theme.of(context) | ||
.textTheme | ||
.bodySmall | ||
?.copyWith(color: Colors.red), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export 'package:academia/widgets/stat.dart'; | ||
export 'school_id_card_widget.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