diff --git a/lib/View/courseoverview_screen.dart b/lib/View/courseoverview_screen.dart index a807ab1a..80e60c53 100644 --- a/lib/View/courseoverview_screen.dart +++ b/lib/View/courseoverview_screen.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:gocast_mobile/View/mycourses_screen.dart'; +import 'package:gocast_mobile/View/publiccourses_screen.dart'; import 'settings_screen.dart'; class CourseOverview extends StatelessWidget { @@ -34,15 +36,27 @@ class CourseOverview extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Padding( - padding: EdgeInsets.all(16.0), - child: Text( - 'My Courses', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - color: Colors.black, - ), // Replace with the exact color + Padding( + padding: const EdgeInsets.all(16.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + 'My Courses', + style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: Colors.black), + ), + IconButton( + icon: const Icon(Icons.arrow_forward), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const MyCourses(), + ), + ); + }, + ), + ], ), ), // Horizontal list view for My Courses @@ -62,15 +76,27 @@ class CourseOverview extends StatelessWidget { ], ), ), - const Padding( - padding: EdgeInsets.all(16.0), - child: Text( - 'Public Courses', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - color: Colors.black, - ), // Replace with the exact color + Padding( + padding: const EdgeInsets.all(16.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + 'Public Courses', + style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: Colors.black), + ), + IconButton( + icon: const Icon(Icons.arrow_forward), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const PublicCourses(), + ), + ); + }, + ), + ], ), ), // Horizontal list view for Public Courses diff --git a/lib/View/mycourses_screen.dart b/lib/View/mycourses_screen.dart new file mode 100644 index 00000000..2e711475 --- /dev/null +++ b/lib/View/mycourses_screen.dart @@ -0,0 +1,141 @@ +import 'package:flutter/material.dart'; +import 'settings_screen.dart'; + +class MyCourses extends StatelessWidget { + const MyCourses({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, // Replace with the exact color + title: const Text('GoCast', + style: + TextStyle(color: Colors.black), + ), // Replace with the exact color + actions: [ + IconButton( + icon: const Icon(Icons.settings, + color: Colors.black, + ), // Replace with the exact color + onPressed: () { + // Settings action + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const SettingsScreen(), + ), + ); + }, + ), + ], + ), + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + const Padding( + padding: EdgeInsets.all(16.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'My Courses', + style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: Colors.black), + ), + ], + ), + ), + // Horizontal list view for My Courses + SizedBox( + height: 200, // Adjust the height as needed + child: ListView( + scrollDirection: Axis.horizontal, + children: const [ + CourseCard( + title: 'PSY101', subtitle: 'Introduction to Psychology', + ), + CourseCard( + title: 'CS202', + subtitle: 'Introduction to Computer Science', + ), + // Add more courses as needed + ], + ), + ), + ], + ), + ), + bottomNavigationBar: BottomNavigationBar( + items: const [ + BottomNavigationBarItem( + icon: Icon(Icons.home, + color: Colors.blue, + ), // Replace with the exact color + label: 'Home', + ), + BottomNavigationBarItem( + icon: Icon(Icons.download, + color: Colors.grey, + ), // Replace with the exact color + label: 'Downloads', + ), + BottomNavigationBarItem( + icon: Icon(Icons.bookmark, + color: Colors.grey, + ), // Replace with the exact color + label: 'Bookmarks', + ), + BottomNavigationBarItem( + icon: Icon(Icons.notifications, + color: Colors.grey, + ), // Replace with the exact color + label: 'Notifications', + ), + ], + ), + ); + } +} + +class CourseCard extends StatelessWidget { + final String title; + final String subtitle; + + const CourseCard({super.key, required this.title, required this.subtitle}); + + @override + Widget build(BuildContext context) { + return Container( + width: 160, // Adjust the width as needed + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Image.asset( + 'path_to_your_course_image', // Replace with the actual path to your course image + fit: BoxFit.cover, + ), + ), + Text( + title, + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: Colors.black, + ), // Replace with the exact color + ), + Text( + subtitle, + style: const TextStyle( + fontSize: 16, + color: Colors.grey, + ), // Replace with the exact color + ), + ], + ), + ); + } +} diff --git a/lib/View/publiccourses_screen.dart b/lib/View/publiccourses_screen.dart new file mode 100644 index 00000000..0130c8db --- /dev/null +++ b/lib/View/publiccourses_screen.dart @@ -0,0 +1,141 @@ +import 'package:flutter/material.dart'; +import 'settings_screen.dart'; + +class PublicCourses extends StatelessWidget { + const PublicCourses({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, // Replace with the exact color + title: const Text('GoCast', + style: + TextStyle(color: Colors.black), + ), // Replace with the exact color + actions: [ + IconButton( + icon: const Icon(Icons.settings, + color: Colors.black, + ), // Replace with the exact color + onPressed: () { + // Settings action + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const SettingsScreen(), + ), + ); + }, + ), + ], + ), + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + const Padding( + padding: EdgeInsets.all(16.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Public Courses', + style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: Colors.black), + ), + + ], + ), + ), + // Horizontal list view for Public Courses + SizedBox( + height: 200, // Adjust the height as needed + child: ListView( + scrollDirection: Axis.horizontal, + children: const [ + CourseCard( + title: 'PSY101', subtitle: 'Public Psychology Course', + ), + CourseCard( + title: 'PSY101', subtitle: 'Public Psychology Course', + ), + // Add more courses as needed + ], + ), + ), + ], + ), + ), + bottomNavigationBar: BottomNavigationBar( + items: const [ + BottomNavigationBarItem( + icon: Icon(Icons.home, + color: Colors.blue, + ), // Replace with the exact color + label: 'Home', + ), + BottomNavigationBarItem( + icon: Icon(Icons.download, + color: Colors.grey, + ), // Replace with the exact color + label: 'Downloads', + ), + BottomNavigationBarItem( + icon: Icon(Icons.bookmark, + color: Colors.grey, + ), // Replace with the exact color + label: 'Bookmarks', + ), + BottomNavigationBarItem( + icon: Icon(Icons.notifications, + color: Colors.grey, + ), // Replace with the exact color + label: 'Notifications', + ), + ], + ), + ); + } +} + +class CourseCard extends StatelessWidget { + final String title; + final String subtitle; + + const CourseCard({super.key, required this.title, required this.subtitle}); + + @override + Widget build(BuildContext context) { + return Container( + width: 160, // Adjust the width as needed + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Image.asset( + 'path_to_your_course_image', // Replace with the actual path to your course image + fit: BoxFit.cover, + ), + ), + Text( + title, + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: Colors.black, + ), // Replace with the exact color + ), + Text( + subtitle, + style: const TextStyle( + fontSize: 16, + color: Colors.grey, + ), // Replace with the exact color + ), + ], + ), + ); + } +} diff --git a/lib/View/settings_screen.dart b/lib/View/settings_screen.dart index d31378f8..18b796ee 100644 --- a/lib/View/settings_screen.dart +++ b/lib/View/settings_screen.dart @@ -94,11 +94,9 @@ class _SettingsScreenState extends ConsumerState { onTap: () { // Handle log out ref.read(userViewModel).logout(); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const Loginscreen(), - ), + Navigator.of(context).pushAndRemoveUntil( + MaterialPageRoute(builder: (context) => const Loginscreen()), + (Route route) => false, ); }, ),