Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,32 @@ on:

jobs:
test:
name: Test (${{ matrix.flutter.label }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
flutter:
- label: Flutter 3.7.12
version: "3.7.12"
- label: Flutter stable
version: ""

steps:
- uses: actions/checkout@v6

- uses: subosito/flutter-action@v2
- name: Set up Flutter ${{ matrix.flutter.version }}
if: matrix.flutter.version != ''
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter.version }}
channel: stable
cache: true

- name: Set up latest stable Flutter
if: matrix.flutter.version == ''
uses: subosito/flutter-action@v2
with:
flutter-version: "3.7.12"
channel: stable
cache: true

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 0.2.4-dev.1

* Expand Dart SDK compatibility to allow Dart 3.
* Add CI coverage for both Flutter 3.7.12 and the latest stable Flutter.
* Avoid deprecated color opacity APIs on current Flutter.

## 0.2.3

* Add runtime validation for custom gradient and layer configuration.
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ publish_to: none
version: 1.0.0+1

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=2.12.0 <4.0.0'

dependencies:
flutter:
Expand Down
7 changes: 6 additions & 1 deletion lib/src/widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ class _WaveWidgetState extends State<WaveWidget> with TickerProviderStateMixin {
return List<_WaveLayerSpec>.generate(
singleConfig.durations.length,
(index) => _WaveLayerSpec(
color: singleConfig.color.withOpacity(
color: _colorWithOpacity(
singleConfig.color,
singleConfig.opacityPercentages[index],
),
duration: singleConfig.durations[index],
Expand All @@ -326,6 +327,10 @@ class _WaveWidgetState extends State<WaveWidget> with TickerProviderStateMixin {
throw FlutterError('Unsupported or missing `ColorMode` in `config`.');
}

Color _colorWithOpacity(Color color, double opacity) {
return color.withAlpha((opacity * 255).round());
}

double _amplitudeForLayer(int index) {
return widget.waveAmplitude + 8 + index * 2;
}
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: wave
description: Widget for displaying waves with custom color, duration, floating and blur effects.
version: 0.2.3
version: 0.2.4-dev.1
homepage: https://github.com/glorylab/wave

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=2.12.0 <4.0.0'

dependencies:
flutter:
Expand Down