-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
203 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
name: Flutter Package CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest] | ||
flutter-version: ['3.22.1'] | ||
working-directory: ['.'] | ||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache Flutter SDK | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.pub-cache | ||
key: ${{ runner.os }}-pub-cache-${{ matrix.flutter-version }} | ||
restore-keys: | | ||
${{ runner.os }}-pub-cache- | ||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: ${{ matrix.flutter-version }} | ||
|
||
- name: Install dependencies | ||
run: flutter pub get | ||
working-directory: ${{ matrix.working-directory }} | ||
|
||
- name: Analyze code | ||
run: dart analyze . | ||
working-directory: ${{ matrix.working-directory }} | ||
|
||
- name: Run lint | ||
run: flutter analyze | ||
working-directory: ${{ matrix.working-directory }} | ||
|
||
- name: Run tests | ||
run: flutter test --coverage | ||
working-directory: ${{ matrix.working-directory }} | ||
|
||
- name: Upload code coverage | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-report | ||
path: coverage/lcov.info | ||
|
||
test-example: | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest] | ||
flutter-version: ['3.22.1'] | ||
working-directory: ['example'] | ||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache Flutter SDK | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.pub-cache | ||
key: ${{ runner.os }}-pub-cache-${{ matrix.flutter-version }} | ||
restore-keys: | | ||
${{ runner.os }}-pub-cache- | ||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: ${{ matrix.flutter-version }} | ||
|
||
- name: Install dependencies | ||
run: flutter pub get | ||
working-directory: ${{ matrix.working-directory }} | ||
|
||
- name: Analyze code | ||
run: dart analyze . | ||
working-directory: ${{ matrix.working-directory }} | ||
|
||
- name: Run lint | ||
run: flutter analyze | ||
working-directory: ${{ matrix.working-directory }} | ||
|
||
- name: Run tests | ||
run: flutter test | ||
working-directory: ${{ matrix.working-directory }} | ||
|
||
publish: | ||
needs: [build, test-example] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main') | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache Flutter SDK | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.pub-cache | ||
key: ${{ runner.os }}-pub-cache-${{ matrix.flutter-version }} | ||
restore-keys: | | ||
${{ runner.os }}-pub-cache- | ||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: ${{ matrix.flutter-version }} | ||
|
||
- name: Install dependencies | ||
run: flutter pub get | ||
|
||
- name: Publish package | ||
env: | ||
PUB_TOKEN: ${{ secrets.PUB_TOKEN }} | ||
run: | | ||
flutter pub publish --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 14 additions & 13 deletions
27
android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
package io.flutter.plugins; | ||
|
||
import io.flutter.plugin.common.PluginRegistry; | ||
import androidx.annotation.Keep; | ||
import androidx.annotation.NonNull; | ||
import io.flutter.Log; | ||
|
||
import io.flutter.embedding.engine.FlutterEngine; | ||
|
||
/** | ||
* Generated file. Do not edit. | ||
* This file is generated by the Flutter tool based on the | ||
* plugins that support the Android platform. | ||
*/ | ||
@Keep | ||
public final class GeneratedPluginRegistrant { | ||
public static void registerWith(PluginRegistry registry) { | ||
if (alreadyRegisteredWith(registry)) { | ||
return; | ||
} | ||
} | ||
|
||
private static boolean alreadyRegisteredWith(PluginRegistry registry) { | ||
final String key = GeneratedPluginRegistrant.class.getCanonicalName(); | ||
if (registry.hasPlugin(key)) { | ||
return true; | ||
private static final String TAG = "GeneratedPluginRegistrant"; | ||
public static void registerWith(@NonNull FlutterEngine flutterEngine) { | ||
try { | ||
flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin()); | ||
} catch (Exception e) { | ||
Log.e(TAG, "Error registering plugin shared_preferences_android, io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin", e); | ||
} | ||
registry.registrarFor(key); | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ migrate_working_dir/ | |
.pub-cache/ | ||
.pub/ | ||
/build/ | ||
pubspec.lock | ||
|
||
# Symbolication related | ||
app.*.symbols | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
C:/Users/amadi/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_linux-2.2.1/ |
1 change: 1 addition & 0 deletions
1
linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
C:/Users/amadi/AppData/Local/Pub/Cache/hosted/pub.dev/shared_preferences_linux-2.4.0/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters