diff --git a/lib/View/bookmarks_screen.dart b/lib/View/bookmarks_screen.dart index 90bed480..e62ff8d9 100644 --- a/lib/View/bookmarks_screen.dart +++ b/lib/View/bookmarks_screen.dart @@ -15,25 +15,25 @@ class BookmarksScreen extends ConsumerWidget { case 0: Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute(builder: (context) => const CourseOverview()), - (Route route) => false, + (Route route) => false, ); break; case 1: Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute(builder: (context) => const DownloadsScreen()), - (Route route) => false, + (Route route) => false, ); break; case 2: Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute(builder: (context) => const BookmarksScreen()), - (Route route) => false, + (Route route) => false, ); break; case 3: Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute(builder: (context) => NotificationsScreen()), - (Route route) => false, + (Route route) => false, ); break; default: @@ -110,18 +110,17 @@ class BookmarksScreen extends ConsumerWidget { ], ), ); - } } - class DownloadItem extends StatelessWidget { final String imageName; final String title; final String date; final String duration; - const DownloadItem({super.key, + const DownloadItem({ + super.key, required this.imageName, required this.title, required this.date, @@ -164,4 +163,4 @@ class DownloadItem extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/View/courseoverview_screen.dart b/lib/View/courseoverview_screen.dart index 3f839710..5d42ad11 100644 --- a/lib/View/courseoverview_screen.dart +++ b/lib/View/courseoverview_screen.dart @@ -18,26 +18,26 @@ class CourseOverview extends ConsumerWidget { switch (index) { case 0: Navigator.of(context).pushAndRemoveUntil( - MaterialPageRoute(builder: (context) => const CourseOverview()), - (Route route) => false, + MaterialPageRoute(builder: (context) => const CourseOverview()), + (Route route) => false, ); break; case 1: Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute(builder: (context) => const DownloadsScreen()), - (Route route) => false, + (Route route) => false, ); break; case 2: Navigator.of(context).pushAndRemoveUntil( - MaterialPageRoute(builder: (context) => const BookmarksScreen()), - (Route route) => false, + MaterialPageRoute(builder: (context) => const BookmarksScreen()), + (Route route) => false, ); break; case 3: Navigator.of(context).pushAndRemoveUntil( - MaterialPageRoute(builder: (context) => NotificationsScreen()), - (Route route) => false, + MaterialPageRoute(builder: (context) => NotificationsScreen()), + (Route route) => false, ); break; default: @@ -82,9 +82,9 @@ class CourseOverview extends ConsumerWidget { const Text( 'My Courses', style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - color: Colors.black, + fontSize: 22, + fontWeight: FontWeight.bold, + color: Colors.black, ), ), IconButton( @@ -127,9 +127,9 @@ class CourseOverview extends ConsumerWidget { const Text( 'Public Courses', style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - color: Colors.black, + fontSize: 22, + fontWeight: FontWeight.bold, + color: Colors.black, ), ), IconButton( diff --git a/lib/View/download_screen.dart b/lib/View/download_screen.dart index 38baba99..911484ff 100644 --- a/lib/View/download_screen.dart +++ b/lib/View/download_screen.dart @@ -15,25 +15,25 @@ class DownloadsScreen extends ConsumerWidget { case 0: Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute(builder: (context) => const CourseOverview()), - (Route route) => false, + (Route route) => false, ); break; case 1: Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute(builder: (context) => const DownloadsScreen()), - (Route route) => false, + (Route route) => false, ); break; case 2: Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute(builder: (context) => const BookmarksScreen()), - (Route route) => false, + (Route route) => false, ); break; case 3: Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute(builder: (context) => NotificationsScreen()), - (Route route) => false, + (Route route) => false, ); break; default: @@ -41,79 +41,77 @@ class DownloadsScreen extends ConsumerWidget { } } - return Scaffold( - appBar: AppBar( - title: const Text('Downloads'), - actions: [ - IconButton( - icon: const Icon(Icons.search), - onPressed: () { - // Implement search functionality - }, - ), - IconButton( - icon: const Icon(Icons.more_vert), - onPressed: () { - // Implement more options functionality - }, - ), - ], - ), - body: ListView( - children: const [ - DownloadItem( - imageName: 'assets/lecture_hall.jpg', - title: 'Lineare Algebra für Informatik [MA0901]', - date: 'July 24, 2019', - duration: '02:00:00', - ), - DownloadItem( - imageName: 'assets/computer_science.jpg', - title: 'Computer Science [CS202]', - date: 'July 23, 2019', - duration: '02:00:00', - ), - // Add more DownloadItem widgets as needed - ], - ), - bottomNavigationBar: BottomNavigationBar( - onTap: (index) => navigateToScreen(index, context), - items: const [ - BottomNavigationBarItem( - icon: Icon( - Icons.home, - color: Colors.grey, - ), // Replace with the exact color - label: 'Home', - ), - BottomNavigationBarItem( - icon: Icon( - Icons.file_download, - color: Colors.blue, - ), // 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', - ), - ], - ), - ); - - } + return Scaffold( + appBar: AppBar( + title: const Text('Downloads'), + actions: [ + IconButton( + icon: const Icon(Icons.search), + onPressed: () { + // Implement search functionality + }, + ), + IconButton( + icon: const Icon(Icons.more_vert), + onPressed: () { + // Implement more options functionality + }, + ), + ], + ), + body: ListView( + children: const [ + DownloadItem( + imageName: 'assets/lecture_hall.jpg', + title: 'Lineare Algebra für Informatik [MA0901]', + date: 'July 24, 2019', + duration: '02:00:00', + ), + DownloadItem( + imageName: 'assets/computer_science.jpg', + title: 'Computer Science [CS202]', + date: 'July 23, 2019', + duration: '02:00:00', + ), + // Add more DownloadItem widgets as needed + ], + ), + bottomNavigationBar: BottomNavigationBar( + onTap: (index) => navigateToScreen(index, context), + items: const [ + BottomNavigationBarItem( + icon: Icon( + Icons.home, + color: Colors.grey, + ), // Replace with the exact color + label: 'Home', + ), + BottomNavigationBarItem( + icon: Icon( + Icons.file_download, + color: Colors.blue, + ), // 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 DownloadItem extends StatelessWidget { final String imageName; @@ -121,7 +119,8 @@ class DownloadItem extends StatelessWidget { final String date; final String duration; - const DownloadItem({super.key, + const DownloadItem({ + super.key, required this.imageName, required this.title, required this.date, @@ -164,4 +163,4 @@ class DownloadItem extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/View/mycourses_screen.dart b/lib/View/mycourses_screen.dart index 2f3c9d23..1588b3d5 100644 --- a/lib/View/mycourses_screen.dart +++ b/lib/View/mycourses_screen.dart @@ -43,9 +43,9 @@ class MyCourses extends StatelessWidget { Text( 'My Courses', style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - color: Colors.black, + fontSize: 22, + fontWeight: FontWeight.bold, + color: Colors.black, ), ), ], diff --git a/lib/View/notifications_screen.dart b/lib/View/notifications_screen.dart index 85687322..f7862b1a 100644 --- a/lib/View/notifications_screen.dart +++ b/lib/View/notifications_screen.dart @@ -27,24 +27,27 @@ class NotificationsScreen extends ConsumerWidget { switch (index) { case 0: Navigator.of(context).pushAndRemoveUntil( - MaterialPageRoute(builder: (context) => const CourseOverview()), - (Route route) => false, + MaterialPageRoute(builder: (context) => const CourseOverview()), + (Route route) => false, ); break; case 1: - Navigator.push(context, - MaterialPageRoute(builder: (context) => const DownloadsScreen()), + Navigator.of(context).pushAndRemoveUntil( + MaterialPageRoute(builder: (context) => const DownloadsScreen()), + (Route route) => false, ); + break; case 2: - Navigator.push(context, - MaterialPageRoute(builder: (context) => const BookmarksScreen()), + Navigator.of(context).pushAndRemoveUntil( + MaterialPageRoute(builder: (context) => const BookmarksScreen()), + (Route route) => false, ); break; case 3: Navigator.of(context).pushAndRemoveUntil( - MaterialPageRoute(builder: (context) => NotificationsScreen()), - (Route route) => false, + MaterialPageRoute(builder: (context) => NotificationsScreen()), + (Route route) => false, ); break; default: diff --git a/lib/View/publiccourses_screen.dart b/lib/View/publiccourses_screen.dart index e1045958..b4410eed 100644 --- a/lib/View/publiccourses_screen.dart +++ b/lib/View/publiccourses_screen.dart @@ -43,9 +43,9 @@ class PublicCourses extends StatelessWidget { Text( 'Public Courses', style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - color: Colors.black, + fontSize: 22, + fontWeight: FontWeight.bold, + color: Colors.black, ), ), ],