Skip to content
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
19 changes: 10 additions & 9 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,15 @@ android {
isCoreLibraryDesugaringEnabled = true
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
// REMOVED compilerOptions from here because it was causing "Unresolved reference"

defaultConfig {
applicationId = "com.ishankumar.maizebus"
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
resValue("string", "google_maps_api_key", localProperties.getProperty("GOOGLE_MAPS_API_KEY"))
resValue("string", "google_maps_api_key", localProperties.getProperty("GOOGLE_MAPS_API_KEY") ?: "")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why did you change it so that if there's no key, it results in ""? We want the code to only compile if there's a key

}

signingConfigs {
Expand All @@ -73,15 +71,18 @@ android {
}
}

// BULLETPROOF FIX: Configure Kotlin compiler tasks directly at the bottom of the file
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
}
}

dependencies {
// the following two might be needed if issues happen
// https://pub.dev/packages/flutter_local_notifications#-android-setup
// implementation("androidx.window:window:1.0.0")
// implementation("androidx.window:window-java:1.0.0")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
implementation(platform("com.google.firebase:firebase-bom:34.6.0"))
}

flutter {
source = "../.."
}
}
2 changes: 1 addition & 1 deletion android/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plugins {
id("com.google.gms.google-services") version("4.3.15") apply false
// END: FlutterFire Configuration

id("org.jetbrains.kotlin.android") version "2.1.0" apply false
id("org.jetbrains.kotlin.android") version "2.3.10" apply false
}

include(":app")
13 changes: 13 additions & 0 deletions lib/widgets/stop_sheet.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:async';
import 'package:bluebus/globals.dart';
import 'package:bluebus/providers/bus_provider.dart';
import 'package:bluebus/services/bus_info_service.dart';
Expand Down Expand Up @@ -254,6 +255,7 @@ class ExpandableStopWidget extends StatefulWidget {
class _StopSheetState extends State<StopSheet> {
late Future<(List<BusWithPrediction>, bool)> loadedStopData;
bool? _isFavorited;
Timer? _refreshTimer;

// for select bus stops with images
late bool imageBusStop;
Expand Down Expand Up @@ -292,6 +294,11 @@ class _StopSheetState extends State<StopSheet> {
if (widget.stopID == "N553") {
imagePath = "assets/PierpontNorthwood.jpg";
}

// Start auto-refresh every 30 seconds
_refreshTimer = Timer.periodic(const Duration(seconds: 30), (timer) {
_refreshData();
});
}

void _refreshData() {
Expand All @@ -300,6 +307,12 @@ class _StopSheetState extends State<StopSheet> {
});
}

@override
void dispose() {
_refreshTimer?.cancel();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Stack(
Expand Down