Skip to content

Commit

Permalink
Bottom Nav Bar Work
Browse files Browse the repository at this point in the history
Listviews added
Dummy Components
Added Rodin Font in certain areas
  • Loading branch information
ryanhossain9797 committed Oct 28, 2019
1 parent ee85b01 commit 0e07a67
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 76 deletions.
Binary file added fonts/rodin.ttf
Binary file not shown.
22 changes: 22 additions & 0 deletions lib/components/pc_component.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:flutter/material.dart';
import 'package:pc_build_assistant/constants.dart';

class PCComponent extends StatelessWidget {
final String title;
const PCComponent({Key key, @required this.title}) : super(key: key);

@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(vertical: 8),
decoration: BoxDecoration(
color: kLoginButtonColor,
borderRadius: BorderRadius.all(
Radius.circular(kRadius),
),
),
height: 200,
child: Center(child: Text(title)),
);
}
}
1 change: 1 addition & 0 deletions lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const kAnimatedTextStyle = TextStyle(
color: Colors.white,
fontSize: 24.0,
fontWeight: FontWeight.w900,
fontFamily: "Rodin",
);

const kSendButtonTextStyle = TextStyle(
Expand Down
19 changes: 11 additions & 8 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ class MyApp extends StatelessWidget {
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData.light().copyWith(
appBarTheme: AppBarTheme(
color: Colors.transparent,
elevation: 0.0,
)),
textTheme: TextTheme().apply(fontFamily: "Rodin"),
appBarTheme: AppBarTheme(
color: Colors.transparent,
elevation: 0.0,
),
),
darkTheme: ThemeData.dark().copyWith(
appBarTheme: AppBarTheme(
color: Colors.transparent,
elevation: 0.0,
)),
appBarTheme: AppBarTheme(
color: Colors.transparent,
elevation: 0.0,
),
),
routes: {
WelcomeScreen.id: (context) => WelcomeScreen(),
LoginScreen.id: (context) => LoginScreen(),
Expand Down
101 changes: 37 additions & 64 deletions lib/screens/home_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:pc_build_assistant/components/pc_component.dart';
import 'package:pc_build_assistant/components/rounded_button.dart';
import 'package:pc_build_assistant/constants.dart';

Expand All @@ -15,7 +17,7 @@ class _HomeScreenState extends State<HomeScreen> {
final FirebaseAuth _auth = FirebaseAuth.instance;
FirebaseUser _currentUser;
String userName = "No One Logged In";
int index = 0;
int _index = 0;

GlobalKey _componentsKey = GlobalKey();
GlobalKey _buildKey = GlobalKey();
Expand Down Expand Up @@ -50,7 +52,7 @@ class _HomeScreenState extends State<HomeScreen> {
if (user != null) {
setState(() {
_currentUser = user;
userName = user.email;
userName = _currentUser.email;
});
}
} catch (excp) {
Expand All @@ -62,60 +64,32 @@ class _HomeScreenState extends State<HomeScreen> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("PC Build Assistant"),
title: Text(
"PC Build Assistant",
style: TextStyle(fontFamily: "Rodin"),
),
centerTitle: true,
),
bottomNavigationBar: BottomAppBar(
color: Colors.transparent,
child: Container(
margin: EdgeInsets.symmetric(horizontal: 24),
height: 50,
child: Stack(
children: <Widget>[
// Row(
// children: <Widget>[
// Expanded(
// child: Container(
// decoration: BoxDecoration(
// color:
// index == 0 ? kLoginButtonColor : Colors.transparent,
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(kRadius),
// topRight: Radius.circular(kRadius),
// ),
// ),
// ),
// ),
// Container(
// width: 4,
// ),
// Expanded(
// child: Container(
// decoration: BoxDecoration(
// color:
// index == 1 ? kLoginButtonColor : Colors.transparent,
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(kRadius),
// topRight: Radius.circular(kRadius),
// ),
// ),
// ),
// ),
// ],
// ),
AnimatedAlign(
curve: Curves.decelerate,
duration: Duration(milliseconds: 200),
duration: Duration(milliseconds: 300),
alignment:
index == 0 ? Alignment.centerLeft : Alignment.centerRight,
child: Container(
_index == 0 ? Alignment.centerLeft : Alignment.centerRight,
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
width: _tabWidth,
height: _tabHeight,
decoration: BoxDecoration(
color: kLoginButtonColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(kRadius),
topRight: Radius.circular(kRadius),
topLeft: _index == 1 ? Radius.circular(30) : Radius.zero,
topRight: _index == 0 ? Radius.circular(30) : Radius.zero,
),
),
),
Expand All @@ -129,25 +103,21 @@ class _HomeScreenState extends State<HomeScreen> {
child: Container(
key: _componentsKey,
child: Center(
child: AnimatedDefaultTextStyle(
duration: Duration(milliseconds: 100),
style: index == 0
? TextStyle(
fontSize: 16, fontWeight: FontWeight.bold)
: TextStyle(fontSize: 14),
child: Text("Components"),
child: Icon(
FontAwesomeIcons.shoppingCart,
size: _index == 0 ? 22 : 20,
),
),
),
onTap: () {
setState(() {
index = 0;
_index = 0;
});
},
),
),
Container(
width: 4,
width: 10,
),
Expanded(
child: InkWell(
Expand All @@ -156,19 +126,15 @@ class _HomeScreenState extends State<HomeScreen> {
child: Container(
key: _buildKey,
child: Center(
child: AnimatedDefaultTextStyle(
duration: Duration(milliseconds: 100),
style: index == 1
? TextStyle(
fontSize: 16, fontWeight: FontWeight.bold)
: TextStyle(fontSize: 14),
child: Text("My Build"),
child: Icon(
FontAwesomeIcons.screwdriver,
size: _index == 1 ? 22 : 20,
),
),
),
onTap: () {
setState(() {
index = 1;
_index = 1;
});
},
),
Expand All @@ -190,18 +156,25 @@ class _HomeScreenState extends State<HomeScreen> {
),
Expanded(
child: IndexedStack(
index: index,
index: _index,
children: <Widget>[
Center(
child: Text("First"),
),
Center(
child: Text("Second"),
ListView(
children: <Widget>[
PCComponent(title: "First 1"),
PCComponent(title: "First 2"),
PCComponent(title: "First 3"),
],
),
ListView(
children: <Widget>[
PCComponent(title: "Second 1"),
PCComponent(title: "Second 2"),
PCComponent(title: "Second 3"),
],
)
],
),
),
SizedBox.fromSize(size: Size(1, 20)),
Padding(
padding: EdgeInsets.symmetric(vertical: 8.0),
child: Hero(
Expand Down
5 changes: 4 additions & 1 deletion lib/screens/login_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ class _LoginScreenState extends State<LoginScreen> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Login"),
title: Text(
"Login",
style: TextStyle(fontFamily: "Rodin"),
),
centerTitle: true,
),
body: ModalProgressHUD(
Expand Down
5 changes: 4 additions & 1 deletion lib/screens/registration_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Register"),
title: Text(
"Register",
style: TextStyle(fontFamily: "Rodin"),
),
centerTitle: true,
),
body: ModalProgressHUD(
Expand Down
5 changes: 4 additions & 1 deletion lib/screens/reset_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ class _ResetScreenState extends State<ResetScreen> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Reset Password"),
title: Text(
"Reset Password",
style: TextStyle(fontFamily: "Rodin"),
),
centerTitle: true,
backgroundColor: Colors.transparent,
elevation: 0.0,
Expand Down
1 change: 0 additions & 1 deletion lib/screens/welcome_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
),
Expanded(
child: TypewriterAnimatedTextKit(
isRepeatingAnimation: false,
duration: Duration(seconds: 10),
text: ["PC Build Assistant"],
textStyle: kAnimatedTextStyle,
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
font_awesome_flutter:
dependency: "direct dev"
description:
name: font_awesome_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "8.5.0"
google_sign_in:
dependency: "direct main"
description:
Expand Down
5 changes: 5 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
font_awesome_flutter: ^8.5.0


# For information on the generic Dart part of this file, see the
Expand Down Expand Up @@ -78,3 +79,7 @@ flutter:
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
fonts:
- family: Rodin
fonts:
- asset: fonts/rodin.ttf

0 comments on commit 0e07a67

Please sign in to comment.