Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created new UIs #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/fonts/QuickSand/Quicksand-Bold.ttf
Binary file not shown.
Binary file added assets/fonts/QuickSand/Quicksand-Light.ttf
Binary file not shown.
Binary file added assets/fonts/QuickSand/Quicksand-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/QuickSand/Quicksand-Regular.ttf
Binary file not shown.
Binary file added assets/images/Plants.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/lightDownLeft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/lightDownRightPlant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/lightUpperRightPlant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions lib/constants/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ class AppColors {
static final PROTEGE_CYAN = Hexcolor('#96ece7');
static final PROTEGE_GREY = Hexcolor('#565656');
static final COLOR_ERROR_RED = Colors.red;
static final COLOR_TURQUOISE = Color(0xff80B9E8);
static final COLOR_DARK = Color(0xff303030);
}
33 changes: 13 additions & 20 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import 'package:provider/provider.dart';
import 'package:flutter/cupertino.dart';
import 'blocs/values.dart';


void main() {
runApp( MyApp());
runApp(MyApp());
}

class MyApp extends StatefulWidget {
Expand All @@ -17,29 +16,23 @@ class MyApp extends StatefulWidget {
}

class _MyAppState extends State<MyApp> {

@override
Widget build(BuildContext context) {

return StreamProvider<FirebaseUser>.value(
value:AuthService().user,
child: ChangeNotifierProvider(
value: AuthService().user,
initialData: null,
child: ChangeNotifierProvider(
create: (_) => ThemeNotifier(),
child: Consumer<ThemeNotifier>(
builder: (context, ThemeNotifier notifier, child) {

return MaterialApp(
debugShowCheckedModeBanner: false,
theme: notifier.darkTheme ? darkTheme : lightTheme,
home:Wrapper(),
);
} ,
),
child: Consumer<ThemeNotifier>(
builder: (context, ThemeNotifier notifier, child) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: notifier.darkTheme ? darkTheme : lightTheme,
home: Wrapper(),
);
},
),
),
);
}
}




33 changes: 23 additions & 10 deletions lib/screens/ResourceCenter/category.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'package:dbapp/blocs/values.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class ResourceCategoryTile extends StatelessWidget {
final String categoryName;
Expand All @@ -8,30 +10,41 @@ class ResourceCategoryTile extends StatelessWidget {

@override
Widget build(BuildContext context) {
ThemeNotifier _themeNotifier = Provider.of<ThemeNotifier>(context);
var themeFlag = _themeNotifier.darkTheme;

return Container(
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
side: BorderSide(
width: 1,
color: themeFlag
? Colors.white
: Color(
0xffE8E8E8,
)),
borderRadius: BorderRadius.circular(11.0),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: MediaQuery.of(context).size.width / 2.4,
height: MediaQuery.of(context).size.width / 2.4,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill, image: AssetImage(imagePath))),
)),
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: CircleAvatar(
backgroundImage: AssetImage(imagePath),
radius: MediaQuery.of(context).size.width / 6,
),
),
Container(
width: MediaQuery.of(context).size.width / 2.4,
child: ListTile(
title: Center(
child: Text(
categoryName,
style: TextStyle(fontSize: 18, fontFamily: 'GoogleSans'),
style: TextStyle(
fontSize: 11,
fontFamily: 'Quicksand',
fontWeight: FontWeight.w500),
textAlign: TextAlign.center,
)),
),
Expand Down
86 changes: 52 additions & 34 deletions lib/screens/ResourceCenter/resource.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:dbapp/blocs/values.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:toast/toast.dart';
import 'package:url_launcher/url_launcher.dart';

Expand All @@ -11,6 +13,9 @@ class ResourceTile extends StatelessWidget {

@override
Widget build(BuildContext context) {
ThemeNotifier _themeNotifier = Provider.of<ThemeNotifier>(context);
var themeFlag = _themeNotifier.darkTheme;

return Container(
child: Card(
shape: RoundedRectangleBorder(
Expand All @@ -24,40 +29,53 @@ class ResourceTile extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
),
child: ExpansionTile(
title: Text(resourceName,
style: TextStyle(
fontSize: 20,
fontFamily: 'GoogleSans',
)),
children: <Widget>[
new Center(
child: Padding(
padding: EdgeInsets.fromLTRB(15, 0, 15, 15),
child: new RichText(
text: new TextSpan(
children: [
new TextSpan(
text: link,
style:
new TextStyle(color: Colors.blue),
recognizer: new TapGestureRecognizer()
..onTap = () async {
if (await canLaunch(link)) {
await launch(link);
} else {
Toast.show(
"Could not launch $link",
context,
duration: Toast.LENGTH_SHORT,
gravity: Toast.BOTTOM);
}
},
),
],
),
)))
]),
child: Theme(
data: Theme.of(context).copyWith(
dividerColor: Colors.transparent,
),
child: ExpansionTile(
trailing: Icon(
Icons.arrow_drop_down_sharp,
size: 20,
color: themeFlag ? Colors.white : Colors.black,
),
title: Text(resourceName,
style: TextStyle(
color: themeFlag ? Colors.white : null,
fontSize: 18,
fontFamily: 'Quicksand',
fontWeight: FontWeight.w400,
)),
children: <Widget>[
new Center(
child: Padding(
padding: EdgeInsets.fromLTRB(15, 0, 15, 15),
child: new RichText(
text: new TextSpan(
children: [
new TextSpan(
text: link,
style:
new TextStyle(color: Colors.blue),
recognizer: new TapGestureRecognizer()
..onTap = () async {
if (await canLaunch(link)) {
await launch(link);
} else {
Toast.show(
"Could not launch $link",
context,
duration:
Toast.LENGTH_SHORT,
gravity: Toast.BOTTOM);
}
},
),
],
),
)))
]),
),
),
],
)));
Expand Down
26 changes: 17 additions & 9 deletions lib/screens/ResourceCenter/resourceList.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _ResourceListState extends State<ResourceList> {
padding: EdgeInsets.only(top: 20.0),
child: Text(
"No resources available yet",
style: TextStyle(fontFamily: 'GoogleSans', fontSize: 18),
style: TextStyle(fontFamily: 'Quicksand', fontSize: 18),
),
),
)
Expand All @@ -61,7 +61,7 @@ class _ResourceListState extends State<ResourceList> {
ThemeNotifier _themeNotifier = Provider.of<ThemeNotifier>(context);
var themeFlag = _themeNotifier.darkTheme;
return new Scaffold(
backgroundColor: AppColors.COLOR_TEAL_LIGHT,
backgroundColor: AppColors.COLOR_TURQUOISE,
body: Column(
children: <Widget>[
Expanded(
Expand All @@ -76,19 +76,27 @@ class _ResourceListState extends State<ResourceList> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 32),
IconButton(
icon: Icon(Icons.arrow_back),
icon: Icon(
Icons.arrow_back,
size: 39,
),
onPressed: () {
Navigator.of(context).pop();
},
),
SizedBox(height: 25),
new Text(widget.resourceField,
style: TextStyle(
fontFamily: 'GoogleSans',
fontWeight: FontWeight.bold,
fontSize: 32)),
Container(
constraints: BoxConstraints(
maxWidth:
MediaQuery.of(context).size.width * 0.5,
),
child: new Text(widget.resourceField,
style: TextStyle(
fontFamily: 'Quicksand',
fontWeight: FontWeight.w700,
fontSize: 20)),
),
resourceList()
],
)))),
Expand Down
39 changes: 32 additions & 7 deletions lib/screens/ResourceCenter/resourcesCategoryList.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import 'package:dbapp/blocs/values.dart';
import 'package:dbapp/constants/colors.dart';
import 'package:dbapp/constants/screenConstants.dart';
import 'package:dbapp/screens/ResourceCenter/category.dart';
import 'package:dbapp/screens/ResourceCenter/resourceList.dart';
import 'package:dbapp/services/database.dart';
import 'package:dbapp/services/storage.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:toast/toast.dart';
import 'package:dbapp/shared/myDrawer.dart';

Expand Down Expand Up @@ -40,6 +42,9 @@ class _ResourceCategoryListState extends State<ResourceCategoryList> {

@override
Widget build(BuildContext context) {
ThemeNotifier _themeNotifier = Provider.of<ThemeNotifier>(context);
var themeFlag = _themeNotifier.darkTheme;

final GlobalKey<ScaffoldState> _scaffoldKey =
new GlobalKey<ScaffoldState>();

Expand All @@ -53,17 +58,24 @@ class _ResourceCategoryListState extends State<ResourceCategoryList> {
padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: Column(children: [
Padding(
padding: const EdgeInsets.fromLTRB(15.0, 42, 0, 0),
padding: const EdgeInsets.fromLTRB(19.0, 30, 0, 0),
child: Row(children: [
IconButton(
icon: Icon(Icons.menu),
icon: Icon(
Icons.menu,
size: 28,
color: themeFlag ? Colors.white : Colors.black,
),
onPressed: () {
_scaffoldKey.currentState.openDrawer();
}),
Text(
"Resource Center",
style: TextStyle(
fontFamily: 'GoogleSans', fontSize: 23),
fontFamily: 'Quicksand',
fontSize: 17,
fontWeight: FontWeight.w500,
color: themeFlag ? Colors.white : Colors.black),
)
]),
),
Expand All @@ -74,7 +86,8 @@ class _ResourceCategoryListState extends State<ResourceCategoryList> {
width: MediaQuery.of(context).size.width,
child: Column(children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: <Widget>[
GestureDetector(
onTap: () {
Expand Down Expand Up @@ -106,8 +119,12 @@ class _ResourceCategoryListState extends State<ResourceCategoryList> {
"assets/images/book.jpg"))
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: <Widget>[
GestureDetector(
onTap: () {
Expand Down Expand Up @@ -138,8 +155,12 @@ class _ResourceCategoryListState extends State<ResourceCategoryList> {
"assets/images/scholar.jpg"))
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: <Widget>[
GestureDetector(
onTap: () {
Expand Down Expand Up @@ -169,8 +190,12 @@ class _ResourceCategoryListState extends State<ResourceCategoryList> {
"Open-Source",
"assets/images/opensrc.png"))
]),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: <Widget>[
GestureDetector(
onTap: () {
Expand Down
Loading