Skip to content

Commit 790dec9

Browse files
committed
Bump flutter to 3.7.1 & Add workflows
1 parent 3169cb8 commit 790dec9

21 files changed

+439
-125
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
# build-linux:
11+
# runs-on: ubuntu-latest
12+
# steps:
13+
# - uses: actions/checkout@v2
14+
# - uses: subosito/flutter-action@v2
15+
# - run: |
16+
# sudo apt-get update -y
17+
# sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
18+
# - run: flutter config --enable-linux-desktop
19+
# - run: cd example && flutter build linux -v
20+
build-macos:
21+
runs-on: macos-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: subosito/flutter-action@v2
25+
- run: flutter config --enable-macos-desktop
26+
- run: cd example && flutter build macos -v
27+
build-windows:
28+
runs-on: windows-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: subosito/flutter-action@v2
32+
- run: cd example && flutter build windows -v

.github/workflows/lint.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
analyze:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: subosito/flutter-action@v2
15+
with:
16+
channel: "stable"
17+
- run: flutter analyze --fatal-infos
18+
19+
format:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: subosito/flutter-action@v2
24+
with:
25+
channel: "stable"
26+
- run: dart format . --fix --set-exit-if-changed
27+
28+
dependency_validator:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v3
32+
- uses: subosito/flutter-action@v2
33+
with:
34+
channel: "stable"
35+
- run: flutter pub get
36+
- run: flutter pub run dependency_validator

analysis_options.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
# Additional information about this file can be found at
4+
# https://dart.dev/guides/language/analysis-options

dart_dependency_validator.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
exclude:
2+
- "example/**"

example/analysis_options.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options

example/lib/main.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,29 @@ import './pages/home.dart';
66
void main() {
77
WidgetsFlutterBinding.ensureInitialized();
88

9-
runApp(MyApp());
9+
runApp(const MyApp());
1010
}
1111

1212
class MyApp extends StatefulWidget {
13+
const MyApp({Key? key}) : super(key: key);
14+
1315
@override
14-
_MyAppState createState() => _MyAppState();
16+
State<MyApp> createState() => _MyAppState();
1517
}
1618

1719
class _MyAppState extends State<MyApp> {
1820
@override
1921
Widget build(BuildContext context) {
2022
return MaterialApp(
2123
theme: ThemeData(
22-
primaryColor: Color(0xff416ff4),
24+
primaryColor: const Color(0xff416ff4),
2325
canvasColor: Colors.white,
24-
scaffoldBackgroundColor: Color(0xffF7F9FB),
26+
scaffoldBackgroundColor: const Color(0xffF7F9FB),
2527
dividerColor: Colors.grey.withOpacity(0.3),
2628
),
2729
builder: BotToastInit(),
2830
navigatorObservers: [BotToastNavigatorObserver()],
29-
home: HomePage(),
31+
home: const HomePage(),
3032
);
3133
}
3234
}

example/lib/pages/home.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore_for_file: avoid_print
2+
13
import 'package:bot_toast/bot_toast.dart';
24
import 'package:flutter/material.dart';
35
import 'package:hotkey_manager/hotkey_manager.dart';
@@ -13,8 +15,10 @@ final kShortcutExtractFromScreenSelection =
1315
HotKey(KeyCode.keyX, modifiers: [KeyModifier.alt]);
1416

1517
class HomePage extends StatefulWidget {
18+
const HomePage({Key? key}) : super(key: key);
19+
1620
@override
17-
_HomePageState createState() => _HomePageState();
21+
State<HomePage> createState() => _HomePageState();
1822
}
1923

2024
class _HomePageState extends State<HomePage> {
@@ -65,14 +69,14 @@ class _HomePageState extends State<HomePage> {
6569
return PreferenceList(
6670
children: <Widget>[
6771
PreferenceListSection(
68-
title: Text('METHODS'),
72+
title: const Text('METHODS'),
6973
children: [
7074
PreferenceListItem(
71-
title: Text('extractTextFromClipboard'),
75+
title: const Text('extractTextFromClipboard'),
7276
detailText: Text(kShortcutExtractFromClipboard.toString()),
7377
),
7478
PreferenceListItem(
75-
title: Text('extractTextFromScreenSelection'),
79+
title: const Text('extractTextFromScreenSelection'),
7680
detailText: Text(kShortcutExtractFromScreenSelection.toString()),
7781
),
7882
],

example/linux/flutter/generated_plugin_registrant.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66

77
#include "generated_plugin_registrant.h"
88

9+
#include <clipboard_watcher/clipboard_watcher_plugin.h>
910
#include <hotkey_manager/hotkey_manager_plugin.h>
1011
#include <screen_text_extractor/screen_text_extractor_plugin.h>
1112

1213
void fl_register_plugins(FlPluginRegistry* registry) {
14+
g_autoptr(FlPluginRegistrar) clipboard_watcher_registrar =
15+
fl_plugin_registry_get_registrar_for_plugin(registry, "ClipboardWatcherPlugin");
16+
clipboard_watcher_plugin_register_with_registrar(clipboard_watcher_registrar);
1317
g_autoptr(FlPluginRegistrar) hotkey_manager_registrar =
1418
fl_plugin_registry_get_registrar_for_plugin(registry, "HotkeyManagerPlugin");
1519
hotkey_manager_plugin_register_with_registrar(hotkey_manager_registrar);

example/linux/flutter/generated_plugins.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
#
44

55
list(APPEND FLUTTER_PLUGIN_LIST
6+
clipboard_watcher
67
hotkey_manager
78
screen_text_extractor
89
)
910

11+
list(APPEND FLUTTER_FFI_PLUGIN_LIST
12+
)
13+
1014
set(PLUGIN_BUNDLED_LIBRARIES)
1115

1216
foreach(plugin ${FLUTTER_PLUGIN_LIST})
@@ -15,3 +19,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
1519
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
1620
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
1721
endforeach(plugin)
22+
23+
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
24+
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
25+
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
26+
endforeach(ffi_plugin)

example/macos/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
platform :osx, '10.11'
1+
platform :osx, '10.14'
22

33
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
44
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

0 commit comments

Comments
 (0)