Skip to content

Commit

Permalink
feat!: Support transient identities and traits (#65)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
khvn26 authored Oct 21, 2024
1 parent 284bab1 commit ba143e0
Show file tree
Hide file tree
Showing 53 changed files with 2,490 additions and 424 deletions.
35 changes: 10 additions & 25 deletions .github/workflows/publish_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,25 @@ on:
tags:
- "*"

env:
FLUTTER_VERSION: '3.x'

jobs:
analyze:
runs-on: ubuntu-latest
name: Dart Analyze
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
- run: flutter pub get
- run: flutter analyze

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

publishing:
runs-on: ubuntu-latest
container:
image: google/dart:latest
name: Dart Publish Package
needs: analyze
steps:
- uses: actions/checkout@v1
- name: Setup credentials
run: |
mkdir -p ~/.pub-cache
cat <<EOF > ~/.pub-cache/credentials.json
{
"accessToken":"${{ secrets.OAUTH_ACCESS_TOKEN }}",
"refreshToken":"${{ secrets.OAUTH_REFRESH_TOKEN }}",
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
"expiration": 1649072931936
}
EOF
- name: Publish package
run: pub publish -f
publish:
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
24 changes: 12 additions & 12 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,33 @@ on:
- reopened
- ready_for_review

env:
FLUTTER_VERSION: '3.x'

jobs:
analyze:
runs-on: ubuntu-latest
name: Dart Analyze
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
- run: flutter pub get
- run: flutter analyze

tests:
runs-on: ubuntu-latest
name: Flutter Test
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'

flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
- run: flutter pub get
- run: flutter pub test
- run: flutter test

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

Expand All @@ -46,8 +48,6 @@ jobs:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'

flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
- run: flutter pub publish --dry-run

15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# Changelog
## [6.0.0]

Breaking Changes:

- Drop Flutter 2 support

Features:

- Support transient identities and traits

Other:

- Integrate `flagsmith_core` and `flagsmith_storage_sharedpreferences`
- Minor unit test improvements

## [5.0.1]

- Change the base url to https://edge.api.flagsmith.com/api/v1/
Expand Down
31 changes: 31 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
targets:
$default:
builders:
source_gen|combining_builder:
options:
ignore_for_file:
- implicit_dynamic_parameter
- non_constant_identifier_names
- type_annotate_public_apis
- omit_local_variable_types
- unnecessary_this
json_serializable:
options:
any_map: false
create_to_json: true
disallow_unrecognized_keys: false
explicit_to_json: true
# # Options configure how source code is generated for every
# # `@JsonSerializable`-annotated class in the package.
# #
# # The default value for each is listed.
# any_map: false
# checked: false
# create_factory: true
# create_to_json: true
# disallow_unrecognized_keys: false
# explicit_to_json: false
# field_rename: none
# generic_argument_factories: false
# ignore_unannotated: false
# include_if_null: true
1 change: 0 additions & 1 deletion example/lib/di.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flagsmith/flagsmith.dart';
import 'package:flagsmith_storage/flagsmith_storage_sharedpreferences.dart';
import 'package:get_it/get_it.dart';

import 'bloc/flag_bloc.dart';
Expand Down
1 change: 0 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ ThemeData darkTheme(BuildContext context) {
secondary: Color(0xFFBFA6E9),
secondaryContainer: Color(0xFF9D88C0),
surface: Color(0xFF1a1c26),
background: Color(0xFF1a1c26),
),
textTheme: GoogleFonts.varelaRoundTextTheme(
ThemeData.dark().textTheme,
Expand Down
2 changes: 1 addition & 1 deletion example/lib/models/custom_storage.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flagsmith_flutter_core/flagsmith_flutter_core.dart';
import 'package:flagsmith/flagsmith.dart';

/// CustomInMemoryStore storage
class CustomInMemoryStore extends CoreStorage {
Expand Down
Loading

0 comments on commit ba143e0

Please sign in to comment.