-
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.
Database refactor and feature re-implementation (#27)
* Firebase service update * linked to page * display timespans of all sessions * display image by url * enable GPS check-in, fix bugs on calendar page * add sticker remove firebase_service.dart * add stickers to users' collection while checking in * upload check_in photo * complete photo upload check-in * fix bug on profile page adjust sticker image size * adjust points earned by users * remove unused classes * rename classes * add savedUsers to Event --------- Co-authored-by: heyadi <[email protected]>
- Loading branch information
Showing
28 changed files
with
990 additions
and
147 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
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.
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
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,25 @@ | ||
import 'package:cloud_firestore/cloud_firestore.dart'; | ||
|
||
class Session { | ||
final String sessionID; | ||
final DateTime sessionStartTime; | ||
final DateTime sessionEndTime; | ||
final List<String> savedUsers; | ||
|
||
Session({ | ||
required this.sessionID, | ||
required this.sessionStartTime, | ||
required this.sessionEndTime, | ||
required this.savedUsers, | ||
|
||
}); | ||
@override | ||
String toString() { | ||
return 'Session(' | ||
'ID: $sessionID, ' | ||
'Start Time: $sessionStartTime, ' | ||
'End Time: $sessionEndTime, ' | ||
'Saved Users: $savedUsers' | ||
')'; | ||
} | ||
} |
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,15 @@ | ||
class Sticker { | ||
final String name; | ||
|
||
Sticker({ | ||
required this.name, | ||
}); | ||
@override | ||
bool operator ==(Object other) { | ||
if (identical(this, other)) return true; | ||
return other is Sticker && other.name == name; | ||
} | ||
|
||
@override | ||
int get hashCode => name.hashCode; | ||
} |
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,22 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class CheckInOptionsDialog extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return AlertDialog( | ||
title: Text("Check-in Options"), | ||
content: Text("Would you like to check in with a photo?"), | ||
actions: [ | ||
TextButton( | ||
onPressed: () => Navigator.of(context).pop(false), | ||
child: Text("No"), | ||
), | ||
TextButton( | ||
onPressed: () => Navigator.of(context).pop(true), | ||
child: Text("Yes"), | ||
), | ||
], | ||
); | ||
} | ||
} |
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,81 @@ | ||
import 'dart:io'; | ||
import 'package:bu_passport/components/sticker_painters.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'postmark_widget.dart'; | ||
import 'dart:ui' as ui; | ||
|
||
|
||
|
||
|
||
class SuccessDialog extends StatelessWidget { | ||
final String eventTitle; | ||
final int points; | ||
final ui.Image? image; | ||
final ui.Image? logo; | ||
final ui.Image? frame; | ||
final ui.Image? sticker1; | ||
final ui.Image? sticker2; | ||
static const double STAMP_SIZE=100; | ||
static const double POSTMARK_SIZE=100; | ||
|
||
const SuccessDialog({ | ||
Key? key, | ||
required this.eventTitle, | ||
required this.points, | ||
this.image, this.frame, this.sticker1, this.sticker2, this.logo, | ||
}) : super(key: key); | ||
|
||
|
||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Dialog( | ||
backgroundColor: Colors.white, | ||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), | ||
child: Padding( | ||
padding: const EdgeInsets.all(24.0), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
const Text( | ||
'SUCCESS!', | ||
style: TextStyle( | ||
fontSize: 24, | ||
fontWeight: FontWeight.bold, | ||
color: Color(0xFFCC0000), | ||
fontFamily: 'Inter', | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
const SizedBox(height: 16), | ||
|
||
if (image != null) | ||
CustomPaint( | ||
size: Size(STAMP_SIZE,STAMP_SIZE), | ||
painter: ImagePainter(image,frame,sticker1,sticker2), | ||
), | ||
if(image==null) | ||
CustomPaint( | ||
size: const Size(STAMP_SIZE, STAMP_SIZE), | ||
painter: LogoPainter(logo,sticker1,sticker2), | ||
), | ||
const SizedBox(height: 16), | ||
Text( | ||
eventTitle, | ||
style: const TextStyle( | ||
fontSize: 18, | ||
fontWeight: FontWeight.bold, | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
const SizedBox(height: 16), | ||
CustomPaint( | ||
size: Size(POSTMARK_SIZE,POSTMARK_SIZE), | ||
painter: PostmarkPainter(points: points),// points | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
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
Oops, something went wrong.