-
-
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.
Added mycourses and public courses views,also solved navigation bug
- Loading branch information
ge59dil
committed
Nov 21, 2023
1 parent
8bdffa4
commit e0c2224
Showing
4 changed files
with
329 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
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,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 | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
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