Skip to content

Commit 2cf1f0e

Browse files
chore: merge upstream
2 parents c7eb8db + 2c81ff2 commit 2cf1f0e

24 files changed

+454
-186
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@ on:
99
branches: ['*']
1010
tags: ['v*','V*']
1111

12+
workflow_dispatch:
13+
1214
jobs:
1315
test:
1416
name: Test
1517
runs-on: ubuntu-latest
1618
steps:
17-
- uses: actions/checkout@v1
19+
- uses: actions/checkout@v2
1820
- uses: actions/setup-java@v1
1921
with:
2022
java-version: '12.x'
2123
- uses: subosito/flutter-action@v1
2224
with:
23-
channel: 'dev' # or: 'dev' or 'beta'
25+
channel: 'stable' # or: 'dev' or 'beta'
2426

2527
- name: Install packages dependencies
2628
run: flutter pub get
@@ -34,11 +36,6 @@ jobs:
3436
- name: Run tests coverage
3537
run: flutter test --coverage
3638

37-
- name: Coveralls GitHub Action
38-
uses: coverallsapp/github-action@1.1.3
39-
with:
40-
github-token: ${{ secrets.GITHUB_TOKEN }}
41-
4239
publish:
4340
if: "(contains(github.event.head_commit.message, '[pub]') &&
4441
contains('
@@ -53,28 +50,27 @@ jobs:
5350
github.ref)"
5451

5552
name: Publish
53+
permissions:
54+
id-token: write # This is required for authentication using OIDC
5655
needs: [test]
5756
runs-on: ubuntu-latest
58-
59-
container:
60-
image: google/dart:latest
57+
timeout-minutes: 5
6158

6259
steps:
63-
- name: Checkout
64-
uses: actions/checkout@v2
65-
66-
- name: Dry run pub publish
67-
run: dart pub publish --dry-run || true
68-
69-
- name: Setup credentials
70-
run: |
71-
pwd
72-
mkdir -p ~/.pub-cache
73-
cat <<EOF> ~/.pub-cache/credentials.json
74-
{"accessToken":"${{ secrets.OAUTH_ACCESS_TOKEN }}","refreshToken":"${{ secrets.OAUTH_REFRESH_TOKEN }}","idToken":"${{ secrets.OAUTH_ID_TOKEN }}","tokenEndpoint":"https://accounts.google.com/o/oauth2/token","scopes":["openid","https://www.googleapis.com/auth/userinfo.email"],"expiration":1609800070574}
75-
EOF
60+
- uses: actions/checkout@v3
61+
- name: Run a one-line script
62+
id: vars
63+
run: echo "pkg_tag=$(cat pubspec.yaml | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]')" >> $GITHUB_OUTPUT
64+
- uses: dart-lang/setup-dart@v1
65+
- uses: subosito/flutter-action@v2
66+
with:
67+
channel: "stable"
7668

77-
- name: code format
78-
run: dart format lib/*/*.dart lib/*.dart
79-
- name: Publish pkg
80-
run: dart pub publish --force
69+
- name: Add pub token
70+
run: echo ${{secrets.OAUTH_ACCESS_TOKEN}} | dart pub token add https://pub.dev
71+
- name: Install dependencies
72+
run: dart pub get
73+
- name: code format
74+
run: dart format lib/*/*.dart lib/*.dart
75+
- name: Publish pkg
76+
run: dart pub publish --server=https://pub.dartlang.org -f

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
### [3.0.2]
4+
5+
- support intl 18
6+
- support dart 3
7+
- added trExists extension
8+
- fix: handle invalid saved local
9+
- handle null returned by assetLoader
10+
- improve parsing scriptCode from local string
11+
- add tr-extension on build context
12+
313
### [3.0.1]
414

515
- added option allowing skip keys of nested object

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ Text('title').tr() //Text widget
192192
print('title'.tr()); //String
193193
194194
var title = tr('title') //Static function
195+
196+
Text(context.tr('title')) //Extension on BuildContext
195197
```
196198

197199
#### Arguments:
@@ -293,6 +295,9 @@ print('day'.plural(21)); // output: 21 день
293295
//Static function
294296
var money = plural('money', 10.23) // output: You have 10.23 dollars
295297
298+
//Text widget with plural BuildContext extension
299+
Text(context.plural('money', 10.23))
300+
296301
//Static function with arguments
297302
var money = plural('money_args', 10.23, args: ['John', '10.23']) // output: John has 10.23 dollars
298303

bin/generate.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class CodegenLoader extends AssetLoader{
245245
const CodegenLoader();
246246
247247
@override
248-
Future<Map<String, dynamic>> load(String fullPath, Locale locale ) {
248+
Future<Map<String, dynamic>?> load(String path, Locale locale) {
249249
return Future.value(mapLocales[locale.toString()]);
250250
}
251251

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>8.0</string>
24+
<string>11.0</string>
2525
</dict>
2626
</plist>

example/ios/Podfile

Lines changed: 16 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '9.0'
2+
# platform :ios, '11.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -10,78 +10,32 @@ project 'Runner', {
1010
'Release' => :release,
1111
}
1212

13-
def parse_KV_file(file, separator='=')
14-
file_abs_path = File.expand_path(file)
15-
if !File.exists? file_abs_path
16-
return [];
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
1717
end
18-
generated_key_values = {}
19-
skip_line_start_symbols = ["#", "/"]
20-
File.foreach(file_abs_path) do |line|
21-
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22-
plugin = line.split(pattern=separator)
23-
if plugin.length == 2
24-
podname = plugin[0].strip()
25-
path = plugin[1].strip()
26-
podpath = File.expand_path("#{path}", file_abs_path)
27-
generated_key_values[podname] = podpath
28-
else
29-
puts "Invalid plugin specification: #{line}"
30-
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
3122
end
32-
generated_key_values
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
3324
end
3425

26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
3530
target 'Runner' do
3631
use_frameworks!
3732
use_modular_headers!
3833

39-
# Flutter Pod
40-
41-
copied_flutter_dir = File.join(__dir__, 'Flutter')
42-
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
43-
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
44-
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
45-
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
46-
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
47-
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
48-
49-
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
50-
unless File.exist?(generated_xcode_build_settings_path)
51-
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
52-
end
53-
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
54-
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
55-
56-
unless File.exist?(copied_framework_path)
57-
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
58-
end
59-
unless File.exist?(copied_podspec_path)
60-
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
61-
end
62-
end
63-
64-
# Keep pod path relative so it can be checked into Podfile.lock.
65-
pod 'Flutter', :path => 'Flutter'
66-
67-
# Plugin Pods
68-
69-
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
70-
# referring to absolute paths on developers' machines.
71-
system('rm -rf .symlinks')
72-
system('mkdir -p .symlinks/plugins')
73-
plugin_pods = parse_KV_file('../.flutter-plugins')
74-
plugin_pods.each do |name, path|
75-
symlink = File.join('.symlinks', 'plugins', name)
76-
File.symlink(path, symlink)
77-
pod name, :path => File.join(symlink, 'ios')
78-
end
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
7935
end
8036

8137
post_install do |installer|
8238
installer.pods_project.targets.each do |target|
83-
target.build_configurations.each do |config|
84-
config.build_settings['ENABLE_BITCODE'] = 'NO'
85-
end
39+
flutter_additional_ios_build_settings(target)
8640
end
8741
end

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -168,7 +168,7 @@
168168
97C146E61CF9000F007C117D /* Project object */ = {
169169
isa = PBXProject;
170170
attributes = {
171-
LastUpgradeCheck = 1020;
171+
LastUpgradeCheck = 1300;
172172
ORGANIZATIONNAME = "";
173173
TargetAttributes = {
174174
97C146ED1CF9000F007C117D = {
@@ -214,6 +214,7 @@
214214
/* Begin PBXShellScriptBuildPhase section */
215215
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
216216
isa = PBXShellScriptBuildPhase;
217+
alwaysOutOfDate = 1;
217218
buildActionMask = 2147483647;
218219
files = (
219220
);
@@ -245,6 +246,7 @@
245246
};
246247
9740EEB61CF901F6004384FC /* Run Script */ = {
247248
isa = PBXShellScriptBuildPhase;
249+
alwaysOutOfDate = 1;
248250
buildActionMask = 2147483647;
249251
files = (
250252
);
@@ -359,7 +361,7 @@
359361
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
360362
GCC_WARN_UNUSED_FUNCTION = YES;
361363
GCC_WARN_UNUSED_VARIABLE = YES;
362-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
364+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
363365
MTL_ENABLE_DEBUG_INFO = NO;
364366
SDKROOT = iphoneos;
365367
SUPPORTED_PLATFORMS = iphoneos;
@@ -442,7 +444,7 @@
442444
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
443445
GCC_WARN_UNUSED_FUNCTION = YES;
444446
GCC_WARN_UNUSED_VARIABLE = YES;
445-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
447+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
446448
MTL_ENABLE_DEBUG_INFO = YES;
447449
ONLY_ACTIVE_ARCH = YES;
448450
SDKROOT = iphoneos;
@@ -492,7 +494,7 @@
492494
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
493495
GCC_WARN_UNUSED_FUNCTION = YES;
494496
GCC_WARN_UNUSED_VARIABLE = YES;
495-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
497+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
496498
MTL_ENABLE_DEBUG_INFO = NO;
497499
SDKROOT = iphoneos;
498500
SUPPORTED_PLATFORMS = iphoneos;

example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/ios/Runner/Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,9 @@
4343
</array>
4444
<key>UIViewControllerBasedStatusBarAppearance</key>
4545
<false/>
46+
<key>CADisableMinimumFrameDurationOnPhone</key>
47+
<true/>
48+
<key>UIApplicationSupportsIndirectInputEvents</key>
49+
<true/>
4650
</dict>
4751
</plist>

0 commit comments

Comments
 (0)