Skip to content

Commit ba143e0

Browse files
authored
feat!: Support transient identities and traits (#65)
- Drop Flutter 2 support - Publish via official Dart OIDC-enabled workflow - Support transient identities and traits - Integrate `flagsmith_core` and `flagsmith_storage_sharedpreferences` - Minor unit test improvements
1 parent 284bab1 commit ba143e0

53 files changed

Lines changed: 2490 additions & 424 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish_master.yml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,25 @@ on:
44
tags:
55
- "*"
66

7+
env:
8+
FLUTTER_VERSION: '3.x'
9+
710
jobs:
811
analyze:
912
runs-on: ubuntu-latest
1013
name: Dart Analyze
1114
steps:
12-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1316
- uses: subosito/flutter-action@v2
1417
with:
15-
flutter-version: '3.x'
16-
channel: 'stable'
18+
flutter-version: ${{ env.FLUTTER_VERSION }}
19+
channel: stable
1720
- run: flutter pub get
1821
- run: flutter analyze
1922

2023
# TODO https://github.com/Flagsmith/flagsmith-flutter-client/issues/57
2124

22-
publishing:
23-
runs-on: ubuntu-latest
24-
container:
25-
image: google/dart:latest
26-
name: Dart Publish Package
27-
needs: analyze
28-
steps:
29-
- uses: actions/checkout@v1
30-
- name: Setup credentials
31-
run: |
32-
mkdir -p ~/.pub-cache
33-
cat <<EOF > ~/.pub-cache/credentials.json
34-
{
35-
"accessToken":"${{ secrets.OAUTH_ACCESS_TOKEN }}",
36-
"refreshToken":"${{ secrets.OAUTH_REFRESH_TOKEN }}",
37-
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
38-
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
39-
"expiration": 1649072931936
40-
}
41-
EOF
42-
- name: Publish package
43-
run: pub publish -f
25+
publish:
26+
permissions:
27+
id-token: write
28+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1

.github/workflows/pull-request.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,33 @@ on:
1010
- reopened
1111
- ready_for_review
1212

13+
env:
14+
FLUTTER_VERSION: '3.x'
15+
1316
jobs:
1417
analyze:
1518
runs-on: ubuntu-latest
1619
name: Dart Analyze
1720
steps:
18-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
1922
- uses: subosito/flutter-action@v2
2023
with:
21-
flutter-version: '3.x'
22-
channel: 'stable'
24+
flutter-version: ${{ env.FLUTTER_VERSION }}
25+
channel: stable
2326
- run: flutter pub get
2427
- run: flutter analyze
2528

2629
tests:
2730
runs-on: ubuntu-latest
2831
name: Flutter Test
2932
steps:
30-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
3134
- uses: subosito/flutter-action@v2
3235
with:
33-
flutter-version: '3.x'
34-
channel: 'stable'
35-
36+
flutter-version: ${{ env.FLUTTER_VERSION }}
37+
channel: stable
3638
- run: flutter pub get
37-
- run: flutter pub test
39+
- run: flutter test
3840

3941
# TODO https://github.com/Flagsmith/flagsmith-flutter-client/issues/57
4042

@@ -46,8 +48,6 @@ jobs:
4648
- uses: actions/checkout@v3
4749
- uses: subosito/flutter-action@v2
4850
with:
49-
flutter-version: '3.x'
50-
channel: 'stable'
51-
51+
flutter-version: ${{ env.FLUTTER_VERSION }}
52+
channel: stable
5253
- run: flutter pub publish --dry-run
53-

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
# Changelog
2+
## [6.0.0]
3+
4+
Breaking Changes:
5+
6+
- Drop Flutter 2 support
7+
8+
Features:
9+
10+
- Support transient identities and traits
11+
12+
Other:
13+
14+
- Integrate `flagsmith_core` and `flagsmith_storage_sharedpreferences`
15+
- Minor unit test improvements
16+
217
## [5.0.1]
318

419
- Change the base url to https://edge.api.flagsmith.com/api/v1/

build.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
targets:
2+
$default:
3+
builders:
4+
source_gen|combining_builder:
5+
options:
6+
ignore_for_file:
7+
- implicit_dynamic_parameter
8+
- non_constant_identifier_names
9+
- type_annotate_public_apis
10+
- omit_local_variable_types
11+
- unnecessary_this
12+
json_serializable:
13+
options:
14+
any_map: false
15+
create_to_json: true
16+
disallow_unrecognized_keys: false
17+
explicit_to_json: true
18+
# # Options configure how source code is generated for every
19+
# # `@JsonSerializable`-annotated class in the package.
20+
# #
21+
# # The default value for each is listed.
22+
# any_map: false
23+
# checked: false
24+
# create_factory: true
25+
# create_to_json: true
26+
# disallow_unrecognized_keys: false
27+
# explicit_to_json: false
28+
# field_rename: none
29+
# generic_argument_factories: false
30+
# ignore_unannotated: false
31+
# include_if_null: true

example/lib/di.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:flagsmith/flagsmith.dart';
2-
import 'package:flagsmith_storage/flagsmith_storage_sharedpreferences.dart';
32
import 'package:get_it/get_it.dart';
43

54
import 'bloc/flag_bloc.dart';

example/lib/main.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ ThemeData darkTheme(BuildContext context) {
4747
secondary: Color(0xFFBFA6E9),
4848
secondaryContainer: Color(0xFF9D88C0),
4949
surface: Color(0xFF1a1c26),
50-
background: Color(0xFF1a1c26),
5150
),
5251
textTheme: GoogleFonts.varelaRoundTextTheme(
5352
ThemeData.dark().textTheme,

example/lib/models/custom_storage.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'package:flagsmith_flutter_core/flagsmith_flutter_core.dart';
1+
import 'package:flagsmith/flagsmith.dart';
22

33
/// CustomInMemoryStore storage
44
class CustomInMemoryStore extends CoreStorage {

0 commit comments

Comments
 (0)