From f69a83af72faf0e885c6b0d71a897a1ac453ddd4 Mon Sep 17 00:00:00 2001 From: Stephen Rogers Date: Thu, 19 May 2022 13:54:59 +0100 Subject: [PATCH] updates for version 0.5.2 --- CHANGELOG.md | 4 ++++ example/linux/flutter/generated_plugin_registrant.cc | 2 ++ example/linux/flutter/generated_plugin_registrant.h | 2 ++ example/linux/flutter/generated_plugins.cmake | 8 ++++++++ lib/devicelocale.dart | 7 +++++-- pubspec.yaml | 2 +- 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b69c5c5..ce1d690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.2 - 19 May 2022 + +* Merge PR to detect token rather than hard code + ## 0.5.1 - 07 May 2022 * Merged PRs for Android and Linux updates diff --git a/example/linux/flutter/generated_plugin_registrant.cc b/example/linux/flutter/generated_plugin_registrant.cc index 3b1c83f..ecf8ac6 100644 --- a/example/linux/flutter/generated_plugin_registrant.cc +++ b/example/linux/flutter/generated_plugin_registrant.cc @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #include "generated_plugin_registrant.h" #include diff --git a/example/linux/flutter/generated_plugin_registrant.h b/example/linux/flutter/generated_plugin_registrant.h index 9bf7478..e0f0a47 100644 --- a/example/linux/flutter/generated_plugin_registrant.h +++ b/example/linux/flutter/generated_plugin_registrant.h @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake index 796790d..217d67d 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST devicelocale ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/lib/devicelocale.dart b/lib/devicelocale.dart index bf34e84..fed14b2 100644 --- a/lib/devicelocale.dart +++ b/lib/devicelocale.dart @@ -6,7 +6,8 @@ import 'package:flutter/services.dart'; /// A Simple plug-in that can be used to query a device( iOS or Android) to obtain a list of current set up locales and languages class Devicelocale { - static const MethodChannel _channel = const MethodChannel('uk.spiralarm.flutter/devicelocale'); + static const MethodChannel _channel = + const MethodChannel('uk.spiralarm.flutter/devicelocale'); /// return a [Locale] based on the passed in String [info] or the [defaultLocale] and the platform static Locale? _getAsLocale(String? info, String? defaultLocale) { @@ -19,7 +20,9 @@ class Devicelocale { List localeList = info.split(token); if (localeList.length < 2) { if (defaultLocale != null) { - List defaultList = defaultLocale.contains('-') ? defaultLocale.split('-') : defaultLocale.split('_'); + List defaultList = defaultLocale.contains('-') + ? defaultLocale.split('-') + : defaultLocale.split('_'); if (defaultList.length >= 2) { return Locale(defaultList[0], defaultList[1]); } else { diff --git a/pubspec.yaml b/pubspec.yaml index 118e507..5a1f17a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: devicelocale description: A Flutter package that can be used to extract the locales that are currently defined on a device with the current locale set as the first in the list. -version: 0.5.1 +version: 0.5.2 homepage: https://github.com/magnatronus/flutter-devicelocale environment: