diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 28d2b751..8111040e 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -16,7 +16,6 @@ jobs: uses: subosito/flutter-action@v2 with: channel: 'stable' - flutter-version: '3.0.5' - run: | flutter config flutter --version diff --git a/.metadata b/.metadata old mode 100644 new mode 100755 index 529ddf48..bb31f8dc --- a/.metadata +++ b/.metadata @@ -1,10 +1,30 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled and should not be manually edited. +# This file should be version controlled. version: - revision: 2901cd720879ba3d7ba7cbd7d447ec9e80f937b6 - channel: beta + revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + channel: stable project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + - platform: windows + create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/lib/app/views/app_page.dart b/lib/app/views/app_page.dart index 06768b61..ebf3d85e 100755 --- a/lib/app/views/app_page.dart +++ b/lib/app/views/app_page.dart @@ -86,7 +86,7 @@ class AppPage extends ConsumerWidget { titleTextStyle: Theme.of(context).textTheme.titleLarge, actions: [ Padding( - padding: const EdgeInsets.only(right: 6), + padding: const EdgeInsets.only(right: 12), child: DeviceButton(actions: keyActions), ), ], diff --git a/lib/app/views/device_button.dart b/lib/app/views/device_button.dart index e4a316a1..b9e04daf 100755 --- a/lib/app/views/device_button.dart +++ b/lib/app/views/device_button.dart @@ -33,50 +33,42 @@ class DeviceButton extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - return Padding( - padding: const EdgeInsets.only(right: 8.0), - child: IconButton( - tooltip: 'More actions', - icon: OverflowBox( - maxHeight: 44, - maxWidth: 44, - child: _CircledDeviceAvatar(radius), - ), - onPressed: () { - final withContext = ref.read(withContextProvider); + return IconButton( + tooltip: 'More actions', + icon: _CircledDeviceAvatar(radius), + onPressed: () { + final withContext = ref.read(withContextProvider); - showMenu( - context: context, - position: const RelativeRect.fromLTRB(100, 0, 0, 0), - items: [ - PopupMenuItem( - padding: const EdgeInsets.only(left: 11, right: 16), - onTap: isDesktop - ? () { - // Wait for menu to close, and use the main context to open - Timer.run(() { - withContext( - (context) async { - await showBlurDialog( - context: context, - builder: (context) => - const DevicePickerDialog(), - routeSettings: - const RouteSettings(name: 'device_picker'), - ); - }, - ); - }); - } - : null, - child: _SlideInWidget(radius: radius), - ), - if (actions.isNotEmpty) const PopupMenuDivider(), - ...actions, - ], - ); - }, - ), + showMenu( + context: context, + position: const RelativeRect.fromLTRB(100, 0, 0, 0), + items: [ + PopupMenuItem( + padding: const EdgeInsets.only(left: 11, right: 16), + onTap: isDesktop + ? () { + // Wait for menu to close, and use the main context to open + Timer.run(() { + withContext( + (context) async { + await showBlurDialog( + context: context, + builder: (context) => const DevicePickerDialog(), + routeSettings: + const RouteSettings(name: 'device_picker'), + ); + }, + ); + }); + } + : null, + child: _SlideInWidget(radius: radius), + ), + if (actions.isNotEmpty) const PopupMenuDivider(), + ...actions, + ], + ); + }, ); } } diff --git a/lib/oath/views/account_dialog.dart b/lib/oath/views/account_dialog.dart index 2a029149..56d8d168 100755 --- a/lib/oath/views/account_dialog.dart +++ b/lib/oath/views/account_dialog.dart @@ -173,7 +173,7 @@ class AccountDialog extends ConsumerWidget with AccountMixin { ), ], ), - actionsPadding: const EdgeInsets.only(top: 10.0, right: -16.0), + actionsPadding: const EdgeInsets.symmetric(vertical: 10.0), actions: [ Center( child: FittedBox( diff --git a/lib/oath/views/account_view.dart b/lib/oath/views/account_view.dart index 1cf62f09..b1fad373 100755 --- a/lib/oath/views/account_view.dart +++ b/lib/oath/views/account_view.dart @@ -1,11 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:yubico_authenticator/app/state.dart'; -import 'package:yubico_authenticator/cancellation_exception.dart'; import '../../app/message.dart'; import '../../app/shortcuts.dart'; import '../../app/state.dart'; +import '../../cancellation_exception.dart'; import '../../widgets/menu_list_tile.dart'; import '../models.dart'; import '../state.dart'; @@ -81,7 +80,8 @@ class AccountView extends ConsumerWidget with AccountMixin { ref, ) : getCode(ref); - await withContext((context) async => copyToClipboard(context, code)); + await withContext( + (context) async => copyToClipboard(context, code)); }, ); } on CancellationException catch (_) { diff --git a/lib/theme.dart b/lib/theme.dart index 60c6f8ac..27cbcfcf 100755 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -41,12 +41,12 @@ class AppTheme { ), elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( - onPrimary: Colors.white, - primary: primaryBlue, + foregroundColor: Colors.white, + backgroundColor: primaryBlue, )), outlinedButtonTheme: OutlinedButtonThemeData( style: OutlinedButton.styleFrom( - primary: Colors.grey.shade800, + backgroundColor: Colors.grey.shade800, side: BorderSide(width: 1, color: Colors.grey.shade400), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8), @@ -127,12 +127,12 @@ class AppTheme { ), elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( - onPrimary: Colors.black, - primary: primaryGreen, + foregroundColor: Colors.black, + backgroundColor: primaryGreen, )), outlinedButtonTheme: OutlinedButtonThemeData( style: OutlinedButton.styleFrom( - primary: Colors.white70, + foregroundColor: Colors.white70, side: const BorderSide(width: 1, color: Colors.white12), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8), @@ -193,7 +193,7 @@ class AppTheme { static ButtonStyle primaryOutlinedButtonStyle(BuildContext context) => OutlinedButton.styleFrom( - primary: Theme.of(context).colorScheme.onPrimary, + foregroundColor: Theme.of(context).colorScheme.onPrimary, backgroundColor: Theme.of(context).colorScheme.primary, side: BorderSide(width: 1, color: Theme.of(context).colorScheme.primary), diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 56f4a1a9..af9082ed 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -35,7 +35,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898 - FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 + FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811 screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38 shared_preferences_macos: a64dc611287ed6cbe28fd1297898db1336975727 url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3 diff --git a/pubspec.lock b/pubspec.lock index 7188f071..c1514e11 100755 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,7 +21,7 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.11" + version: "3.3.0" args: dependency: transitive description: @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.9.0" boolean_selector: dependency: transitive description: @@ -105,14 +105,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.2.1" checked_yaml: dependency: transitive description: @@ -126,7 +119,7 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" code_builder: dependency: transitive description: @@ -161,7 +154,7 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" dart_style: dependency: transitive description: @@ -182,7 +175,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" ffi: dependency: transitive description: @@ -357,21 +350,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.12" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.1.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" mime: dependency: transitive description: @@ -392,7 +385,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" path_provider_linux: dependency: transitive description: @@ -572,7 +565,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.2" + version: "1.9.0" stack_trace: dependency: transitive description: @@ -607,28 +600,28 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" sync_http: dependency: transitive description: name: sync_http url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.3.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.4.12" timing: dependency: transitive description: @@ -642,7 +635,7 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" url_launcher: dependency: "direct main" description: @@ -712,7 +705,7 @@ packages: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "8.2.2" + version: "9.0.0" watcher: dependency: transitive description: diff --git a/set-version.py b/set-version.py index 9329c08a..d0cad35a 100755 --- a/set-version.py +++ b/set-version.py @@ -90,22 +90,6 @@ def update_pubspec(buf): buf, ) -# Windows Runner.rc -def update_runner_rc(buf): - buf = sub1( - rf'#define VERSION_AS_STRING "{version_pattern}"', - f'#define VERSION_AS_STRING "{version}"', - buf, - ) - - version_as_number = short_version.replace(".", ",") - buf = sub1( - r"#define VERSION_AS_NUMBER \d+,\d+,\d+", - f"#define VERSION_AS_NUMBER {version_as_number}", - buf, - ) - return buf - # Helper version_info def update_helper_version(buf): version_tuple = repr(tuple(int(d) for d in short_version.split(".")) + (0,)) @@ -140,6 +124,5 @@ def update_release_win(buf): ) update_file("pubspec.yaml", update_pubspec) -update_file("windows/runner/Runner.rc", update_runner_rc) update_file("helper/version_info.txt", update_helper_version) update_file("resources/win/release-win.ps1", update_release_win) \ No newline at end of file diff --git a/windows/runner/CMakeLists.txt b/windows/runner/CMakeLists.txt old mode 100644 new mode 100755 index 6034f077..24f0eeae --- a/windows/runner/CMakeLists.txt +++ b/windows/runner/CMakeLists.txt @@ -1,6 +1,11 @@ cmake_minimum_required(VERSION 3.14) project(runner LANGUAGES CXX) +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. add_executable(${BINARY_NAME} WIN32 "flutter_window.cpp" "main.cpp" @@ -10,12 +15,29 @@ add_executable(${BINARY_NAME} WIN32 "Runner.rc" "runner.exe.manifest" ) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) -# This can probably be done in a cleaner way. +# Add helper. This can probably be done in a cleaner way. file(COPY "../../build/windows/helper" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/Release") -file(COPY "../../build/windows/helper" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/Debug") +file(COPY "../../build/windows/helper" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/Debug") \ No newline at end of file diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc old mode 100644 new mode 100755 index c8a14d37..caf18d26 --- a/windows/runner/Runner.rc +++ b/windows/runner/Runner.rc @@ -60,16 +60,16 @@ IDI_APP_ICON ICON "resources\\app_icon.ico" // Version // -#ifdef FLUTTER_BUILD_NUMBER -#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD #else -#define VERSION_AS_NUMBER 6,0,0 +#define VERSION_AS_NUMBER 1,0,0,0 #endif -#ifdef FLUTTER_BUILD_NAME -#define VERSION_AS_STRING #FLUTTER_BUILD_NAME +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION #else -#define VERSION_AS_STRING "6.0.0-dev.0" +#define VERSION_AS_STRING "1.0.0" #endif VS_VERSION_INFO VERSIONINFO @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "Yubico Authenticator" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "authenticator" "\0" - VALUE "LegalCopyright", "Copyright (C) 2021 Yubico. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2022 Yubico. All rights reserved." "\0" VALUE "OriginalFilename", "authenticator.exe" "\0" VALUE "ProductName", "Yubico Authenticator" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0"