Skip to content

Commit

Permalink
BottomNavFixwithPageTransition
Browse files Browse the repository at this point in the history
BottomNavFixwithPageTransition
  • Loading branch information
sapatevaibhav authored May 28, 2024
2 parents b54c815 + 8dcd97d commit ee1acab
Show file tree
Hide file tree
Showing 11 changed files with 365 additions and 279 deletions.
131 changes: 67 additions & 64 deletions lib/landing_page.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'package:flutter/material.dart';
import 'package:animated_text_kit/animated_text_kit.dart';
import 'pages/home.dart';
import 'package:learn/utils/route/route_constant.dart';

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

@override
State<LandingPage> createState() => _LandingPageState();
Expand All @@ -18,88 +20,89 @@ class _LandingPageState extends State<LandingPage> {
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(
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
),
),
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,
),
),

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
),
),
//
Center(
child: SizedBox(
child: Text(
"Learning Made Easy",
style: TextStyle(
fontWeight: FontWeight.w400, fontSize: width / 18),
),
),

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

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

Center(
child: SizedBox(
width: width/1.5,
height: height/10,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
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(
)),
onPressed: () {
Navigator.popAndPushNamed(
context,
AllRoutesConstant.mainhome,
);
},
child: Text(
"Get started",
style: TextStyle(
color: Colors.white,
fontSize: (width < height) ? width/19 : height/19
),
),
fontSize:
(width < height) ? width / 19 : height / 19),
),
),
),

],
),
),
],
),
),
),
);
}
}
}
76 changes: 8 additions & 68 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
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/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/fruits.dart';
import 'package:learn/pages/explore.dart';
import 'package:learn/pages/favorite.dart';
import 'package:learn/pages/modules/occupation.dart';
import 'package:learn/pages/modules/parts.dart';
import 'package:learn/pages/modules/seasons.dart';
import 'package:learn/pages/modules/shapes.dart';
import 'package:learn/pages/modules/planets.dart';
import 'package:learn/utils/routes.dart';
import 'package:learn/pages/modules/colours.dart';
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';
import 'package:learn/landing_page.dart';
import 'package:learn/utils/route/routes.dart';

DateTime? currentBackPressTime;

Expand All @@ -38,52 +18,12 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return AdaptiveTheme(
light: ThemeData.light(),
dark: ThemeData.dark(),
initial: savedThemeMode ?? AdaptiveThemeMode.light,
builder: (theme, darkTheme) => BlocProvider(
create: (context) => IndexCubit(),
child: BlocBuilder<IndexCubit, int>(
builder: (context, index) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Home',
theme: theme,
darkTheme: darkTheme,
initialRoute: '/landing_page',
home: Scaffold(
body: const [
MyHomePage(),
ExplorePage(),
FavoritePage(),
AboutPage(),
][index],
bottomNavigationBar: const BottomNavBar(),
),
routes: {
AllRoutes.homeRoute: (context) => const MyHomePage(),
AllRoutes.atozRoute: (context) => const AtoZ(),
AllRoutes.birdsRoute: (context) => BirdsPage(),
AllRoutes.shapesRoute: (context) => const ShapesPage(),
AllRoutes.partsRoute: (context) => const PartsPage(),
AllRoutes.solarRoute: (context) => PlanetsPage(),
AllRoutes.animalRoute: (context) => AnimalsPage(),
AllRoutes.colourRoute: (context) => const ColoursPage(),
AllRoutes.aboutRoute: (context) => const AboutPage(),
AllRoutes.flowerRoute: (context) => const FlowerPage(),
AllRoutes.exploreRoute: (context) => const ExplorePage(),
AllRoutes.favoriteRoute: (context) => const FavoritePage(),
AllRoutes.quizRoute: (context) => const QuizPage(),
AllRoutes.seasonRoute: (context) => const SeasonsPage(),
AllRoutes.occupationRoute: (context) => OccupationPage(),
AllRoutes.fruitRoute: (context) => FruitsPage(),
"/landing_page": (context) => const LandingPage(),
},
);
},
),
),
return const MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Learn',
themeMode: ThemeMode.system,
home: LandingPage(),
onGenerateRoute: Routers.generateRoute,
);
}
}
Loading

0 comments on commit ee1acab

Please sign in to comment.