Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue #110 #116

Merged
merged 3 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import 'package:flutter/material.dart';
import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:learn/pages/about.dart';
import 'package:learn/pages/flowers.dart';
import 'package:learn/pages/modules/flowers.dart';
import 'package:learn/pages/modules/atoz.dart';
import 'package:learn/pages/modules/birds.dart';
import 'package:learn/pages/modules/animals.dart';
import 'package:learn/pages/explore.dart';
import 'package:learn/pages/explore/explore.dart';
import 'package:learn/pages/favorite.dart';
import 'package:learn/pages/modules/occupation.dart';
import 'package:learn/pages/modules/parts.dart';
Expand All @@ -18,7 +18,7 @@ import 'package:learn/pages/modules/colours.dart';
import 'package:learn/widgets/navbar/navbar.dart';

import 'cubit/index_cubit.dart';
import 'explore/quiz.dart';
import 'pages/explore/quiz.dart';
import 'pages/home.dart';

DateTime? currentBackPressTime;
Expand Down
151 changes: 0 additions & 151 deletions lib/pages/explore.dart

This file was deleted.

160 changes: 160 additions & 0 deletions lib/pages/explore/explore.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
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 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: SliverChildListDelegate(
[
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,
),
),
],
),
),
),
],
),
),
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,
),
),
],
),
);
}
}
File renamed without changes.
1 change: 0 additions & 1 deletion lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:learn/main.dart';

import '../utils/routes.dart';
import '../widgets/drawer.dart';
import 'modules/animals.dart';

class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/utils/constants.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:ui';

import '../explore/quiz.dart';
import '../pages/explore/quiz.dart';
import 'package:flutter/material.dart';
import 'package:learn/pages/modules/colours.dart';
import 'package:learn/pages/modules/parts.dart';
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ flutter:
assets:
- assets/images/
- assets/sounds/
- assets/colours/
- assets/body/
- assets/birds/
- assets/solar/
Expand Down
Loading