Skip to content

Commit

Permalink
Version 1 (No Known Bugs) Complete
Browse files Browse the repository at this point in the history
  • Loading branch information
SatyamX64 committed Jun 11, 2020
1 parent 4494c7c commit d5db04c
Show file tree
Hide file tree
Showing 21 changed files with 791 additions and 597 deletions.
Binary file added assets/Loading.flr
Binary file not shown.
Binary file added fonts/Raleway-Black.ttf
Binary file not shown.
Binary file added fonts/Raleway-Regular.ttf
Binary file not shown.
Binary file added fonts/Raleway-SemiBold.ttf
Binary file not shown.
Binary file added fonts/Raleway-Thin.ttf
Binary file not shown.
12 changes: 9 additions & 3 deletions lib/Common_Resources/Constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ Color kInsideHeadingColor = kNeon;
Color kHomeHeadingFont = kNeon;
Color kHomeTextFont = Colors.white;

TextStyle kGitooTheme =
TextStyle(color: kNeon, fontSize: 50, fontWeight: FontWeight.w900);
TextStyle kGitooTheme = TextStyle(
color: kNeon,
fontSize: 50,
fontWeight: FontWeight.w700,
fontFamily: 'Raleway');

TextStyle kInsideText = TextStyle(
color: kInsideFontColor,
Expand All @@ -42,7 +45,10 @@ TextStyle kHomeText = TextStyle(
fontWeight: FontWeight.bold,
fontFamily: 'Balsamiq');
TextStyle kHomeHeading = TextStyle(
color: kHomeHeadingFont, fontWeight: FontWeight.bold, fontSize: 20);
color: kHomeHeadingFont,
fontWeight: FontWeight.w700,
fontSize: 20,
fontFamily: 'Raleway');
TextStyle kUserNameStyle = TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
Expand Down
46 changes: 46 additions & 0 deletions lib/Common_Resources/GoodBox.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import 'package:flutter/material.dart';

import 'Constants.dart';

class GoodBox extends StatelessWidget {
final Widget child;
final bool isPressed;
GoodBox({this.child, this.isPressed = false});
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: kPrimary,
borderRadius: BorderRadius.circular(20),
boxShadow: isPressed == true
? [
BoxShadow(
color: kDPrimary,
offset: Offset(-4, -4),
blurRadius: 6,
),
BoxShadow(
color: kLPrimary,
offset: Offset(1, 1),
blurRadius: 10,
),
]
: [
BoxShadow(
color: kDPrimary,
offset: Offset(4, 4),
blurRadius: 10,
),
BoxShadow(
color: kLPrimary,
offset: Offset(-2, -2),
blurRadius: 6,
),
]),
child: Padding(
child: child,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
),
);
}
}
38 changes: 38 additions & 0 deletions lib/Common_Resources/NavBarButton.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import 'package:flutter/material.dart';
import 'Constants.dart';

class NavBarButton extends StatelessWidget {
final IconData icon;
final bool isPressed;
NavBarButton({this.icon, this.isPressed});
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top: 5),
width: 80,
height: 80,
decoration: BoxDecoration(
color: kPrimary,
boxShadow: isPressed == true
? [
BoxShadow(
color: kLPrimary, offset: Offset(1, 1), blurRadius: 6),
BoxShadow(
color: kDPrimary, offset: Offset(-4, -4), blurRadius: 10)
]
: [
BoxShadow(
color: kLPrimary, offset: Offset(-4, -4), blurRadius: 10),
BoxShadow(
color: kDPrimary, offset: Offset(2, 2), blurRadius: 10)
],
borderRadius: BorderRadius.circular(20),
),
child: Icon(
icon,
color: isPressed == true ? kNeon : kTinder,
size: 40,
),
);
}
}
116 changes: 0 additions & 116 deletions lib/Common_Resources/Shared_Widgets.dart

This file was deleted.

61 changes: 61 additions & 0 deletions lib/Common_Resources/SweetBox.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import 'package:flutter/material.dart';
import 'Constants.dart';
import 'GoodBox.dart';

class SweetBox extends StatelessWidget {
final String title;
final IconData icon;
final Color iconColor;
final Function function;
final int count;
final bool isPressed;
SweetBox(
{this.count,
this.title,
this.icon,
this.iconColor,
this.function,
this.isPressed});
@override
Widget build(BuildContext context) {
return Expanded(
child: GestureDetector(
onTap: function,
child: GoodBox(
isPressed: isPressed,
child: Column(
children: <Widget>[
Expanded(
flex: 3,
child: FittedBox(
fit: BoxFit.contain,
child: Icon(
icon,
color: iconColor,
),
),
),
Expanded(
child: FittedBox(
child: Text(
'$title',
style: kHomeHeading,
),
),
),
Expanded(
child: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
'$count',
style: kHomeText,
),
),
)
],
),
),
),
);
}
}
61 changes: 61 additions & 0 deletions lib/DataBundle/DataBundle.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import 'package:flutter/cupertino.dart';
import 'package:gitoo/Network/Network.dart';
import 'package:gitoo/Network/URI.dart';

class DataBundle {
static final api = API();
final networkLoader = NetworkLoader(api);
Future<User> getUserData(String userId) async {
Map<String, dynamic> map = {};
final Map data = await networkLoader.getData(userId);
if (data != null) {
for (int i = 0; i < endpoints.length; i++) {
if (data.containsKey(endpoints[i])) {
map[endpoints[i]] = data[endpoints[i]];
}
}
}
return User(map: map);
}

Future<UserBigData> getUserBigData(String userId) async {
final List<dynamic> repoData = await networkLoader.getRepos(userId);
final List<dynamic> starredData = await networkLoader.getStarred(userId);
final List<dynamic> followersData =
await networkLoader.getFollowers(userId);
final List<dynamic> followingData =
await networkLoader.getFollowing(userId);
final List<dynamic> organisationsData =
await networkLoader.getOrganisations(userId);
final Map map = {};
map['repos'] = repoData;
map['starred'] = starredData;
map['followers'] = followersData;
map['following'] = followingData;
map['organisations'] = organisationsData;
return UserBigData(map: map);
}

List<String> endpoints = [
'login',
'avatar_url',
'name',
'blog',
'location',
'email',
'bio',
'public_repos',
'followers',
'following',
];
}

class User {
final Map map;
User({@required this.map});
}

class UserBigData {
final Map map;
UserBigData({@required this.map});
}
Loading

0 comments on commit d5db04c

Please sign in to comment.