diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index cadabbd..0000000 --- a/.cirrus.yml +++ /dev/null @@ -1,38 +0,0 @@ -pub_cache: - folder: ~/.pub-cache - -format_task: - name: Verify formatting - container: - image: ghcr.io/cirruslabs/flutter:stable - format_script: dart format . --set-exit-if-changed - -analyzer_task: - name: Run analyzer - container: - image: ghcr.io/cirruslabs/flutter:stable - analyze_script: - - flutter pub get - - flutter analyze --no-pub - -tests_task: - name: Run tests - container: - image: ghcr.io/cirruslabs/flutter:stable - test_script: flutter test - -example_android_task: - name: Build example app (Android) - container: - image: ghcr.io/cirruslabs/flutter:stable - build_script: - - cd example - - flutter build apk --debug - -example_ios_task: - name: Build example app (iOS) - macos_instance: - image: ghcr.io/cirruslabs/macos-ventura-xcode:14.3.1 - build_script: - - cd example - - flutter build ios --no-codesign --debug diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..eb23941 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,25 @@ + + +## Description + + + +## Related Issue + + + +## Type of Change + + + +- [ ] โœจ `feat` -- New feature (non-breaking change which adds functionality) +- [ ] ๐Ÿ› ๏ธ `fix` -- Bug fix (non-breaking change which fixes an issue) +- [ ] โŒ `!` -- Breaking change (fix or feature that would cause existing functionality to change) +- [ ] ๐Ÿงน `refactor` -- Code refactor +- [ ] โœ… `ci` -- Build configuration change +- [ ] ๐Ÿ“ `docs` -- Documentation +- [ ] ๐Ÿงช `test` -- Test +- [ ] ๐Ÿ—‘๏ธ `chore` -- Chore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..bf5193a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,27 @@ +name: Build + +on: + pull_request: + branches: [main] + paths: + - '.github/workflows/build.yml' + - 'analysis_options.yaml' + - 'CHANGELOG.md' + - 'pubspec.yaml' + - 'lib/**' + - 'test/**' + push: + branches: [main] + paths: + - '.github/workflows/build.yml' + - 'analysis_options.yaml' + - 'CHANGELOG.md' + - 'pubspec.yaml' + - 'lib/**' + - 'test/**' + +jobs: + build: + uses: halildurmus/workflows/.github/workflows/flutter_package.yml@main + with: + verify_pana_score: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ccb9089..055ae0b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,22 +1,16 @@ -name: Publish to GitHub Pages +name: Publish on: - release: - types: - - created + pull_request: + branches: [main] + push: + tags: ['v[0-9]+.[0-9]+.[0-9]+*'] jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - - run: flutter pub get - - run: flutter test - - uses: bluefireteam/flutter-gh-pages@v8 - with: - baseHref: /siri_wave/ - webRenderer: canvaskit - workingDir: example + publish: + uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main + permissions: + id-token: write # Required for authentication using OIDC + pull-requests: write # Required for writing the pull request note + with: + use-flutter: true diff --git a/.github/workflows/semantic_pr.yml b/.github/workflows/semantic_pr.yml new file mode 100644 index 0000000..248b4ab --- /dev/null +++ b/.github/workflows/semantic_pr.yml @@ -0,0 +1,21 @@ +name: Semantic PR + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - reopened + +permissions: + pull-requests: read + +jobs: + main: + name: ๐Ÿค– Ensure Commit is Semantic + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml new file mode 100644 index 0000000..c5456f7 --- /dev/null +++ b/.github/workflows/website.yml @@ -0,0 +1,32 @@ +name: Deploy Flutter Example App to GitHub Pages + +on: + push: + branches: [main] + paths: + - '.github/workflows/website.yml' + - example/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: stable + - run: flutter pub get + - run: flutter config --enable-web + working-directory: example + - run: flutter build web --release --wasm --base-href /siri_wave/ + working-directory: example + - run: git config user.name github-actions + working-directory: example + - run: git config user.email github-actions@github.com + working-directory: example + - run: git --work-tree build/web add --all + working-directory: example + - run: git commit -m "Automatic deployment by github-actions" + shell: bash + - run: git push origin HEAD:gh-pages --force + working-directory: example diff --git a/AUTHORS b/AUTHORS index 6cc80ba..c9a0185 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,6 +2,6 @@ # project. Names should be added to the list like so, ordered alphabetically by # GitHub handle: # -# Name/Organization (@github_handle) +# Name/Organization (@github_handle) Halil Durmus (@halildurmus) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6234d7e..6616902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [2.1.0] - 2024-10-29 + +- Bump minimum required Dart version to `3.5.0`. + ## 2.0.0+1 - Fixed the API Documentation link in README. @@ -105,3 +113,5 @@ ## 0.0.1 - Initial release ๐ŸŽ‰ + +[2.1.0]: https://github.com/halildurmus/siri_wave/compare/v2.0.0+1...v2.1.0 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 0dafe24..597291d 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -60,7 +60,7 @@ representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -durmushalil@proton.me. +. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the @@ -116,7 +116,7 @@ the community. This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. +. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). @@ -124,5 +124,5 @@ enforcement ladder](https://github.com/mozilla/diversity). [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. +. Translations are available at +. diff --git a/README.md b/README.md index 03af020..80e4884 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ It was inspired from the [siriwave][siriwave_link] library. Check out the live demo [here][demo_link]. -## iOS 7 Siri-style waveform +## iOS 7 Siri-style waveform GIF [![iOS 7 Siri-style waveform][ios_7_gif_link]][demo_link] -## iOS 9 Siri-style waveform +## iOS 9 Siri-style waveform GIF [![iOS 9 Siri-style waveform][ios_9_gif_link]][demo_link] @@ -115,8 +115,8 @@ Feel free to check the [issue tracker][issue_tracker_link] if you want to contribute. [api_documentation_link]: https://pub.dev/documentation/siri_wave/latest/ -[ci_badge]: https://img.shields.io/cirrus/github/halildurmus/siri_wave -[ci_link]: https://cirrus-ci.com/halildurmus/siri_wave +[ci_badge]: https://github.com/halildurmus/siri_wave/actions/workflows/build.yml/badge.svg +[ci_link]: https://github.com/halildurmus/siri_wave/actions/workflows/build.yml [demo_link]: https://halildurmus.github.io/siri_wave [example_link]: https://github.com/halildurmus/siri_wave/blob/main/example/lib/main.dart [ios_7_gif_link]: https://raw.githubusercontent.com/halildurmus/siri_wave/main/gifs/ios_7.gif diff --git a/analysis_options.yaml b/analysis_options.yaml index 9a3b134..0cb8af9 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1 +1,85 @@ -include: package:dartwindows_lints/analysis_options.yaml +include: package:flutter_lints/flutter.yaml + +linter: + rules: + - always_declare_return_types + - always_put_required_named_parameters_first + - avoid_bool_literals_in_conditional_expressions + - avoid_catching_errors + - avoid_dynamic_calls + - avoid_escaping_inner_quotes + - avoid_final_parameters + - avoid_multiple_declarations_per_line + - avoid_positional_boolean_parameters + - avoid_private_typedef_functions + - avoid_redundant_argument_values + - avoid_returning_this + - avoid_setters_without_getters + - avoid_slow_async_io + - avoid_type_to_string + - avoid_types_on_closure_parameters + - avoid_unused_constructor_parameters + - avoid_void_async + - cancel_subscriptions + - cascade_invocations + - cast_nullable_to_non_nullable + - close_sinks + - combinators_ordering + - comment_references + - deprecated_consistency + - deprecated_member_use_from_same_package + - directives_ordering + - discarded_futures + - flutter_style_todos + - join_return_with_assignment + - leading_newlines_in_multiline_strings + - literal_only_boolean_expressions + - matching_super_parameters + - missing_code_block_language_in_doc_comment + - missing_whitespace_between_adjacent_strings + - no_literal_bool_comparisons + - no_runtimeType_toString + - no_self_assignments + - noop_primitive_operations + - omit_local_variable_types + # - omit_obvious_property_types + - one_member_abstracts + - only_throw_errors + - parameter_assignments + - prefer_asserts_in_initializer_lists + - prefer_asserts_with_message + - prefer_const_constructors + - prefer_const_declarations + - prefer_expression_function_bodies + - prefer_final_in_for_each + - prefer_final_locals + - prefer_if_elements_to_conditional_expressions + - prefer_int_literals + - prefer_mixin + - prefer_null_aware_method_calls + - prefer_relative_imports + - prefer_single_quotes + - prefer_void_to_null + - sort_constructors_first + - sort_pub_dependencies + - sort_unnamed_constructors_first + # - specify_nonobvious_property_types + - throw_in_finally + - unawaited_futures + - unintended_html_in_doc_comment + - unnecessary_await_in_return + - unnecessary_breaks + - unnecessary_lambdas + - unnecessary_library_directive + - unnecessary_library_name + - unnecessary_parenthesis + - unnecessary_raw_strings + - unnecessary_statements + - unreachable_from_main + - use_enums + - use_if_null_to_convert_nulls_to_bools + - use_is_even_rather_than_modulo + - use_named_constants + - use_raw_strings + - use_string_buffers + - use_to_and_as_if_applicable diff --git a/example/.metadata b/example/.metadata index ce13b42..54eec1d 100644 --- a/example/.metadata +++ b/example/.metadata @@ -1,11 +1,11 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled. +# This file should be version controlled and should not be manually edited. version: - revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 - channel: stable + revision: "fb8d938e6e7856f54a7946acf30a77ed7efc0732" + channel: "master" project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 - base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 + create_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 + base_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 - platform: android - create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 - base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 + create_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 + base_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 - platform: ios - create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 - base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 + create_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 + base_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 - platform: linux - create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 - base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 + create_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 + base_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 - platform: macos - create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 - base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 + create_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 + base_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 - platform: web - create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 - base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 + create_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 + base_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 - platform: windows - create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 - base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 + create_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 + base_revision: fb8d938e6e7856f54a7946acf30a77ed7efc0732 # User provided section diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml index 6a0b62a..0cb8af9 100644 --- a/example/analysis_options.yaml +++ b/example/analysis_options.yaml @@ -1,38 +1,85 @@ include: package:flutter_lints/flutter.yaml -analyzer: - language: - strict-casts: true - strict-inference: true - strict-raw-types: true - linter: rules: - always_declare_return_types + - always_put_required_named_parameters_first + - avoid_bool_literals_in_conditional_expressions + - avoid_catching_errors + - avoid_dynamic_calls + - avoid_escaping_inner_quotes + - avoid_final_parameters + - avoid_multiple_declarations_per_line + - avoid_positional_boolean_parameters + - avoid_private_typedef_functions + - avoid_redundant_argument_values + - avoid_returning_this + - avoid_setters_without_getters + - avoid_slow_async_io - avoid_type_to_string + - avoid_types_on_closure_parameters + - avoid_unused_constructor_parameters + - avoid_void_async + - cancel_subscriptions - cascade_invocations + - cast_nullable_to_non_nullable + - close_sinks + - combinators_ordering - comment_references + - deprecated_consistency + - deprecated_member_use_from_same_package - directives_ordering - discarded_futures - - implicit_reopen - - invalid_case_patterns + - flutter_style_todos + - join_return_with_assignment - leading_newlines_in_multiline_strings - literal_only_boolean_expressions - - no_default_cases + - matching_super_parameters + - missing_code_block_language_in_doc_comment + - missing_whitespace_between_adjacent_strings + - no_literal_bool_comparisons + - no_runtimeType_toString + - no_self_assignments + - noop_primitive_operations - omit_local_variable_types + # - omit_obvious_property_types + - one_member_abstracts + - only_throw_errors + - parameter_assignments + - prefer_asserts_in_initializer_lists + - prefer_asserts_with_message - prefer_const_constructors - - prefer_const_literals_to_create_immutables + - prefer_const_declarations + - prefer_expression_function_bodies - prefer_final_in_for_each - prefer_final_locals + - prefer_if_elements_to_conditional_expressions + - prefer_int_literals + - prefer_mixin + - prefer_null_aware_method_calls - prefer_relative_imports - - sort_child_properties_last + - prefer_single_quotes + - prefer_void_to_null + - sort_constructors_first + - sort_pub_dependencies - sort_unnamed_constructors_first - - test_types_in_equals - - type_literal_in_constant_pattern + # - specify_nonobvious_property_types + - throw_in_finally - unawaited_futures + - unintended_html_in_doc_comment + - unnecessary_await_in_return - unnecessary_breaks - unnecessary_lambdas - - unnecessary_null_checks + - unnecessary_library_directive + - unnecessary_library_name - unnecessary_parenthesis + - unnecessary_raw_strings - unnecessary_statements - - use_super_parameters + - unreachable_from_main + - use_enums + - use_if_null_to_convert_nulls_to_bools + - use_is_even_rather_than_modulo + - use_named_constants + - use_raw_strings + - use_string_buffers + - use_to_and_as_if_applicable diff --git a/example/android/.gitignore b/example/android/.gitignore index 6f56801..55afd91 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -7,7 +7,7 @@ gradle-wrapper.jar GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle deleted file mode 100644 index 0833ecf..0000000 --- a/example/android/app/build.gradle +++ /dev/null @@ -1,71 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion flutter.compileSdkVersion - ndkVersion flutter.ndkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.example" - // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts new file mode 100644 index 0000000..736b6be --- /dev/null +++ b/example/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.example.example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.example" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index 45d523a..399f698 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + + + + + + + diff --git a/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt index e793a00..70f8f08 100644 --- a/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt +++ b/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -2,5 +2,4 @@ package com.example.example import io.flutter.embedding.android.FlutterActivity -class MainActivity: FlutterActivity() { -} +class MainActivity: FlutterActivity() diff --git a/example/android/app/src/profile/AndroidManifest.xml b/example/android/app/src/profile/AndroidManifest.xml index 45d523a..399f698 100644 --- a/example/android/app/src/profile/AndroidManifest.xml +++ b/example/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,4 @@ - + - + @@ -31,28 +31,8 @@ example - - - - - + diff --git a/header_template.txt b/header_template.txt deleted file mode 100644 index b916296..0000000 --- a/header_template.txt +++ /dev/null @@ -1,3 +0,0 @@ -Copyright (c) {{.Year}}, Halil Durmus. Please see the AUTHORS file for details. -All rights reserved. Use of this source code is governed by a BSD-style -license that can be found in the LICENSE file. diff --git a/lib/siri_wave.dart b/lib/siri_wave.dart index 855d94f..254092e 100644 --- a/lib/siri_wave.dart +++ b/lib/siri_wave.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - /// A Flutter library that lets you create visually stunning *Siri-style* /// waveforms. /// diff --git a/lib/src/ios_7/ios_7_siri_waveform.dart b/lib/src/ios_7/ios_7_siri_waveform.dart index b6d9075..5b3a7db 100644 --- a/lib/src/ios_7/ios_7_siri_waveform.dart +++ b/lib/src/ios_7/ios_7_siri_waveform.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - import 'package:flutter/material.dart'; import '../models/siri_waveform_controller.dart'; @@ -13,7 +9,7 @@ class IOS7SiriWaveform extends StatefulWidget { /// /// The [controller] is responsible for controlling the properties and /// behavior of the waveform. - const IOS7SiriWaveform({super.key, required this.controller}); + const IOS7SiriWaveform({required this.controller, super.key}); /// The controller that manages the properties and behavior of the waveform. final IOS7SiriWaveformController controller; diff --git a/lib/src/ios_7/ios_7_siri_waveform_painter.dart b/lib/src/ios_7/ios_7_siri_waveform_painter.dart index 07d6540..02bdcd0 100644 --- a/lib/src/ios_7/ios_7_siri_waveform_painter.dart +++ b/lib/src/ios_7/ios_7_siri_waveform_painter.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - import 'dart:math' as math; import 'package:flutter/animation.dart' show AnimationController; @@ -72,6 +68,7 @@ class IOS7SiriWaveformPainter extends CustomPainter { } final paint = Paint() + // ignore: deprecated_member_use ..color = controller.color.withOpacity(curve.opacity) ..strokeWidth = curve.width ..style = PaintingStyle.stroke; diff --git a/lib/src/ios_9/ios_9_siri_waveform.dart b/lib/src/ios_9/ios_9_siri_waveform.dart index e1c35a9..ccb0135 100644 --- a/lib/src/ios_9/ios_9_siri_waveform.dart +++ b/lib/src/ios_9/ios_9_siri_waveform.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - import 'package:flutter/material.dart'; import '../models/siri_waveform_controller.dart'; @@ -18,8 +14,8 @@ class IOS9SiriWaveform extends StatefulWidget { /// Additionally, you can customize whether to show the support bar on the /// waveform using [showSupportBar]. By default, the support bar is shown. const IOS9SiriWaveform({ - super.key, required this.controller, + super.key, this.showSupportBar = true, }); diff --git a/lib/src/ios_9/ios_9_siri_waveform_painter.dart b/lib/src/ios_9/ios_9_siri_waveform_painter.dart index 9cc671c..3da017d 100644 --- a/lib/src/ios_9/ios_9_siri_waveform_painter.dart +++ b/lib/src/ios_9/ios_9_siri_waveform_painter.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - import 'dart:math' as math; import 'package:flutter/material.dart'; @@ -66,7 +62,7 @@ class IOS9SiriWaveformPainter extends CustomPainter { waveform.verses[ci] = _getRandomRange([-1, 1]).toDouble(); } - List _getEmptyArray(int length) => List.filled(length, 0.0); + List _getEmptyArray(int length) => List.filled(length, 0); void _spawn(String key) { final curvesCount = _getRandomRange(_noOfCurvesRanges).floor(); diff --git a/lib/src/ios_9/support_bar_painter.dart b/lib/src/ios_9/support_bar_painter.dart index e121144..304a57d 100644 --- a/lib/src/ios_9/support_bar_painter.dart +++ b/lib/src/ios_9/support_bar_painter.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - import 'package:flutter/rendering.dart'; /// A custom painter responsible for rendering a support bar on @@ -16,9 +12,13 @@ class IOS9SiriWaveformSupportBarPainter extends CustomPainter { final rect = Rect.fromLTWH(0, maxHeight, size.width, 1); final shader = LinearGradient( colors: [ + // ignore: deprecated_member_use const Color(0xFF111111).withOpacity(.7), + // ignore: deprecated_member_use const Color(0xFFFFFFFF).withOpacity(.7), + // ignore: deprecated_member_use const Color(0xFFFFFFFF).withOpacity(.7), + // ignore: deprecated_member_use const Color(0xFF111111).withOpacity(.7) ], stops: const [0, .1, .8, 1], diff --git a/lib/src/models/siri_waveform_controller.dart b/lib/src/models/siri_waveform_controller.dart index aa38f31..8af7d41 100644 --- a/lib/src/models/siri_waveform_controller.dart +++ b/lib/src/models/siri_waveform_controller.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - import 'package:flutter/material.dart' show Color, Colors; /// A base class for controllers used to manage *Siri-style* waveforms. @@ -23,8 +19,14 @@ sealed class SiriWaveformController { this.speed = .2, }) : _interpolationAmplitude = amplitude, _interpolationSpeed = speed, - assert(amplitude >= 0 && amplitude <= 1), - assert(speed >= 0 && speed <= 1); + assert( + amplitude >= 0 && amplitude <= 1, + 'The amplitude must be in the [0, 1] range.', + ), + assert( + speed >= 0 && speed <= 1, + 'The speed must be in the [0, 1] range.', + ); /// The amplitude of the waveform. /// @@ -89,7 +91,10 @@ final class IOS7SiriWaveformController extends SiriWaveformController { super.speed, this.color = Colors.white, this.frequency = 6, - }) : assert(frequency >= -20 && frequency <= 20); + }) : assert( + frequency >= -20 && frequency <= 20, + 'The frequency must be in the [-20, 20] range.', + ); /// The color of the waveform. /// diff --git a/lib/src/models/siri_waveform_options.dart b/lib/src/models/siri_waveform_options.dart index 58b6d80..cc6e76f 100644 --- a/lib/src/models/siri_waveform_options.dart +++ b/lib/src/models/siri_waveform_options.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - /// Represents the configuration options that can be used with the /// `SiriWaveform` widget. sealed class SiriWaveformOptions { diff --git a/lib/src/models/siri_waveform_style.dart b/lib/src/models/siri_waveform_style.dart index 368d120..2676fff 100644 --- a/lib/src/models/siri_waveform_style.dart +++ b/lib/src/models/siri_waveform_style.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - /// Represents the waveform style that will be used by the `SiriWaveform` /// widget. enum SiriWaveformStyle { diff --git a/lib/src/siri_waveform.dart b/lib/src/siri_waveform.dart index 3de2dab..9e88004 100644 --- a/lib/src/siri_waveform.dart +++ b/lib/src/siri_waveform.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - import 'package:flutter/material.dart'; import 'ios_7/ios_7_siri_waveform.dart'; diff --git a/melos.yaml b/melos.yaml deleted file mode 100644 index 362f5ea..0000000 --- a/melos.yaml +++ /dev/null @@ -1,112 +0,0 @@ -name: siri_wave -repository: https://github.com/halildurmus/siri_wave - -packages: [.] - -command: - bootstrap: - # It seems so that running "pub get" in parallel has some issues (like - # https://github.com/dart-lang/pub/issues/3404). Disabling this feature - # makes the CI much more stable. - runPubGetInParallel: false - version: - linkToCommits: true - -scripts: - test: - description: Run `dart test`. - run: dart test - - analyze: - description: Run `dart analyze --fatal-infos --fatal-warnings .`. - run: dart analyze --fatal-infos --fatal-warnings . - - clean: - description: > - Clean things very deeply, can be used to establish "pristine checkout" - status. - run: git clean -x -d -f -q - - format: - description: Run `dart format .`. - run: dart format . - - qualitycheck: - description: > - Run all targets generally expected in CI for a full local quality check. - run: > - melos run clean && - melos clean && - melos bootstrap && - melos run analyze && - melos run format && - melos run test - - add-license-header: - description: Add a license header to all necessary files. - # If you add here another --ignore flag, add it also to - # "check-license-header". - run: | - addlicense -f header_template.txt \ - --ignore "**/*.yml" \ - --ignore "**/*.yaml" \ - --ignore "**/*.xml" \ - --ignore "**/*.g.dart" \ - --ignore "**/*.sh" \ - --ignore "**/*.html" \ - --ignore "**/*.js" \ - --ignore "**/*.ts" \ - --ignore "**/*.g.h" \ - --ignore "**/*.g.m" \ - --ignore "**/*.rb" \ - --ignore "**/*.txt" \ - --ignore "**/*.cmake" \ - --ignore "**/Runner/AppDelegate.swift" \ - --ignore "**/Runner/MainFlutterWindow.swift" \ - --ignore "**/Runner/Runner-Bridging-Header.h" \ - --ignore "**/Runner/AppDelegate.h" \ - --ignore "**/Runner/AppDelegate.m" \ - --ignore "**/Runner/main.m" \ - --ignore "**/MainActivity.kt" \ - --ignore "**/MainActivity.java" \ - --ignore "**/FlutterMultiDexApplication.java" \ - --ignore "**/GeneratedPluginRegistrant.swift" \ - --ignore "**/Pods/**" \ - --ignore "**/flutter/generated_plugin_registrant.h" \ - --ignore "**/flutter/generated_plugin_registrant.cc" \ - . - - check-license-header: - description: Verify that all necessary files have a license header. - # If you add here another --ignore flag, add it also to - # "add-license-header". - run: | - addlicense -f header_template.txt \ - --check \ - --ignore "**/*.yml" \ - --ignore "**/*.yaml" \ - --ignore "**/*.xml" \ - --ignore "**/*.g.dart" \ - --ignore "**/*.sh" \ - --ignore "**/*.html" \ - --ignore "**/*.js" \ - --ignore "**/*.ts" \ - --ignore "**/*.g.h" \ - --ignore "**/*.g.m" \ - --ignore "**/*.rb" \ - --ignore "**/*.txt" \ - --ignore "**/*.cmake" \ - --ignore "**/Runner/AppDelegate.swift" \ - --ignore "**/Runner/MainFlutterWindow.swift" \ - --ignore "**/Runner/Runner-Bridging-Header.h" \ - --ignore "**/Runner/AppDelegate.h" \ - --ignore "**/Runner/AppDelegate.m" \ - --ignore "**/Runner/main.m" \ - --ignore "**/MainActivity.kt" \ - --ignore "**/MainActivity.java" \ - --ignore "**/FlutterMultiDexApplication.java" \ - --ignore "**/GeneratedPluginRegistrant.swift" \ - --ignore "**/Pods/**" \ - --ignore "**/flutter/generated_plugin_registrant.h" \ - --ignore "**/flutter/generated_plugin_registrant.cc" \ - . diff --git a/pubspec.yaml b/pubspec.yaml index 07c388e..1922695 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: siri_wave description: > A Flutter package that lets you create visually stunning Siri-style waveforms. -version: 2.0.0+1 +version: 2.1.0 repository: https://github.com/halildurmus/siri_wave issue_tracker: https://github.com/halildurmus/siri_wave/issues @@ -17,17 +17,16 @@ topics: - siri environment: - sdk: '^3.1.0' - flutter: '>=3.7.0' + sdk: ^3.5.0 dependencies: flutter: sdk: flutter dev_dependencies: - dartwindows_lints: ^1.0.0 + flutter_lints: ^5.0.0 flutter_test: sdk: flutter - melos: ">=3.1.1 <5.0.0" flutter: + uses-material-design: true diff --git a/test/ios_7/ios_7_siri_waveform_test.dart b/test/ios_7/ios_7_siri_waveform_test.dart index bee5773..caf5b3a 100644 --- a/test/ios_7/ios_7_siri_waveform_test.dart +++ b/test/ios_7/ios_7_siri_waveform_test.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:siri_wave/siri_wave.dart'; diff --git a/test/ios_9/ios_9_siri_waveform_test.dart b/test/ios_9/ios_9_siri_waveform_test.dart index d4072e3..d98ee64 100644 --- a/test/ios_9/ios_9_siri_waveform_test.dart +++ b/test/ios_9/ios_9_siri_waveform_test.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:siri_wave/siri_wave.dart'; diff --git a/test/siri_waveform_test.dart b/test/siri_waveform_test.dart index 11d9bbd..9d80602 100644 --- a/test/siri_waveform_test.dart +++ b/test/siri_waveform_test.dart @@ -1,7 +1,3 @@ -// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details. -// All rights reserved. Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:siri_wave/siri_wave.dart';