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

Implemented the landing page for the application and Removed the UI overflow #135

Merged
merged 5 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
Binary file added assets/images/studying.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
105 changes: 105 additions & 0 deletions lib/landing_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import 'package:flutter/material.dart';
import 'package:animated_text_kit/animated_text_kit.dart';
import 'pages/home.dart';

class LandingPage extends StatefulWidget {
const LandingPage({super.key});

@override
State<LandingPage> createState() => _LandingPageState();
}

class _LandingPageState extends State<LandingPage> {
@override
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;
return Scaffold(
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(20),
child: Container(
child: Column(
children: [

Center(
child: Container(
width: width,
height: height/2,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/studying.png"),
fit: BoxFit.contain
),
),
),
),

Center(
child: SizedBox(
child: DefaultTextStyle(
style: TextStyle(
fontSize: width/19,
),
child: AnimatedTextKit(
animatedTexts: [
ColorizeAnimatedText(
'Learn',
textStyle: TextStyle(fontSize: width/12, fontWeight: FontWeight.w900),
colors: [ const Color.fromRGBO(255, 183, 77, 1),const Color.fromARGB(255, 231, 225, 208)],
),
],
isRepeatingAnimation: true,
),
),
),
),

const Padding(padding: EdgeInsets.only(top: 20)),
//
Center(
child: SizedBox(
child: Text(
"Learning Made Easy",
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: width/18
),
),
),
),

const Padding(padding: EdgeInsets.only(top: 30)),

Center(
child: SizedBox(
width: width/1.5,
height: height/10,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: const Color.fromRGBO(255, 183, 77, 1),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
)
),
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => MyHomePage()));
},
child: Text("Get started",
style: TextStyle(
color: Colors.white,
fontSize: (width < height) ? width/19 : height/19
),
),
),
),
),

],
),
),
),
),
);
}
}
3 changes: 3 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'package:learn/widgets/navbar/navbar.dart';
import 'cubit/index_cubit.dart';
import 'pages/explore/quiz.dart';
import 'pages/home.dart';
import 'landing_page.dart';

DateTime? currentBackPressTime;

Expand Down Expand Up @@ -50,6 +51,7 @@ class MyApp extends StatelessWidget {
title: 'Home',
theme: theme,
darkTheme: darkTheme,
initialRoute: '/landing_page',
home: Scaffold(
body: const [
MyHomePage(),
Expand All @@ -76,6 +78,7 @@ class MyApp extends StatelessWidget {
AllRoutes.seasonRoute: (context) => SeasonsPage(),
AllRoutes.occupationRoute: (context) => OccupationPage(),
AllRoutes.fruitRoute: (context) => FruitsPage(),
"/landing_page": (context) => const LandingPage(),
},
);
},
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ dependencies:
fluttertoast: ^8.2.5
google_nav_bar: ^5.0.6
flutter_bloc: ^8.1.5
animated_text_kit: ^4.2.2

dev_dependencies:
flutter_test:
Expand Down