Skip to content

Commit

Permalink
Update stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
vyPal committed Nov 16, 2024
1 parent d5ad25c commit 59fd52e
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 177 deletions.
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.2.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
id "org.jetbrains.kotlin.android" version "2.0.21" apply false
id "com.google.gms.google-services" version "4.3.3" apply false
}

Expand Down
8 changes: 4 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class PageBaseState extends BaseState<PageBase> {
bool refresh = true;
bool iCanteenEnabled = false;
bool _isCheckingForUpdate = false;
final ShorebirdCodePush _shorebirdCodePush = ShorebirdCodePush();
final ShorebirdUpdater _shorebirdCodePush = ShorebirdUpdater();

SessionManager sessionManager = SessionManager();

Expand Down Expand Up @@ -189,15 +189,15 @@ class PageBaseState extends BaseState<PageBase> {

// Ask the Shorebird servers if there is a new patch available.
final isUpdateAvailable =
await _shorebirdCodePush.isNewPatchAvailableForDownload();
await _shorebirdCodePush.checkForUpdate();

if (!mounted) return;

setState(() {
_isCheckingForUpdate = false;
});

if (isUpdateAvailable) {
if (isUpdateAvailable == UpdateStatus.outdated) {
_downloadUpdate();
}
}
Expand Down Expand Up @@ -236,7 +236,7 @@ class PageBaseState extends BaseState<PageBase> {

Future<void> _downloadUpdate() async {
_showDownloadingBanner();
await _shorebirdCodePush.downloadUpdateIfAvailable();
await _shorebirdCodePush.update();
if (!mounted) return;

ScaffoldMessenger.of(context).hideCurrentMaterialBanner();
Expand Down
24 changes: 12 additions & 12 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
g_autoptr(FlPluginRegistrar) gtk_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
gtk_plugin_register_with_registrar(gtk_registrar);
g_autoptr(FlPluginRegistrar) sentry_flutter_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");
sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
g_autoptr(FlPluginRegistrar) gtk_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
gtk_plugin_register_with_registrar(gtk_registrar);
g_autoptr(FlPluginRegistrar) sentry_flutter_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");
sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
}
2 changes: 1 addition & 1 deletion macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import package_info_plus
import path_provider_foundation
import sentry_flutter
import shared_preferences_foundation
import sqflite
import sqflite_darwin
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
Expand Down
Loading

0 comments on commit 59fd52e

Please sign in to comment.