diff --git a/.github/test__.__yml b/.github/test__.__yml deleted file mode 100644 index 9e2387c..0000000 --- a/.github/test__.__yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Package - -on: - pull_request: - branches: - - '**' - push: - branches: - - main # until proper release is done. - workflow_dispatch: - -jobs: - lint_and_test: - name: Linting and Testing - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: subosito/flutter-action@v2 - with: - channel: stable - - run: flutter pub get - - run: dart format --fix --set-exit-if-changed . - - run: dart analyze - - run: dart test - # - name: Setup LCOV - # uses: hrishikesh-kadam/setup-lcov@v1 - # - name: Report code coverage - # uses: zgosalvez/github-actions-report-lcov@v3 - # with: - # coverage-files: coverage/lcov*.info - # artifact-name: code-coverage-report - # github-token: ${{ secrets.GITHUB_TOKEN }} - # update-comment: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35aeefb..6533edd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,10 @@ on: branches: - main +concurrency: + group: release + cancel-in-progress: true + jobs: package_and_publish: name: Package and Publish diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..8caa74d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,60 @@ +name: Test Packages + +on: + pull_request: + branches: + - '**' + workflow_dispatch: + +concurrency: + group: tests-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + name: Lint and Analyze + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: stable + - run: dart pub global activate melos + - run: melos bootstrap + - run: melos run build_runner + - run: melos run lint + + test: + name: Test Package "${{ matrix.package }}" + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + include: + - package: fluorflow + executor: flutter + - package: fluorflow_generator + executor: dart + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: stable + - run: dart pub global activate melos + - run: melos bootstrap + - run: melos run build_runner + - run: ${{ matrix.executor }} pub get + working-directory: packages/${{ matrix.package }} + - run: ${{ matrix.executor }} test + working-directory: packages/${{ matrix.package }} + + test_result: + if: ${{ always() }} + runs-on: ubuntu-latest + name: Test Results + needs: + - test + steps: + - name: Check test matrix status + if: ${{ needs.test.result != 'success' }} + run: exit 1 diff --git a/packages/fluorflow/analysis_options.yaml b/packages/fluorflow/analysis_options.yaml index 80cf692..b478fc1 100644 --- a/packages/fluorflow/analysis_options.yaml +++ b/packages/fluorflow/analysis_options.yaml @@ -13,3 +13,7 @@ linter: prefer_relative_imports: true prefer_single_quotes: true prefer_expression_function_bodies: true + +analyzer: + exclude: + - example/ diff --git a/packages/fluorflow/example/ios/Flutter/AppFrameworkInfo.plist b/packages/fluorflow/example/ios/Flutter/AppFrameworkInfo.plist index 9625e10..7c56964 100644 --- a/packages/fluorflow/example/ios/Flutter/AppFrameworkInfo.plist +++ b/packages/fluorflow/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/packages/fluorflow/example/ios/Runner.xcodeproj/project.pbxproj b/packages/fluorflow/example/ios/Runner.xcodeproj/project.pbxproj index 48f828d..e6fb40d 100644 --- a/packages/fluorflow/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/fluorflow/example/ios/Runner.xcodeproj/project.pbxproj @@ -168,7 +168,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { @@ -344,7 +344,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -471,7 +471,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -520,7 +520,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/packages/fluorflow/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/fluorflow/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 87131a0..8e3ca5d 100644 --- a/packages/fluorflow/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/fluorflow/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ showBottomSheet( TSheet sheet, { Color barrierColor = const Color(0x80000000), bool fullscreen = false, bool draggable = true, + bool ignoreSafeArea = true, }) => Get.bottomSheet( sheet, barrierColor: barrierColor, isScrollControlled: fullscreen, enableDrag: draggable, + ignoreSafeArea: ignoreSafeArea, ); /// Closes the currently open bottom sheet. diff --git a/packages/fluorflow_generator/lib/src/builder/bottom_sheet_builder.dart b/packages/fluorflow_generator/lib/src/builder/bottom_sheet_builder.dart index a2ff431..e545541 100644 --- a/packages/fluorflow_generator/lib/src/builder/bottom_sheet_builder.dart +++ b/packages/fluorflow_generator/lib/src/builder/bottom_sheet_builder.dart @@ -91,6 +91,14 @@ class BottomSheetBuilder implements Builder { configAnnotation?.read('defaultFullscreen').boolValue ?? false) .code)) + ..optionalParameters.add(Parameter((b) => b + ..name = 'ignoreSafeArea' + ..type = refer('bool') + ..named = true + ..defaultTo = literalBool( + configAnnotation?.read('defaultIgnoreSafeArea').boolValue ?? + true) + .code)) ..optionalParameters.add(Parameter((b) => b ..name = 'draggable' ..type = refer('bool') @@ -121,6 +129,7 @@ class BottomSheetBuilder implements Builder { 'barrierColor': refer('barrierColor'), 'fullscreen': refer('fullscreen'), 'draggable': refer('draggable'), + 'ignoreSafeArea': refer('ignoreSafeArea'), }, [ methodTupleRef, refer(sheetClass.displayName, assetId.uri.toString()), diff --git a/packages/fluorflow_generator/test/builder/bottom_sheet_builder_test.dart b/packages/fluorflow_generator/test/builder/bottom_sheet_builder_test.dart index 1ebdcda..5a375a8 100644 --- a/packages/fluorflow_generator/test/builder/bottom_sheet_builder_test.dart +++ b/packages/fluorflow_generator/test/builder/bottom_sheet_builder_test.dart @@ -46,6 +46,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, }) => showBottomSheet<(bool?, dynamic), _i3.MySheet>( @@ -53,6 +54,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -86,6 +88,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, void)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, }) => showBottomSheet<(bool?, void), _i3.MySheet>( @@ -93,6 +96,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, null)); } ''' @@ -126,6 +130,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, String?)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, }) => showBottomSheet<(bool?, String?), _i3.MySheet>( @@ -133,6 +138,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -172,6 +178,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, _i2.DialogResultType?)> showMySheet({ _i3.Color barrierColor = const _i3.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, }) => showBottomSheet<(bool?, _i2.DialogResultType?), _i4.MySheet>( @@ -179,6 +186,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -214,6 +222,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, }) => showBottomSheet<(bool?, dynamic), _i3.MySheet>( @@ -221,6 +230,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -254,6 +264,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, void)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, }) => showBottomSheet<(bool?, void), _i3.MySheet>( @@ -261,6 +272,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, null)); } ''' @@ -294,6 +306,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, String?)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, }) => showBottomSheet<(bool?, String?), _i3.MySheet>( @@ -301,6 +314,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -340,6 +354,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, _i2.DialogResultType?)> showMySheet({ _i3.Color barrierColor = const _i3.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, }) => showBottomSheet<(bool?, _i2.DialogResultType?), _i4.MySheet>( @@ -347,6 +362,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -383,6 +399,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required String pos, }) => @@ -394,6 +411,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -428,6 +446,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required String? pos, }) => @@ -439,6 +458,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -473,6 +493,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required String pos, }) => @@ -484,6 +505,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -518,6 +540,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, String? pos, }) => @@ -529,6 +552,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -563,6 +587,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, String pos = 'default', }) => @@ -574,6 +599,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -614,6 +640,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required _i3.MySheetRef pos, }) => @@ -625,6 +652,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -661,6 +689,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required List pos, }) => @@ -672,6 +701,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -708,6 +738,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required List<_i3.Foobar> pos, }) => @@ -719,6 +750,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -761,6 +793,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required _i3.Foo<_i3.Bar<_i4.Baz, int>> pos, }) => @@ -772,6 +805,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -813,6 +847,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required _i3.Foo<_i4.Baz> pos, }) => @@ -824,6 +859,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -858,6 +894,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required void Function() pos, }) => @@ -869,6 +906,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -912,6 +950,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required _i3.Foo Function(_i3.Bar<_i4.Baz>) pos, }) => @@ -923,6 +962,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -966,6 +1006,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required _i3.Foo Function( _i3.Bar<_i4.Baz>, { @@ -981,6 +1022,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -1024,6 +1066,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required _i3.Foo Function( _i3.Bar<_i4.Baz>, [ @@ -1038,6 +1081,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -1079,6 +1123,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, required _i3.MyCallback pos, }) => @@ -1090,6 +1135,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -1110,6 +1156,7 @@ extension BottomSheets on _i1.BottomSheetService { @BottomSheetConfig( defaultBarrierColor: 0x34ff0000, defaultFullscreen: true, + defaultIgnoreSafeArea: false, defaultDraggable: false, ) class MySheet extends FluorFlowSimpleBottomSheet { @@ -1131,6 +1178,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x34ff0000), bool fullscreen = true, + bool ignoreSafeArea = false, bool draggable = false, }) => showBottomSheet<(bool?, dynamic), _i3.MySheet>( @@ -1138,6 +1186,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } ''' @@ -1175,6 +1224,7 @@ extension BottomSheets on _i1.BottomSheetService { Future<(bool?, dynamic)> showMySheet({ _i2.Color barrierColor = const _i2.Color(0x80000000), bool fullscreen = false, + bool ignoreSafeArea = true, bool draggable = true, }) => showBottomSheet<(bool?, dynamic), _i3.MySheet>( @@ -1182,6 +1232,7 @@ extension BottomSheets on _i1.BottomSheetService { barrierColor: barrierColor, fullscreen: fullscreen, draggable: draggable, + ignoreSafeArea: ignoreSafeArea, ).then((r) => (r?.$1, r?.$2)); } '''