-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from xkaper001/xkaper001/issue62
Implement the Explore Page/issue62
- Loading branch information
Showing
20 changed files
with
239 additions
and
67 deletions.
There are no files selected for viewing
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
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,17 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class Module { | ||
final String name; | ||
final String description; | ||
final String thumbnailPath; | ||
final MaterialPageRoute route; | ||
Color backgroundColor; | ||
|
||
Module({ | ||
required this.name, | ||
required this.description, | ||
required this.thumbnailPath, | ||
required this.route, | ||
required this.backgroundColor, | ||
}); | ||
} |
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,53 +1,151 @@ | ||
import 'dart:ui'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
import 'package:learn/utils/constants.dart'; | ||
|
||
// Explore Page | ||
class ExplorePage extends StatelessWidget { | ||
const ExplorePage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('Explore'), | ||
), | ||
body: ListView( | ||
children: [ | ||
GestureDetector( | ||
onTap: () { | ||
Navigator.pushNamed(context, '/quiz'); | ||
}, | ||
child: Container( | ||
margin: const EdgeInsets.all(5.0), | ||
padding: const EdgeInsets.all(8.0), | ||
decoration: BoxDecoration( | ||
border: Border.all(color: Colors.black, width: 1.0), | ||
borderRadius: BorderRadius.circular(8.0), | ||
color: Colors.blueAccent, | ||
), | ||
child: Row( | ||
children: [ | ||
SizedBox( | ||
width: 50, | ||
height: 50, | ||
child: SvgPicture.asset('assets/explore/notebook.svg'), | ||
), | ||
const SizedBox(width: 28.0), | ||
const Text( | ||
'Quiz', | ||
style: TextStyle( | ||
fontWeight: FontWeight.bold, | ||
fontSize: 30.0, | ||
fontFamily: 'Comic', | ||
color: Colors.white, | ||
return SafeArea( | ||
child: CustomScrollView( | ||
slivers: [ | ||
SliverAppBar( | ||
title: Padding( | ||
padding: const EdgeInsets.fromLTRB(0, 12, 16, 4), | ||
child: Text( | ||
"Explore", | ||
style: Theme.of(context) | ||
.textTheme | ||
.headlineLarge! | ||
.copyWith(fontWeight: FontWeight.bold, fontSize: 30.0), | ||
), | ||
), | ||
), | ||
SliverList( | ||
delegate: SliverChildBuilderDelegate( | ||
(context, index) { | ||
return GestureDetector( | ||
onTap: () => Navigator.push( | ||
context, | ||
AppConstants.modules[index].route, | ||
), | ||
child: Container( | ||
margin: | ||
const EdgeInsets.symmetric(horizontal: 24, vertical: 12), | ||
height: 200, | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(16), | ||
boxShadow: [ | ||
BoxShadow( | ||
color: Colors.black.withOpacity(0.2), | ||
spreadRadius: 2, | ||
blurRadius: 5, | ||
offset: const Offset(0, 3), | ||
), | ||
], | ||
), | ||
child: ClipRRect( | ||
borderRadius: BorderRadius.circular(16), | ||
child: Stack( | ||
fit: StackFit.expand, | ||
alignment: Alignment.center, | ||
children: [ | ||
ImageFiltered( | ||
imageFilter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), | ||
child: Image.asset( | ||
AppConstants.modules[index].thumbnailPath, | ||
fit: BoxFit.cover, | ||
), | ||
), | ||
Positioned.fill( | ||
child: Align( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Text( | ||
AppConstants.modules[index].name, | ||
style: Theme.of(context) | ||
.textTheme | ||
.headlineMedium! | ||
.copyWith( | ||
color: Colors.white, | ||
fontWeight: FontWeight.bold, | ||
shadows: [ | ||
const Shadow( | ||
color: Colors.black, | ||
offset: Offset(2, 1), | ||
blurRadius: 4, | ||
), | ||
], | ||
), | ||
), | ||
Text( | ||
AppConstants.modules[index].description, | ||
style: Theme.of(context) | ||
.textTheme | ||
.bodyMedium! | ||
.copyWith( | ||
color: Colors.white, | ||
fontWeight: FontWeight.bold, | ||
shadows: [ | ||
const Shadow( | ||
color: Colors.black, | ||
offset: Offset(2, 1), | ||
blurRadius: 2, | ||
), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
], | ||
), | ||
)), | ||
); | ||
}, | ||
childCount: AppConstants.modules.length, | ||
), | ||
), | ||
GestureDetector( | ||
onTap: () { | ||
Navigator.pushNamed(context, '/quiz'); | ||
}, | ||
child: Container( | ||
margin: const EdgeInsets.all(5.0), | ||
padding: const EdgeInsets.all(8.0), | ||
decoration: BoxDecoration( | ||
border: Border.all(color: Colors.black, width: 1.0), | ||
borderRadius: BorderRadius.circular(8.0), | ||
color: Colors.blueAccent, | ||
), | ||
child: Row( | ||
children: [ | ||
SizedBox( | ||
width: 50, | ||
height: 50, | ||
child: SvgPicture.asset('assets/explore/notebook.svg'), | ||
), | ||
const SizedBox(width: 28.0), | ||
const Text( | ||
'Quiz', | ||
style: TextStyle( | ||
fontWeight: FontWeight.bold, | ||
fontSize: 30.0, | ||
fontFamily: 'Comic', | ||
color: Colors.white, | ||
), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
); | ||
), | ||
], | ||
)); | ||
} | ||
} |
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
File renamed without changes.
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
Oops, something went wrong.