Skip to content

Commit

Permalink
Add app logo, Screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
FaizFk committed Jan 16, 2023
1 parent 46c8b2a commit 16ca564
Show file tree
Hide file tree
Showing 23 changed files with 58 additions and 37 deletions.
Binary file added live_score_flutter_app/Screenshots/Demo Video.mp4
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 live_score_flutter_app/Screenshots/login.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 live_score_flutter_app/Screenshots/ongoing.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 live_score_flutter_app/Screenshots/previous.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 live_score_flutter_app/Screenshots/signup.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.live_score_flutter_app">
<application
android:label="live_score_flutter_app"
android:label="Live Score"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 29 additions & 21 deletions live_score_flutter_app/lib/providers/games_admin_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class GamesAdminProvider extends ChangeNotifier {
notifyListeners();
}

Future<void> sendNotificationToDevices(String title, String body, String topic) async {
Future<void> sendNotificationToDevices(
String title, String body, String topic) async {
await http.post(Uri.parse('https://fcm.googleapis.com/fcm/send'),
headers: <String, String>{
'Content-Type': 'application/json',
Expand Down Expand Up @@ -62,7 +63,10 @@ class GamesAdminProvider extends ChangeNotifier {
id: myDoc.id,
);
await myDoc.set(announcement.toJson());
await sendNotificationToDevices('${announcement.creatorName} (${announcement.collegeName})', announcement.message,announcement.collegeName.replaceAll(' ', ''));
await sendNotificationToDevices(
'${announcement.creatorName} (${announcement.collegeName})',
announcement.message,
announcement.collegeName.replaceAll(' ', ''));
Utils.showSnackbar('Your message was announced');
} catch (e) {
print(e);
Expand Down Expand Up @@ -115,28 +119,32 @@ class GamesAdminProvider extends ChangeNotifier {

Future<void> changeScore(
{bool isIncrease = true, bool isScore1 = true}) async {
if (isScore1) {
if (isIncrease) {
await _dbOngoingGamesRT
.child('${currentGame.id}/score1')
.set(++_currentGame.score1);
} else {
await _dbOngoingGamesRT
.child('${currentGame.id}/score1')
.set(_currentGame.score1 > 0 ? --_currentGame.score1 : 0);
}
} else {
if (isIncrease) {
await _dbOngoingGamesRT
.child('${currentGame.id}/score2')
.set(++_currentGame.score2);
try {
if (isScore1) {
if (isIncrease) {
await _dbOngoingGamesRT
.child('${currentGame.id}/score1')
.set(++_currentGame.score1);
} else {
await _dbOngoingGamesRT
.child('${currentGame.id}/score1')
.set(_currentGame.score1 > 0 ? --_currentGame.score1 : 0);
}
} else {
await _dbOngoingGamesRT
.child('${currentGame.id}/score2')
.set((_currentGame.score2) > 0 ? --_currentGame.score2 : 0);
if (isIncrease) {
await _dbOngoingGamesRT
.child('${currentGame.id}/score2')
.set(++_currentGame.score2);
} else {
await _dbOngoingGamesRT
.child('${currentGame.id}/score2')
.set((_currentGame.score2) > 0 ? --_currentGame.score2 : 0);
}
}
notifyListeners();
} catch (e) {
Utils.showSnackbar('Please check your internet connection');
}
notifyListeners();
}

Future<void> sendKeyMoments(String message) async {
Expand Down
20 changes: 12 additions & 8 deletions live_score_flutter_app/lib/providers/games_users_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,17 @@ class GameUsersProvider extends ChangeNotifier {

Future<List<String>> getAllCollegesOngoing() async {
List<String> collegeList = [];
final snapshotGames = await _dbOngoingGamesRT.get();
if (snapshotGames.exists) {
Map<dynamic, dynamic> result =
snapshotGames.value as Map<dynamic, dynamic>;
collegeList = List<String>.from(result.values.map((e) {
return e['college'];
}).toSet());
try {
final snapshotGames = await _dbOngoingGamesRT.get();
if (snapshotGames.exists) {
Map<dynamic, dynamic> result =
snapshotGames.value as Map<dynamic, dynamic>;
collegeList = List<String>.from(result.values.map((e) {
return e['college'];
}).toSet());
}
} catch (e) {
Utils.showSnackbar("Something went wrong");
}
return collegeList;
}
Expand Down Expand Up @@ -129,7 +133,7 @@ class GameUsersProvider extends ChangeNotifier {
try {
final pref = await SharedPreferences.getInstance();
if (pref.getBool('All') == null) {
await FirebaseMessaging.instance.subscribeToTopic('All');
await FirebaseMessaging.instance.subscribeToTopic('All');
await pref.setBool('All', true);
}
} catch (e) {
Expand Down
23 changes: 16 additions & 7 deletions live_score_flutter_app/lib/screens/announcements_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AnnouncementScreen extends StatelessWidget {
title: const Text("Announcements 🔊"),
),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal:12.0),
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: FutureBuilder(
future: Provider.of<GameUsersProvider>(context, listen: false)
.getAnnouncements(),
Expand Down Expand Up @@ -118,8 +118,8 @@ class _NotificationDropdownState extends State<NotificationDropdown> {
final myFuture =
Provider.of<GameUsersProvider>(context, listen: false).getAllColleges();
return Container(
padding: const EdgeInsets.symmetric(vertical:7.5),
color:Colors.white,
padding: const EdgeInsets.symmetric(vertical: 7.5),
color: Colors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand All @@ -141,13 +141,22 @@ class _NotificationDropdownState extends State<NotificationDropdown> {
tristate: true,
value: collegeMap[e],
onChanged: (value) async {
Navigator.pop(dropDownNode.context!);
Navigator.pop(dropDownNode.context!);
showDialog(
context: context,
barrierDismissible: false,
builder: (context) => const Center(
child:
CircularProgressIndicator(),
));
await Provider.of<GameUsersProvider>(
context,
listen: false)
.subscribeToCollege(value ?? false, e);
setState(() {
});
.subscribeToCollege(
value ?? false, e);
Navigator.pop(context);
setState(() {
});
}),
Text(e),
])))
Expand Down

0 comments on commit 16ca564

Please sign in to comment.