Skip to content

Commit

Permalink
Prepare to publish v1.0.1 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
halildurmus authored Jul 15, 2023
1 parent d39807d commit f0ec4b8
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 42 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.1

- Improved code quality.

## 1.0.0

- **BREAKING**: Requires Dart `3.0.0` or later.
Expand Down
34 changes: 24 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# siri_wave

[![ci](https://img.shields.io/cirrus/github/halildurmus/siri_wave)](https://cirrus-ci.com/halildurmus/siri_wave)
[![Package: siri_wave](https://img.shields.io/pub/v/siri_wave.svg)](https://pub.dev/packages/siri_wave)
[![Publisher: halildurmus.dev](https://img.shields.io/pub/publisher/siri_wave.svg)](https://pub.dev/publishers/halildurmus.dev)
[![Language: Dart](https://img.shields.io/badge/language-Dart-blue.svg)](https://dart.dev)
[![Platform: Flutter](https://img.shields.io/badge/Platform-Flutter-02569B?logo=flutter)](https://flutter.dev)
[![License: MIT](https://img.shields.io/github/license/halildurmus/siri_wave?color=blue)](https://opensource.org/licenses/mit)

> Create beautiful waveforms like in *Siri*.
[![ci][ci_badge]][ci_link]
[![Package: siri_wave][package_badge]][package_link]
[![Publisher: halildurmus.dev][publisher_badge]][publisher_link]
[![Language: Dart][language_badge]][language_link]
[![Platform: Flutter][platform_badge]][platform_link]
[![License: MIT][license_badge]][license_link]

> Create visually stunning waveforms similar to those found in *Siri*.
It was inspired from the [siriwave](https://github.com/kopiro/siriwave) library.

## Demo
Expand Down Expand Up @@ -115,5 +115,19 @@ For a complete sample application, please checkout the [example](https://github.
## 🤝 Contributing

Contributions, issues and feature requests are welcome.
Feel free to check [issues page](https://github.com/halildurmus/siri_wave/issues)
if you want to contribute.
Feel free to check the [issue tracker][issue_tracker_link] if you want to
contribute.

[ci_badge]: https://img.shields.io/cirrus/github/halildurmus/siri_wave
[ci_link]: https://cirrus-ci.com/halildurmus/siri_wave
[issue_tracker_link]: https://github.com/halildurmus/siri_wave/issues
[language_badge]: https://img.shields.io/badge/language-Dart-blue.svg
[language_link]: https://dart.dev
[license_badge]: https://img.shields.io/github/license/halildurmus/siri_wave?color=blue
[license_link]: https://opensource.org/licenses/mit
[package_badge]: https://img.shields.io/pub/v/siri_wave.svg
[package_link]: https://pub.dev/packages/siri_wave
[platform_badge]: https://img.shields.io/badge/platform-Flutter-02569B?logo=flutter
[platform_link]: https://flutter.dev
[publisher_badge]: https://img.shields.io/pub/publisher/siri_wave.svg
[publisher_link]: https://pub.dev/publishers/halildurmus.dev
17 changes: 8 additions & 9 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ class MyApp extends StatelessWidget {
brightness: Brightness.dark,
primarySwatch: Colors.amber,
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.all(Colors.amber),
trackColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.selected)) {
return Colors.amber.shade300;
}
return Colors.grey.withOpacity(.5);
})),
thumbColor: MaterialStateProperty.all(Colors.amber),
trackColor: MaterialStateProperty.resolveWith((states) =>
states.contains(MaterialState.selected)
? Colors.amber.shade300
: Colors.grey.withOpacity(.5)),
),
),
themeMode: ThemeMode.dark,
title: 'siri_wave Demo',
Expand Down Expand Up @@ -219,8 +218,8 @@ class _HomePageState extends State<HomePage> {
isSelected: _isSelected,
selectedBorderColor: Theme.of(context).colorScheme.primary,
children: const [
Padding(padding: EdgeInsets.all(16), child: Text('iOS 7 Style')),
Padding(padding: EdgeInsets.all(16), child: Text('iOS 9 Style')),
Padding(padding: EdgeInsets.all(16), child: Text('iOS 7')),
Padding(padding: EdgeInsets.all(16), child: Text('iOS 9')),
],
);
}
Expand Down
28 changes: 11 additions & 17 deletions lib/src/ios_7/ios_7_siri_wave_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ class IOS7SiriWavePainter extends CustomPainter {

static const _amplitudeFactor = .6;
static const _attenuationFactor = 4;
static const _curves = [
_IOS7SiriWaveCurve(attenuation: -2, width: 1, opacity: .1),
_IOS7SiriWaveCurve(attenuation: -6, width: 1, opacity: .2),
_IOS7SiriWaveCurve(attenuation: 4, width: 1, opacity: .4),
_IOS7SiriWaveCurve(attenuation: 2, width: 1, opacity: .6),
_IOS7SiriWaveCurve(attenuation: 1, width: 1.5, opacity: 1),
static const _curves = <_IOS7SiriWaveCurve>[
(attenuation: -2, width: 1, opacity: .1),
(attenuation: -6, width: 1, opacity: .2),
(attenuation: 4, width: 1, opacity: .4),
(attenuation: 2, width: 1, opacity: .6),
(attenuation: 1, width: 1.5, opacity: 1),
];
static const _graphX = 2.0;
static const _pixelDepth = .02;
Expand Down Expand Up @@ -77,14 +77,8 @@ class IOS7SiriWavePainter extends CustomPainter {
}

/// Describes the curve properties will be used by [IOS7SiriWavePainter].
class _IOS7SiriWaveCurve {
const _IOS7SiriWaveCurve({
required this.attenuation,
required this.opacity,
required this.width,
});

final double attenuation;
final double opacity;
final double width;
}
typedef _IOS7SiriWaveCurve = ({
double attenuation,
double opacity,
double width
});
3 changes: 2 additions & 1 deletion lib/src/ios_9/support_line_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ class SupportLinePainter extends CustomPainter {

@override
void paint(Canvas canvas, Size size) {
final rect = Rect.fromLTWH(0, size.height / 2, size.width, 1);
final maxHeight = size.height / 2;
final rect = Rect.fromLTWH(0, maxHeight, size.width, 1);
final shader = LinearGradient(
colors: [
const Color(0xFF111111).withOpacity(.7),
Expand Down
10 changes: 5 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: siri_wave
description: Create beautiful waveforms like in Siri.
version: 1.0.0
description: Create visually stunning waveforms similar to those found in Siri.
version: 1.0.1
repository: https://github.com/halildurmus/siri_wave
issue_tracker: https://github.com/halildurmus/siri_wave/issues

screenshots:
- description: 'Examples of the iOS 7 style waveform.'
path: gifs/ios_7.gif
- description: 'Examples of the iOS 9 style waveform.'
- description: Example of the iOS 9 style waveform.
path: gifs/ios_9.gif
- description: Example of the iOS 7 style waveform.
path: gifs/ios_7.gif

topics:
- wave
Expand Down

0 comments on commit f0ec4b8

Please sign in to comment.