Skip to content

Commit d242acc

Browse files
committed
Bump flutter to 3.7.5 & Add workflows
1 parent f788470 commit d242acc

13 files changed

+175
-55
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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
.buildlog/
99
.history
1010
.svn/
11+
migrate_working_dir/
1112

1213
# IntelliJ related
1314
*.iml

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 LiJianying <[email protected]>
3+
Copyright (c) 2023 LiJianying <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

analysis_options.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
include: package:flutter_lints/flutter.yaml
22

3-
# Additional information about this file can be found at
4-
# https://dart.dev/guides/language/analysis-options
3+
linter:
4+
rules:
5+
## Error Rules
6+
- always_use_package_imports
7+
## Style rules
8+
- directives_ordering
9+
- eol_at_end_of_file
10+
- file_names
11+
- flutter_style_todos
12+
- library_names
13+
- library_prefixes
14+
- prefer_is_empty
15+
- prefer_is_not_empty
16+
- prefer_is_not_operator
17+
- prefer_null_aware_method_calls
18+
- prefer_single_quotes
19+
- sort_constructors_first
20+
- sort_unnamed_constructors_first
21+
## Pub rules
22+
- sort_pub_dependencies

dart_dependency_validator.yaml

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

example/lib/main.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore_for_file: avoid_print
2+
13
import 'dart:async';
24
import 'dart:io';
35

@@ -209,7 +211,7 @@ class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
209211
'(tap on any of the above commands to print it to'
210212
' the console/logger and copy to the device clipboard.)',
211213
textAlign: TextAlign.center,
212-
style: Theme.of(context).textTheme.caption,
214+
style: Theme.of(context).textTheme.bodySmall,
213215
),
214216
]
215217
].expand((el) => el).toList(),
@@ -235,7 +237,7 @@ class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
235237
}
236238

237239
void _showSnackBar(String msg) {
238-
WidgetsBinding.instance?.addPostFrameCallback((_) {
240+
WidgetsBinding.instance.addPostFrameCallback((_) {
239241
final context = _scaffoldKey.currentContext;
240242
if (context != null) {
241243
ScaffoldMessenger.of(context).showSnackBar(SnackBar(

0 commit comments

Comments
 (0)