From 8572c66c55b2bdb01dff1678c004f6ca8b3ff3bb Mon Sep 17 00:00:00 2001 From: Riccardo Cucia Date: Mon, 4 Sep 2023 19:29:35 +0200 Subject: [PATCH 1/6] Create dart.yml --- .github/workflows/dart.yml | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/dart.yml diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml new file mode 100644 index 0000000..f45e642 --- /dev/null +++ b/.github/workflows/dart.yml @@ -0,0 +1,42 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Dart + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + # Note: This workflow uses the latest stable version of the Dart SDK. + # You can specify other versions if desired, see documentation here: + # https://github.com/dart-lang/setup-dart/blob/main/README.md + # - uses: dart-lang/setup-dart@v1 + - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 + + - name: Install dependencies + run: dart pub get + + # Uncomment this step to verify the use of 'dart format' on each commit. + # - name: Verify formatting + # run: dart format --output=none --set-exit-if-changed . + + # Consider passing '--fatal-infos' for slightly stricter analysis. + - name: Analyze project source + run: dart analyze + + # Your project will need to have tests in test/ and a dependency on + # package:test for this step to succeed. Note that Flutter projects will + # want to change this to 'flutter test'. + - name: Run tests + run: dart test From c82d60101e782d231ac3c646b5070ee71b92a319 Mon Sep 17 00:00:00 2001 From: Riccardo Baldassa Date: Mon, 4 Sep 2023 16:13:29 +0200 Subject: [PATCH 2/6] dart format . @r.baldassa --- lib/src/scroll_shadow.dart | 75 +++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/lib/src/scroll_shadow.dart b/lib/src/scroll_shadow.dart index 87e00b7..aa0df42 100644 --- a/lib/src/scroll_shadow.dart +++ b/lib/src/scroll_shadow.dart @@ -3,10 +3,8 @@ library flutter_scroll_shadow; import 'package:flutter/material.dart'; - /// Wraps a scrollable child in `ScrollShadow`s. -class ScrollShadow extends StatefulWidget -{ +class ScrollShadow extends StatefulWidget { /// Wraps a scrollable child in `ScrollShadow`s. const ScrollShadow({ super.key, @@ -60,28 +58,23 @@ class ScrollShadow extends StatefulWidget State createState() => _ScrollShadowState(); } - -class _ScrollShadowState extends State -{ +class _ScrollShadowState extends State { bool get reachedStart => _reachedStart; - set reachedStart(final bool value) - { + set reachedStart(final bool value) { if (_reachedStart == value) return; setState(() => _reachedStart = value); } bool get reachedEnd => _reachedEnd; - set reachedEnd(final bool value) - { + set reachedEnd(final bool value) { if (_reachedEnd == value) return; setState(() => _reachedEnd = value); } @override - Widget build(final BuildContext context) - { + Widget build(final BuildContext context) { LinearGradient? startGradient, endGradient; switch (_axis) { case null: @@ -90,23 +83,23 @@ class _ScrollShadowState extends State startGradient = LinearGradient( begin: Alignment.centerRight, end: Alignment.centerLeft, - colors: [ widget.color.withOpacity(0.0), widget.color ], + colors: [widget.color.withOpacity(0.0), widget.color], ); endGradient = LinearGradient( begin: Alignment.centerRight, end: Alignment.centerLeft, - colors: [ widget.color, widget.color.withOpacity(0.0) ], + colors: [widget.color, widget.color.withOpacity(0.0)], ); case Axis.vertical: startGradient = LinearGradient( begin: Alignment.bottomCenter, end: Alignment.topCenter, - colors: [ widget.color.withOpacity(0.0), widget.color ], + colors: [widget.color.withOpacity(0.0), widget.color], ); endGradient = LinearGradient( begin: Alignment.bottomCenter, end: Alignment.topCenter, - colors: [ widget.color, widget.color.withOpacity(0.0) ], + colors: [widget.color, widget.color.withOpacity(0.0)], ); } var startShadow = _getShadow(startGradient); @@ -138,35 +131,36 @@ class _ScrollShadowState extends State ]); } - Widget? _getShadow(final LinearGradient? gradient) - { - return gradient == null ? null : Container( - width: widget.size, - height: widget.size, - decoration: BoxDecoration(gradient: gradient) - ); + Widget? _getShadow(final LinearGradient? gradient) { + return gradient == null + ? null + : Container( + width: widget.size, + height: widget.size, + decoration: BoxDecoration(gradient: gradient)); } - Widget? _getAnimatedShadow(final Widget? shadow, final bool reachedEdge) - { - return shadow == null ? null : AnimatedOpacity( - opacity: reachedEdge ? 0.0 : 1.0, - duration: widget.duration, - curve: reachedEdge ? widget.fadeOutCurve : widget.fadeInCurve, - child: shadow, - ); + Widget? _getAnimatedShadow(final Widget? shadow, final bool reachedEdge) { + return shadow == null + ? null + : AnimatedOpacity( + opacity: reachedEdge ? 0.0 : 1.0, + duration: widget.duration, + curve: reachedEdge ? widget.fadeOutCurve : widget.fadeInCurve, + child: shadow, + ); } - Widget? _getNoninteractive(final Widget? shadow) - { - return shadow == null ? null : IgnorePointer( - ignoring: true, - child: shadow, - ); + Widget? _getNoninteractive(final Widget? shadow) { + return shadow == null + ? null + : IgnorePointer( + ignoring: true, + child: shadow, + ); } - Widget? _getPositioned(final Widget? shadow, final bool start) - { + Widget? _getPositioned(final Widget? shadow, final bool start) { if (shadow == null) return null; switch (_axis) { case null: @@ -190,8 +184,7 @@ class _ScrollShadowState extends State } } - bool _handleNewMetrics(final ScrollMetrics metrics) - { + bool _handleNewMetrics(final ScrollMetrics metrics) { if (_axis != metrics.axis) { setState(() => _axis = metrics.axis); } From a908dde089cfaf36494c5899a009b22c2e3c387b Mon Sep 17 00:00:00 2001 From: Riccardo Cucia Date: Mon, 4 Sep 2023 19:32:54 +0200 Subject: [PATCH 3/6] Update dart.yml --- .github/workflows/dart.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index f45e642..ad374fb 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -38,5 +38,5 @@ jobs: # Your project will need to have tests in test/ and a dependency on # package:test for this step to succeed. Note that Flutter projects will # want to change this to 'flutter test'. - - name: Run tests - run: dart test + # - name: Run tests + # run: dart test From 1194fbce72b8b08f714598f75677b3ce62d4333f Mon Sep 17 00:00:00 2001 From: Riccardo Cucia Date: Mon, 4 Sep 2023 19:46:32 +0200 Subject: [PATCH 4/6] Format code, add GitHub Actions --- .github/workflows/dart.yml | 42 ----------------------------------- .github/workflows/flutter.yml | 34 ++++++++++++++++++++++++++++ CHANGELOG.md | 4 ++++ example/pubspec.yaml | 2 +- pubspec.yaml | 4 ++-- 5 files changed, 41 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/dart.yml create mode 100644 .github/workflows/flutter.yml diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml deleted file mode 100644 index ad374fb..0000000 --- a/.github/workflows/dart.yml +++ /dev/null @@ -1,42 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Dart - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - # Note: This workflow uses the latest stable version of the Dart SDK. - # You can specify other versions if desired, see documentation here: - # https://github.com/dart-lang/setup-dart/blob/main/README.md - # - uses: dart-lang/setup-dart@v1 - - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 - - - name: Install dependencies - run: dart pub get - - # Uncomment this step to verify the use of 'dart format' on each commit. - # - name: Verify formatting - # run: dart format --output=none --set-exit-if-changed . - - # Consider passing '--fatal-infos' for slightly stricter analysis. - - name: Analyze project source - run: dart analyze - - # Your project will need to have tests in test/ and a dependency on - # package:test for this step to succeed. Note that Flutter projects will - # want to change this to 'flutter test'. - # - name: Run tests - # run: dart test diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml new file mode 100644 index 0000000..d93f0f3 --- /dev/null +++ b/.github/workflows/flutter.yml @@ -0,0 +1,34 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Dart + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + + - name: Install dependencies + run: flutter pub get + + - name: Analyze project source + run: dart analyze + + - name: Install pana + run: dart pub global activate pana + + - name: Analyze project source with pana + run: dart pub global activate pana \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e3eae0f..bdcb638 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Flutter Scroll Shadow +## [1.2.3] - 2023-09-04 +#### [@RichiB20](https://github.com/RichiB20)/[@rickypid](https://github.com/rickypid) +- Format code, add GitHub Actions + ## [1.2.2] - 2023-08-31 #### [@darkstarx](https://github.com/darkstarx) - Get rid of the need for the scroll controller - (#8) diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 164568f..54a47cb 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_scroll_shadow_example description: A demonstration of the ScrollShadow widget for a scrollable child. -version: 1.2.2 +version: 1.2.3 publish_to: 'none' environment: diff --git a/pubspec.yaml b/pubspec.yaml index fc9d745..e28dbd4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_scroll_shadow description: ScrollShadow adds shadows to a scrollable child. Supports ScrollController and vertical or horizontal orientation. -version: 1.2.2 +version: 1.2.3 repository: https://github.com/rickypid/flutter_scroll_shadow issue_tracker: https://github.com/rickypid/flutter_scroll_shadow/issues homepage: https://github.com/rickypid/flutter_scroll_shadow @@ -19,4 +19,4 @@ dev_dependencies: flutter_test: sdk: flutter -flutter: null +flutter: null \ No newline at end of file From 5dbb1786e4fdda27d8b50e7bfacbd8533f55d1ce Mon Sep 17 00:00:00 2001 From: Riccardo Cucia Date: Mon, 4 Sep 2023 19:48:53 +0200 Subject: [PATCH 5/6] Format code, add GitHub Actions --- .github/workflows/flutter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index d93f0f3..ce2eb44 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -31,4 +31,4 @@ jobs: run: dart pub global activate pana - name: Analyze project source with pana - run: dart pub global activate pana \ No newline at end of file + run: pana \ No newline at end of file From 3d3faeef1b32521809de3a8eef345976a2ca14c3 Mon Sep 17 00:00:00 2001 From: Riccardo Cucia Date: Mon, 4 Sep 2023 19:49:37 +0200 Subject: [PATCH 6/6] Format code, add GitHub Actions --- .github/workflows/flutter.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index ce2eb44..58b34d5 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -1,9 +1,4 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Dart +name: Flutter on: push: