Skip to content

Commit

Permalink
chore: profile and settings screen theming
Browse files Browse the repository at this point in the history
  • Loading branch information
IamMuuo committed Mar 16, 2024
1 parent 2fbf7b4 commit d7200ea
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 162 deletions.
6 changes: 3 additions & 3 deletions lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ class _HomePageState extends State<HomePage> {
label: 'Courses',
),
BottomNavigationBarItem(
icon: Icon(Ionicons.settings_outline),
activeIcon: Icon(Ionicons.settings),
label: 'Settings',
icon: Icon(Ionicons.grid_outline),
activeIcon: Icon(Ionicons.grid),
label: 'More',
),
],
),
Expand Down
104 changes: 104 additions & 0 deletions lib/pages/profile_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import 'package:academia/exports/barrel.dart';
import 'package:get/get.dart';

class ProfilePage extends StatelessWidget {
const ProfilePage({super.key});

@override
Widget build(BuildContext context) {
var controller = Get.find<SettingsController>();
final UserController userController = Get.find<UserController>();

return Container(
padding: const EdgeInsets.all(12),
child: SingleChildScrollView(
child: Column(
children: [
CircleAvatar(
radius: 70.0,
child: Obx(
() => Stack(
children: [
ClipRRect(
borderRadius: const BorderRadius.all(
Radius.circular(800),
),
child: controller.showProfilePic.value
? Image.memory(
Uint8List.fromList(
base64Decode(userController.user.value!.profile!
.replaceFirst(
"data:image/gif;base64,", "")),
),
fit: BoxFit.contain,
)
: Image.asset(
userController.user.value!.gender == "male"
? "assets/images/male_student.png"
: "assets/images/female_student.png",
),
),
Positioned(
right: 3,
bottom: 0,
child: Icon(
Ionicons.shield_checkmark,
color: Theme.of(context).colorScheme.tertiary,
),
),
],
),
),
),
const SizedBox(
height: 12,
),
Text(
userController.user.value!.name!.title(),
style: h4,
),
const SizedBox(
height: 12,
),
InfoCard(
title: "National ID",
content: userController.user.value!.idno ?? "Unknown",
icon: Ionicons.id_card,
),
InfoCard(
title: "Admission Number",
content: userController.user.value!.admno ?? "00-0000",
icon: Ionicons.at_circle,
),
InfoCard(
title: "Gender",
content: (userController.user.value!.gender ?? "unknown").title(),
icon: (userController.user.value!.gender ?? "unknown")
.toLowerCase() ==
"male"
? Icons.male
: Icons.female,
),
InfoCard(
title: "Email Address",
content:
userController.user.value!.email ?? "someone@example.com",
icon: Ionicons.mail,
),
InfoCard(
title: "Address",
content: userController.user.value!.address ?? "unknown",
icon: Ionicons.planet,
),
InfoCard(
title: "Birthday",
content:
(userController.user.value!.dateOfBirth ?? "unknown").title(),
icon: Icons.cake,
),
],
),
),
);
}
}
Loading

0 comments on commit d7200ea

Please sign in to comment.