Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
Responsive Islands
Browse files Browse the repository at this point in the history
  • Loading branch information
bhivam committed Sep 20, 2023
1 parent 7df0be4 commit 903a23d
Show file tree
Hide file tree
Showing 24 changed files with 152 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_ios-6.1.4/","native_build":true,"dependencies":[]},{"name":"webview_flutter_wkwebview","path":"/Users/shivam/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-2.9.5/","native_build":true,"dependencies":[]}],"android":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_android-2.0.24/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_android-6.0.26/","native_build":true,"dependencies":[]},{"name":"webview_flutter_android","path":"/Users/shivam/.pub-cache/hosted/pub.dev/webview_flutter_android-2.10.4/","native_build":true,"dependencies":[]}],"macos":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_macos-3.0.4/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.10/","native_build":false,"dependencies":[]},{"name":"url_launcher_linux","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_linux-3.0.4/","native_build":true,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.5/","native_build":false,"dependencies":[]},{"name":"url_launcher_windows","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_windows-3.0.5/","native_build":true,"dependencies":[]}],"web":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_web-2.0.16/","dependencies":[]}]},"dependencyGraph":[{"name":"mobile_scanner","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2023-09-05 13:43:36.589191","version":"3.7.7"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_ios-6.1.4/","native_build":true,"dependencies":[]},{"name":"webview_flutter_wkwebview","path":"/Users/shivam/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-2.9.5/","native_build":true,"dependencies":[]}],"android":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_android-2.0.24/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_android-6.0.26/","native_build":true,"dependencies":[]},{"name":"webview_flutter_android","path":"/Users/shivam/.pub-cache/hosted/pub.dev/webview_flutter_android-2.10.4/","native_build":true,"dependencies":[]}],"macos":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_macos-3.0.4/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.10/","native_build":false,"dependencies":[]},{"name":"url_launcher_linux","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_linux-3.0.4/","native_build":true,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.5/","native_build":false,"dependencies":[]},{"name":"url_launcher_windows","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_windows-3.0.5/","native_build":true,"dependencies":[]}],"web":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_web-2.0.16/","dependencies":[]}]},"dependencyGraph":[{"name":"mobile_scanner","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2023-09-19 15:13:54.625140","version":"3.7.7"}
Binary file modified assets/assets-png/cloud1.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 modified assets/assets-png/cloud2.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 modified assets/assets-png/cloud3.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 modified assets/assets-png/cloud4.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 modified assets/assets-png/cloud5.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 modified assets/assets-png/frog_island.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 modified assets/assets-png/little_whale.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 modified assets/assets-png/rabbit_island.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 modified assets/assets-png/racoon_island.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 modified assets/assets-png/side_island.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 modified assets/assets-png/small_island1.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 modified assets/assets-png/small_island2.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 modified assets/assets-png/small_island3.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 modified assets/assets-png/small_island4.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 modified assets/assets-png/small_island5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions lib/defaults.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
///=======================================
/// ENDPOINTS
///=======================================
const BASE_URL = 'https://api.hackru.org/dev';
// const BASE_URL = 'https://api.hackru.org/prod';
// const BASE_URL = 'https://api.hackru.org/dev';
const BASE_URL = 'https://api.hackru.org/prod';

const MISC_URL = 'http://hackru-misc.s3-website-us-west-2.amazonaws.com';
const WAIVER_URL = 'https://hackru.org/resources/waiver.pdf';
Expand Down Expand Up @@ -49,7 +49,7 @@ final String kSplashScreen = 'assets/splashScreen.png';
///=======================================
const String kAppTitle = 'HackRU';
const String kSeasonTitle = 'Spring 2023';
const String kSeasonTitle = 'Fall 2023';
const kAboutHackRU =
'HackRU is a 24-hour hackathon at Rutgers University. We welcome hundreds of students to join us in building awesome tech projects. Industry experts and mentors help foster an atmosphere of learning through tech-talks and one-on-one guidance. We encourage all students, no matter their experience level or educational background, to challenge themselves and expand their creative, technical, and collaboration skills at HackRU.';
const kAboutApp =
Expand Down
19 changes: 0 additions & 19 deletions lib/generated_plugin_registrant.dart

This file was deleted.

16 changes: 16 additions & 0 deletions lib/services/hackru_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ var qrEvents = json.encode(events);
///========================================================
Future<List<Map>> slackResources() async {
print("noo");
Map resources;
var tsNow = (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString();

Expand Down Expand Up @@ -320,6 +321,21 @@ Future<bool> isAuthorizedForQRScanner(String token, String email) async {
}
}

Future<int> getRegistered(String _token) async {
var result = await postLcs('/read', {
'token': _token,
'query': {'registration_status': 'registered'},
'aggregate': false
});

if (result.statusCode == 200) {
var users = jsonDecode(result.body)['body'];
return users.length;
} else {
throw LcsError(result);
}
}

Future<int> getAttending(String _token) async {
var result = await postLcs('/read', {
'token': _token,
Expand Down
27 changes: 26 additions & 1 deletion lib/ui/pages/dashboard/dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,25 @@ class DashboardState extends State<Dashboard> {
);
}

void _onGetRegistered(BuildContext context) async {
var _storedEmail = credManager!.getEmail();
var _authToken = credManager!.getAuthToken();
var count = 0;
try {
count = await getRegistered(_authToken);
warningDialog(
context,
"Total = " + count.toString(),
const Color.fromARGB(255, 19, 61, 53),
HackRUColors.pale_yellow,
HackRUColors.white);
} on LcsError {
var result = "Error Fetching Result.";
warningDialog(context, result, HackRUColors.blue,
HackRUColors.pale_yellow, HackRUColors.blue_grey);
}
}

void _onGetAttending(BuildContext context) async {
var _storedEmail = credManager!.getEmail();
var _authToken = credManager!.getAuthToken();
Expand Down Expand Up @@ -272,7 +291,7 @@ class DashboardState extends State<Dashboard> {
IconData(checkedin ? 0xe157 : 0xf68b,
fontFamily: 'MaterialIcons'),
color: checkedin
? Colors.green
? Color(0xff73bb67)
: Colors.red,
size: 30.0,
),
Expand Down Expand Up @@ -338,6 +357,12 @@ class DashboardState extends State<Dashboard> {
bgColor: Colors.black26,
textColor: HackRUColors.pale_yellow,
label: "QR Scanner"),
// const SizedBox(height: 7.5),
// DashboardButton(
// onPressed: () => _onGetRegistered(context),
// bgColor: Colors.black26,
// textColor: HackRUColors.pale_yellow,
// label: "Get Registered"),
const SizedBox(height: 7.5),
DashboardButton(
onPressed: () => _onGetAttending(context),
Expand Down
127 changes: 103 additions & 24 deletions lib/ui/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ class _HomeState extends State<Home> {

@override
Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height;
double width = MediaQuery.of(context).size.width;
double widthToHeight = width / height;

bool sm = widthToHeight < 0.6;
bool md = widthToHeight >= 0.6 && widthToHeight < 1;
bool lg = widthToHeight >= 1 && widthToHeight < 1.5;
bool xl = widthToHeight >= 1.5;

final _kBottomNavPages = <Widget>[
const Announcements(),
Dashboard(
Expand All @@ -92,82 +101,152 @@ class _HomeState extends State<Home> {
])),
),
WeatherBg(
weatherType: WeatherType.sunnyNight,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height),
weatherType: WeatherType.sunnyNight, width: width, height: height),
const Sunrays(),
Clouds(MediaQuery.of(context).size.height),
// whale island group
FloatingIsland(
floatDistance: 0.005,
floatDuration: 2000,
top: 0.225,
left: 0.05,
top: .225,
left: lg || xl ? 0.35 : 0.05,
pageController: _pageController,
speed: 0.05,
size: 1,
size: lg || xl ? 0.7 : 1,
imageName: "assets/assets-png/whale_clouds.png",
),
FloatingIsland(
floatDistance: 0.01,
floatDuration: 2000,
top: 0.15,
left: 0.2,
top: xl
? 0.065
: lg
? 0.125
: 0.15,
left: sm
? 0.2
: md
? 0.35
: lg
? 0.5
: 0.55,
pageController: _pageController,
speed: 0.15,
size: 1,
size: sm
? 1
: md
? 0.8
: lg
? 0.6
: 0.525,
imageName: "assets/assets-png/whale_island.PNG",
),
FloatingIsland(
floatDistance: 0.015,
floatDuration: 2000,
top: 0.475,
left: 0.7,
top: sm
? 0.525 + 0.85 * (widthToHeight - 0.462)
: md
? 0.81 + 0.675 * (widthToHeight - 1)
: lg
? 0.87 + 0.5 * (widthToHeight - 1.5)
: 0.845 + 1 * (widthToHeight - 1.8),
left: sm
? 0.83
: md
? 0.86
: 0.88,
pageController: _pageController,
speed: 0.15,
size: 0.3,
size: sm
? 0.02
: md
? 0.015
: 0.0125,
imageName: "assets/assets-png/small_island4.png",
),
FloatingIsland(
floatDistance: 0.0175,
floatDuration: 2000,
top: 0.465,
left: 0.77,
top: sm
? 0.5325 + 0.85 * (widthToHeight - 0.462)
: md
? 0.82 + 0.675 * (widthToHeight - 1)
: lg
? 0.865 + 0.5 * (widthToHeight - 1.5)
: 0.85 + 1 * (widthToHeight - 1.8),
left: xl
? 0.914
: lg
? 0.9125
: 0.9,
pageController: _pageController,
speed: 0.15,
size: 0.3,
size: sm
? 0.02
: md
? 0.015
: 0.0125,
imageName: "assets/assets-png/small_island4.png",
),

// side island group
FloatingIsland(
floatDistance: 0.01,
floatDuration: 2000,
top: 0.5,
left: -0.075,
top: sm
? 0.575
: md
? 0.45
: 0.3,
left: -0.05,
pageController: _pageController,
speed: 0.05,
size: 0.6,
size: sm
? 0.25
: md
? 0.2
: 0.15,
imageName: "assets/assets-png/side_island.png",
),
FloatingIsland(
floatDistance: 0.015,
floatDuration: 2000,
top: 0.68,
left: 0,
top: sm
? 0.685 + 0.3 * (widthToHeight - 0.462)
: md
? 0.65 + 0.25 * (widthToHeight - 1)
: 0.525 + 0.2 * (widthToHeight - 1.5),
left: sm
? 0.1825
: md
? 0.15
: 0.1,
pageController: _pageController,
speed: 0.075,
size: 0.4,
size: sm
? 0.12
: md
? 0.1
: 0.07,
imageName: "assets/assets-png/small_island1.png",
),
FloatingIsland(
floatDistance: 0.015,
floatDuration: 2000,
top: 0.7125,
left: -0.095,
top: sm
? 0.725 + 0.3 * (widthToHeight - 0.462)
: md
? 0.71 + 0.25 * (widthToHeight - 1)
: 0.575 + 0.2 * (widthToHeight - 1.5),
left: sm ? 0.075 : 0.04,
pageController: _pageController,
speed: 0.075,
size: 0.4,
size: sm
? 0.085
: md
? 0.07
: 0.05,
imageName: "assets/assets-png/small_island2.png",
),

Expand Down
1 change: 1 addition & 0 deletions lib/ui/widgets/floating_island.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class _FloatingIslandState extends State<FloatingIsland>
top: (widget.top + dy) * screenHeight,
left: (widget.left + dx) * screenWidth,
child: Container(
// width: widget.size * screenWidth,
width: widget.size * screenWidth,
child: Image.asset(widget.imageName),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/widgets/timer_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import "package:flutter/material.dart";

import '../../styles.dart';

final hackRUStart = DateTime(2023, DateTime.february, 25, 16, 00, 00);
final hackRUEnd = DateTime(2023, DateTime.february, 26, 17, 30, 00);
final hackRUStart = DateTime(2023, DateTime.october, 7, 10, 00, 00);
final hackRUEnd = DateTime(2023, DateTime.october, 8, 15, 30, 00);

DateTime today =
DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day);
Expand Down
10 changes: 0 additions & 10 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ homepage: http://hackru.org/
repository: https://github.com/HackRU/OneAppFlutter

environment:
# sdk: ">=2.13.0 <3.0.0"
sdk: ">=2.17.0-69.2.beta <3.0.0"

dependencies:
Expand All @@ -17,27 +16,18 @@ dependencies:
cupertino_icons: ^1.0.4
equatable: ^2.0.3

# firebase_messaging: ^11.2.11
# flare_flutter: ^3.0.2
flutter_launcher_icons: ^0.10.0
flutter_linkify: ^5.0.2
# flutter_local_notifications: ^9.4.0
font_awesome_flutter: ^10.1.0
jsqr: ^0.1.4
qr_flutter: ^4.0.0
# qr_code_scanner: ^0.7.0
http: ^0.13.4
intl: ^0.17.0
json_annotation: ^4.4.0
meta: ^1.7.0
mobile_scanner: ^2.0.0
# mobile_scanner:
# path: depend/mobile_scanner-more_fixes
# path_provider: ^2.0.9
provider: ^6.0.2
# rive: ^0.8.4
rubber: ^1.0.1
# rxdart: ^0.27.3
url_launcher: ^6.0.20
url_strategy: ^0.2.0
webview_flutter: ^3.0.1
Expand Down

1 comment on commit 903a23d

@vercel
Copy link

@vercel vercel bot commented on 903a23d Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.