Skip to content

Commit

Permalink
Merge pull request #332 from DanXi-Dev/typeahead-fix
Browse files Browse the repository at this point in the history
Fix: School bus feature
  • Loading branch information
w568w authored Mar 2, 2024
2 parents aa3e276 + ca54acf commit bd5cc3b
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 91 deletions.
2 changes: 1 addition & 1 deletion lib/model/celebration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Celebration {
return lunarDate.getMonth() == int.parse(splitTime[0]) &&
lunarDate.getDay() == int.parse(splitTime[1]);
case 3:
return VagueTime.onlymmdd(date).match(dateTime);
return VagueTime.onlyMMdd(date).match(dateTime);
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/repository/fdu/bus_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class BusScheduleItem implements Comparable<BusScheduleItem> {
if (time.isEmpty) {
return null;
}
return VagueTime.onlyMMSS(time.replaceAll(".", ":"));
return VagueTime.onlyHHmm(time.replaceAll(".", ":"));
}

@override
Expand Down
6 changes: 3 additions & 3 deletions lib/util/vague_time.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class VagueTime implements Comparable<VagueTime> {
this.millisecond,
this.microsecond});

factory VagueTime.onlyMMSS(String mmss) {
var splitTime = mmss.split(":");
factory VagueTime.onlyHHmm(String hhmm) {
var splitTime = hhmm.split(":");
return VagueTime(
hour: int.parse(splitTime[0]), minute: int.parse(splitTime[1]));
}

factory VagueTime.onlymmdd(String mmdd) {
factory VagueTime.onlyMMdd(String mmdd) {
var splitTime = mmdd.split("-");
return VagueTime(
month: int.parse(splitTime[0]), day: int.parse(splitTime[1]));
Expand Down
58 changes: 24 additions & 34 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,28 @@
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar)
bitsdojo_window_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "BitsdojoWindowPlugin");
bitsdojo_window_plugin_register_with_registrar(bitsdojo_window_linux_registrar);
g_autoptr(FlPluginRegistrar)
desktop_window_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopWindowPlugin");
desktop_window_plugin_register_with_registrar(desktop_window_registrar);
g_autoptr(FlPluginRegistrar)
file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar)
flutter_js_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterJsPlugin");
flutter_js_plugin_register_with_registrar(flutter_js_registrar);
g_autoptr(FlPluginRegistrar)
flutter_secure_storage_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry,
"FlutterSecureStorageLinuxPlugin");
flutter_secure_storage_linux_plugin_register_with_registrar(
flutter_secure_storage_linux_registrar);
g_autoptr(FlPluginRegistrar)
platform_device_id_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "PlatformDeviceIdLinuxPlugin");
platform_device_id_linux_plugin_register_with_registrar(platform_device_id_linux_registrar);
g_autoptr(FlPluginRegistrar)
tray_manager_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "TrayManagerPlugin");
tray_manager_plugin_register_with_registrar(tray_manager_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) bitsdojo_window_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "BitsdojoWindowPlugin");
bitsdojo_window_plugin_register_with_registrar(bitsdojo_window_linux_registrar);
g_autoptr(FlPluginRegistrar) desktop_window_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopWindowPlugin");
desktop_window_plugin_register_with_registrar(desktop_window_registrar);
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) flutter_js_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterJsPlugin");
flutter_js_plugin_register_with_registrar(flutter_js_registrar);
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
g_autoptr(FlPluginRegistrar) platform_device_id_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "PlatformDeviceIdLinuxPlugin");
platform_device_id_linux_plugin_register_with_registrar(platform_device_id_linux_registrar);
g_autoptr(FlPluginRegistrar) tray_manager_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "TrayManagerPlugin");
tray_manager_plugin_register_with_registrar(tray_manager_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);
}
18 changes: 9 additions & 9 deletions linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
bitsdojo_window_linux
desktop_window
file_selector_linux
flutter_js
flutter_secure_storage_linux
platform_device_id_linux
tray_manager
url_launcher_linux
)
bitsdojo_window_linux
desktop_window
file_selector_linux
flutter_js
flutter_secure_storage_linux
platform_device_id_linux
tray_manager
url_launcher_linux
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
Expand Down
12 changes: 6 additions & 6 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,10 @@ packages:
dependency: transitive
description:
name: dart_style
sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368"
sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9"
url: "https://pub.dev"
source: hosted
version: "2.3.4"
version: "2.3.6"
desktop_window:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1423,10 +1423,10 @@ packages:
dependency: "direct main"
description:
name: provider
sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096"
sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c
url: "https://pub.dev"
source: hosted
version: "6.1.1"
version: "6.1.2"
pub_semver:
dependency: transitive
description:
Expand Down Expand Up @@ -1885,10 +1885,10 @@ packages:
dependency: transitive
description:
name: url_launcher_ios
sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03"
sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5"
url: "https://pub.dev"
source: hosted
version: "6.2.4"
version: "6.2.5"
url_launcher_linux:
dependency: transitive
description:
Expand Down
48 changes: 24 additions & 24 deletions windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@
#include <url_launcher_windows/url_launcher_windows.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
BitsdojoWindowPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("BitsdojoWindowPlugin"));
DesktopWindowPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DesktopWindowPlugin"));
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
FlutterJsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterJsPlugin"));
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
GalPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GalPluginCApi"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
PlatformDeviceIdWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PlatformDeviceIdWindowsPlugin"));
ScreenBrightnessWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ScreenBrightnessWindowsPlugin"));
SharePlusWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
TrayManagerPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("TrayManagerPlugin"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
BitsdojoWindowPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("BitsdojoWindowPlugin"));
DesktopWindowPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DesktopWindowPlugin"));
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
FlutterJsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterJsPlugin"));
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
GalPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GalPluginCApi"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
PlatformDeviceIdWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PlatformDeviceIdWindowsPlugin"));
ScreenBrightnessWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ScreenBrightnessWindowsPlugin"));
SharePlusWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
TrayManagerPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("TrayManagerPlugin"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
26 changes: 13 additions & 13 deletions windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
bitsdojo_window_windows
desktop_window
file_selector_windows
flutter_js
flutter_secure_storage_windows
gal
permission_handler_windows
platform_device_id_windows
screen_brightness_windows
share_plus
tray_manager
url_launcher_windows
)
bitsdojo_window_windows
desktop_window
file_selector_windows
flutter_js
flutter_secure_storage_windows
gal
permission_handler_windows
platform_device_id_windows
screen_brightness_windows
share_plus
tray_manager
url_launcher_windows
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
Expand Down

0 comments on commit bd5cc3b

Please sign in to comment.