Skip to content

Commit

Permalink
Merge pull request #6 from ciriousjoker/5-general-maintenance
Browse files Browse the repository at this point in the history
General maintenance
  • Loading branch information
ciriousjoker authored Aug 8, 2024
2 parents 4fa9e3a + 164f3c2 commit afbbc84
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.22.2"
}
26 changes: 19 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,37 @@ name: test

on: [push]

# Cancel previous builds by only allowing one concurrent build per ref.
concurrency:
group: die-ringe-app-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test
timeout-minutes: 15
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
- name: Checkout (main)
uses: actions/checkout@v4

- name: Detect Flutter version
uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "2.x"
channel: "stable"
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
cache: true
cache-key: flutter # optional, change this to force refresh cache
cache-path: ${{ runner.tool_cache }}/flutter # optional, change this to specify the cache path

- name: Analyze
run: flutter analyze --fatal-infos

- name: Get Packages
run: flutter pub get

- run: flutter test --coverage --reporter expanded
- name: Test
run: flutter test --coverage --reporter expanded
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ build/

.flutter-plugins
.flutter-plugins-dependencies

# FVM Version Cache
.fvm/
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"dart.lineLength": 120,
"dart.flutterSdkPath": ".fvm/flutter_sdk"
}
19 changes: 14 additions & 5 deletions lib/src/fake_firebase_remote_config_instance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,30 @@ class FakeRemoteConfig with ChangeNotifier implements FirebaseRemoteConfig {

@override
bool getBool(String key) {
return _data[key]?.asBool() ?? _defaults[key]?.asBool() ?? RemoteConfigValue.defaultValueForBool;
return _data[key]?.asBool() ??
_defaults[key]?.asBool() ??
RemoteConfigValue.defaultValueForBool;
}

@override
double getDouble(String key) {
return _data[key]?.asDouble() ?? _defaults[key]?.asDouble() ?? RemoteConfigValue.defaultValueForDouble;
return _data[key]?.asDouble() ??
_defaults[key]?.asDouble() ??
RemoteConfigValue.defaultValueForDouble;
}

@override
int getInt(String key) {
return _data[key]?.asInt() ?? _defaults[key]?.asInt() ?? RemoteConfigValue.defaultValueForInt;
return _data[key]?.asInt() ??
_defaults[key]?.asInt() ??
RemoteConfigValue.defaultValueForInt;
}

@override
String getString(String key) {
return _data[key]?.asString() ?? _defaults[key]?.asString() ?? RemoteConfigValue.defaultValueForString;
return _data[key]?.asString() ??
_defaults[key]?.asString() ??
RemoteConfigValue.defaultValueForString;
}

@override
Expand All @@ -74,7 +82,8 @@ class FakeRemoteConfig with ChangeNotifier implements FirebaseRemoteConfig {
}

@override
RemoteConfigFetchStatus get lastFetchStatus => RemoteConfigFetchStatus.success;
RemoteConfigFetchStatus get lastFetchStatus =>
RemoteConfigFetchStatus.success;

@override
DateTime lastFetchTime = DateTime.fromMicrosecondsSinceEpoch(0);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
flutter: ">=1.17.0"

dependencies:
firebase_core: ">= 0.0.1 <3.0.0"
firebase_core: ">=0.0.1 <3.0.0"
firebase_remote_config: ">=4.0.0 <5.0.0"
flutter:
sdk: flutter
Expand Down

0 comments on commit afbbc84

Please sign in to comment.