-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implements #18 * Increments version * Changed event state inicator colour The schedule state indicator is now green when a schedule is finished this is to prevent a colour clash of red and green.
- Loading branch information
1 parent
467c0f7
commit fe95e37
Showing
9 changed files
with
248 additions
and
8 deletions.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,14 @@ | ||
import 'package:cached_network_image/cached_network_image.dart'; | ||
|
||
class ComunityData { | ||
final String _title; | ||
final String _subtitle; | ||
final String _link; | ||
final CachedNetworkImageProvider _imageProvider; | ||
ComunityData(this._title, this._subtitle, this._link, this._imageProvider); | ||
|
||
get title => _title; | ||
get subtitle => _subtitle; | ||
get link => _link; | ||
get imageProvider => _imageProvider; | ||
} |
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,90 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'dart:async'; | ||
|
||
import 'package:firebase_database/firebase_database.dart'; | ||
import 'package:cached_network_image/cached_network_image.dart'; | ||
import 'package:cyber_discovery/comunity_data.dart'; | ||
|
||
import 'package:cyber_discovery/widgets/contributers.dart'; | ||
import 'package:cyber_discovery/widgets/comunity.dart'; | ||
import 'package:cyber_discovery/widgets/error_message.dart'; | ||
|
||
class ComunityPage extends StatelessWidget { | ||
final FirebaseDatabase _db; | ||
ComunityPage(this._db); | ||
|
||
Future<List<ComunityData>> getComunityData(FirebaseDatabase db, BuildContext context) async { | ||
DataSnapshot snapshot = await db.reference().child("Comunity").once(); | ||
dynamic data = snapshot.value; | ||
int count = data["count"]; | ||
var configuration = createLocalImageConfiguration(context); | ||
|
||
List<ComunityData> comunityData = []; | ||
for (int i = 0; i<count; i++) { | ||
dynamic rawComunityData = data[i.toString()]; | ||
ComunityData comunity = new ComunityData( | ||
rawComunityData["title"], | ||
rawComunityData["subtitle"], | ||
rawComunityData["link"], | ||
new CachedNetworkImageProvider(rawComunityData["qrLink"])..resolve(configuration) | ||
); | ||
comunityData.add(comunity); | ||
} | ||
return comunityData; | ||
} | ||
|
||
|
||
@override | ||
Widget build(BuildContext context) { | ||
/*List<Widget> comunitys = [ | ||
new Text("Comunity", style: Theme.of(context).textTheme.headline.apply(color: Colors.white)), | ||
new Text("Over the course of Cyber Discovery a large comunity has formed. Originating from the discord server several comunity projects were undertaken showing the strength of the comunity, this app is one of them. Some others and other pillars of the comunity are listed below.", style: Theme.of(context).textTheme.body1.apply(color: Colors.white)), | ||
new Divider(), | ||
new Comunity( | ||
"Discord", | ||
"Come and Lurk", | ||
"https://discord.gg/Kf8n5rT", | ||
"assets/images/discord_qr.png" | ||
), | ||
new Comunity( | ||
"The App", | ||
"Leave a 5 star review xxx", | ||
"https://play.google.com/store/apps/details?id=com.danielmilnes.cyberdiscovery", | ||
"assets/images/playstore_qr.png" | ||
), | ||
new Comunity( | ||
"Challenge Master", "A shit webiste I made", "https://challenge-master.firebaseapp.com/", "assets/images/discord_qr.png") | ||
];*/ | ||
|
||
return new Padding( | ||
padding: new EdgeInsets.all(5.0), | ||
child: new FutureBuilder( | ||
future: getComunityData(_db, context), | ||
builder: (BuildContext context, AsyncSnapshot<List<ComunityData>> snapshot) { | ||
if (snapshot.hasError) { | ||
return new ErrorMessage("Welp Something Went Wrong", "Check your connection to the internet"); | ||
} | ||
|
||
switch (snapshot.connectionState) { | ||
case ConnectionState.waiting: | ||
return new Center( | ||
child: new CircularProgressIndicator(), | ||
); | ||
case (ConnectionState.done): | ||
//Got Data | ||
List<Widget> comunities = [new Contributors()]; | ||
for(ComunityData data in snapshot.data) { | ||
comunities.add(new Comunity(data)); | ||
} | ||
return new ListView(children: comunities); | ||
default: | ||
return new ErrorMessage("Welp Something Went Wrong", "Check your connection to the internet"); | ||
} | ||
} | ||
) | ||
|
||
|
||
|
||
); | ||
} | ||
} |
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,62 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:url_launcher/url_launcher.dart'; | ||
import 'package:cyber_discovery/comunity_data.dart'; | ||
|
||
class Comunity extends StatelessWidget { | ||
final ComunityData _data; | ||
Comunity(this._data); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return new Padding( | ||
padding: new EdgeInsets.symmetric(vertical: 10.0), | ||
child: new Row( | ||
children: <Widget>[ | ||
new SizedBox( | ||
child: new Image(image: _data.imageProvider), | ||
width: 130.0, | ||
height: 130.0, | ||
), | ||
new Flexible( | ||
fit: FlexFit.tight, | ||
child: new Card( | ||
child: new SizedBox( | ||
height: 130.0, | ||
child: new Column( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: <Widget>[ | ||
new Padding( | ||
padding: new EdgeInsets.symmetric(vertical: 10.0), | ||
child: new Text(_data.title, style: Theme.of(context).textTheme.headline, textAlign: TextAlign.center,), | ||
), | ||
new Padding( | ||
padding: new EdgeInsets.only(bottom: 5.0), | ||
child: new Text(_data.subtitle, style: Theme.of(context).textTheme.subhead, textAlign: TextAlign.center,), | ||
), | ||
new Flexible( | ||
child: new Container(), | ||
fit: FlexFit.tight, | ||
), | ||
new Padding( | ||
padding: new EdgeInsets.symmetric(vertical: 5.0), | ||
child: new RaisedButton( | ||
color: Theme.of(context).primaryColor, | ||
textColor: Colors.white, | ||
shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0)), | ||
child: new Text("Click Here or Scan the QR Code"), | ||
onPressed: (){ | ||
launch(_data.link); | ||
}, | ||
), | ||
) | ||
], | ||
), | ||
) | ||
), | ||
) | ||
], | ||
) | ||
); | ||
} | ||
} |
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,72 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
class Contributors extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return new Padding( | ||
padding: new EdgeInsets.symmetric(vertical: 10.0), | ||
child: new Card( | ||
child: new Padding( | ||
padding: new EdgeInsets.all(5.0), | ||
child: new Column( | ||
children: <Widget>[ | ||
new Image.asset("assets/images/contributors.png"), | ||
new Text("Contributors", style: Theme.of(context).textTheme.headline), | ||
new Padding( | ||
padding: new EdgeInsets.symmetric(vertical: 5.0), | ||
child: new Text("This app is the result of some amazing people from the comunity why not give them a follow and show your appreciation."), | ||
), | ||
new GestureDetector( | ||
child: new Padding( | ||
padding: new EdgeInsets.symmetric(vertical: 5.0), | ||
child: new Text("@BenTechy66 - Building the IOS version without paying a cent", style: new TextStyle(color: Colors.lightBlue)), | ||
), | ||
onTap: (){ | ||
launch("https://twitter.com/BenTechy66"); | ||
}, | ||
), | ||
new GestureDetector( | ||
child: new Padding( | ||
padding: new EdgeInsets.symmetric(vertical: 5.0), | ||
child: new Text("@thebeanogamer - Financial support and marketing", style: new TextStyle(color: Colors.lightBlue)), | ||
), | ||
onTap: (){ | ||
launch("https://twitter.com/thebeanogamer"); | ||
}, | ||
), | ||
new GestureDetector( | ||
child: new Padding( | ||
padding: new EdgeInsets.symmetric(vertical: 5.0), | ||
child: new Text("@dwouca - Curing my dislexia and the website", style: new TextStyle(color: Colors.lightBlue)), | ||
), | ||
onTap: (){ | ||
launch("https://twitter.com/dwouca"); | ||
}, | ||
), | ||
new GestureDetector( | ||
child: new Padding( | ||
padding: new EdgeInsets.symmetric(vertical: 5.0), | ||
child: new Text("@OwlNamedSeymour - Everything else", style: new TextStyle(color: Colors.lightBlue)), | ||
), | ||
onTap: (){ | ||
launch("https://twitter.com/OwlNamedSeymour"); | ||
}, | ||
), | ||
new GestureDetector( | ||
child: new Padding( | ||
padding: new EdgeInsets.symmetric(vertical: 5.0), | ||
child: new Text("@BritMonk3y - Graphic Design", style: new TextStyle(color: Colors.lightBlue)), | ||
), | ||
onTap: (){ | ||
launch("https://twitter.com/BritMonk3y"); | ||
}, | ||
), | ||
], | ||
), | ||
), | ||
) | ||
); | ||
} | ||
} |
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