-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
791 additions
and
597 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
), | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
), | ||
), | ||
) | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}); | ||
} |
Oops, something went wrong.