Skip to content

Commit

Permalink
buttom nav, welcome screen,license,changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
gokeihub committed Sep 10, 2024
1 parent c31ec17 commit f960da5
Show file tree
Hide file tree
Showing 7 changed files with 304 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 1.0.0
-Basic App And functionality and 14 App
27 changes: 27 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Custom License for [Toolify]

Copyright (c) [2024] [Toolify]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "App"), to deal
in the App without restriction, including without limitation the rights
to use, modify, and distribute the App, provided that the following conditions
are met:

1. The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the App.
2. Attribution to the original authors shall be provided.

THE APP IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM,
OUT OF, OR IN CONNECTION WITH THE APP OR THE USE OR OTHER DEALINGS IN THE
APP.

RESTRICTIONS:
- The App may not be used for any commercial purposes without prior written permission
from [Your Name or Organization].
- The App may not be used for malicious activities, including but not limited to,
the distribution of malware, harassment, or illegal activities.
Binary file added assets/app_icon-removebg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
250 changes: 246 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
// import 'package:flutter/material.dart';
// import 'package:flutter_dotenv/flutter_dotenv.dart';
// import 'package:toolify/screen/home/screen/home_page.dart';

// void main() async {
// await dotenv.load(fileName: ".env");
// runApp(const MyApp());
// }

// class MyApp extends StatelessWidget {
// const MyApp({super.key});

// @override
// Widget build(BuildContext context) {
// return MaterialApp(
// theme: ThemeData.dark(),
// title: 'Toolify',
// home: const HomePage(),
// );
// }
// }

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:toolify/screen/category/category.dart';
import 'package:toolify/screen/home/screen/home_page.dart';
import 'package:toolify/screen/setting/setting.dart';

void main() {
void main() async {
await dotenv.load(fileName: ".env");
runApp(const MyApp());
}

Expand All @@ -11,9 +38,224 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark(),
title: 'Toolify',
home: const HomePage(),
theme: ThemeData(
brightness: Brightness.light,
primaryColor: Colors.blueAccent,
iconTheme: const IconThemeData(color: Colors.black54),
),
darkTheme: ThemeData(
brightness: Brightness.dark,
primaryColor: Colors.blueAccent,
iconTheme: const IconThemeData(color: Colors.white70),
),
themeMode: ThemeMode.system,
home: const SplashScreenPage(),
);
}
}

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

@override
SplashScreenPageState createState() => SplashScreenPageState();
}

class SplashScreenPageState extends State<SplashScreenPage> {
@override
void initState() {
super.initState();
_navigateToHome();
}

void _navigateToHome() {
Future.delayed(
const Duration(milliseconds: 1200),
() {
if (mounted) {
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => const StartPage()),
);
}
},
);
}

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color.fromARGB(255, 198, 194, 183),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/app_icon-removebg.png',
height: MediaQuery.of(context).size.height * 0.5,
width: MediaQuery.of(context).size.width * 0.5,
),
const SizedBox(
height: 20,
),
const Text(
'App Is Everyhhing',
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
],
),
),
);
}
}

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

@override
StartPageState createState() => StartPageState();
}

class StartPageState extends State<StartPage> {
int currentIndex = 0;

final List<Widget> _pages = [
const HomePage(),
const CategoryPage(),
const SettingPage(),
];

final List<IconData> _icons = [
Icons.home,
Icons.category,
Icons.settings,
];

final List<String> _titles = [
'Home',
'Category',
'Settings',
];

@override
Widget build(BuildContext context) {
double displayWidth = MediaQuery.of(context).size.width;
final theme = Theme.of(context);
return Scaffold(
body: _pages[currentIndex],
bottomNavigationBar: buildBottomNavigationBar(displayWidth, theme),
);
}

Container buildBottomNavigationBar(double displayWidth, ThemeData theme) {
return Container(
height: 60,
decoration: BoxDecoration(
color:
theme.brightness == Brightness.dark ? Colors.black : Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(.1),
blurRadius: 30,
offset: const Offset(0, 10),
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: List.generate(_icons.length, (index) {
return buildNavItem(index, displayWidth, theme);
}),
),
);
}

Widget buildNavItem(int index, double displayWidth, ThemeData theme) {
return GestureDetector(
onTap: () {
setState(() {
currentIndex = index;
HapticFeedback.lightImpact();
});
},
child: Stack(
children: [
AnimatedContainer(
duration: const Duration(seconds: 1),
curve: Curves.fastLinearToSlowEaseIn,
width:
index == currentIndex ? displayWidth * .32 : displayWidth * .18,
alignment: Alignment.center,
child: AnimatedContainer(
duration: const Duration(seconds: 1),
curve: Curves.fastLinearToSlowEaseIn,
height: index == currentIndex ? displayWidth * .12 : 0,
width: index == currentIndex ? displayWidth * .32 : 0,
decoration: BoxDecoration(
color: index == currentIndex
? theme.primaryColor.withOpacity(.2)
: Colors.transparent,
borderRadius: BorderRadius.circular(50),
),
),
),
AnimatedContainer(
duration: const Duration(seconds: 1),
curve: Curves.fastLinearToSlowEaseIn,
width:
index == currentIndex ? displayWidth * .31 : displayWidth * .18,
alignment: Alignment.center,
child: Stack(
children: [
Row(
children: [
AnimatedContainer(
duration: const Duration(seconds: 1),
curve: Curves.fastLinearToSlowEaseIn,
width: index == currentIndex ? displayWidth * .13 : 0,
),
AnimatedOpacity(
opacity: index == currentIndex ? 1 : 0,
duration: const Duration(seconds: 1),
curve: Curves.fastLinearToSlowEaseIn,
child: Text(
index == currentIndex ? _titles[index] : '',
style: TextStyle(
color: theme.primaryColor,
fontWeight: FontWeight.w600,
fontSize: 15,
),
),
),
],
),
Row(
children: [
AnimatedContainer(
duration: const Duration(seconds: 1),
curve: Curves.fastLinearToSlowEaseIn,
width: index == currentIndex ? displayWidth * .03 : 20,
),
Icon(
_icons[index],
size: displayWidth * .076,
color: index == currentIndex
? theme.primaryColor
: (theme.brightness == Brightness.dark
? Colors.white70
: Colors.black54),
),
],
),
],
),
),
],
),
);
}
}
14 changes: 14 additions & 0 deletions lib/screen/category/category.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:flutter/material.dart';

class CategoryPage extends StatelessWidget {
const CategoryPage({super.key});

@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: Text('CategoryPage'),
),
);
}
}
14 changes: 14 additions & 0 deletions lib/screen/setting/setting.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:flutter/material.dart';

class SettingPage extends StatelessWidget {
const SettingPage({super.key});

@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: Text('SettingPage'),
),
);
}
}
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ flutter:

assets:
- assets/app_icon.png
- assets/app_icon-removebg.png
- .env

0 comments on commit f960da5

Please sign in to comment.