Skip to content

Commit

Permalink
ci: update ci-related scripts
Browse files Browse the repository at this point in the history
Closes #139
  • Loading branch information
rafamizes authored Aug 20, 2024
1 parent 5024ec6 commit b95ef24
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 55 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- sdk = ^3.0.5.
- lint package update to version 2.3.0 — stricter linting rules.
- update Github actions and Rultor scripts.

## [2.2.1] - 2023-02-05
Expand Down
23 changes: 8 additions & 15 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
include: package:lint/package.yaml

analyzer:
strong-mode:
# A value of false ensures that the type inference engine never implicitly casts
# from dynamic to a more specific type.
implicit-casts: false
# A value of false ensures that the type inference engine never chooses the
# dynamic type when it can’t determine a static type.
implicit-dynamic: false
exclude:
- '**.freezed.dart'
- '**.g.dart'
linter:
rules:
# Make constructors the first thing in every class
sort_unnamed_constructors_first: true
sort_constructors_first: true
avoid_catches_without_on_clauses: true
avoid_equals_and_hash_code_on_mutable_classes: true
cancel_subscriptions: true
# Good packages document everything
public_member_api_docs: true
unawaited_futures: true
# It's a good practice to expose the ability to provide a key when creating
# public widgets.
use_key_in_widget_constructors: true
always_declare_return_types: true
cancel_subscriptions: true
close_sinks: true
only_throw_errors: true
package_api_docs: true
13 changes: 12 additions & 1 deletion example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
include: package:lint/strict.yaml

analyzer:
exclude:
- '**.freezed.dart'
- '**.g.dart'
linter:
rules:
unawaited_futures: true
# Make constructors the first thing in every class
sort_unnamed_constructors_first: true
sort_constructors_first: true
avoid_catches_without_on_clauses: true
avoid_equals_and_hash_code_on_mutable_classes: true
cancel_subscriptions: true
only_throw_errors: true
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {

defaultConfig {
applicationId "dev.dartoos.example"
minSdkVersion 16
minSdkVersion flutter.minSdkVersion
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
22 changes: 11 additions & 11 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void main() {
/// Root widget.
class ExampleApp extends StatelessWidget {
/// Ctor.
const ExampleApp({Key? key}) : super(key: key);
const ExampleApp({super.key});

@override
Widget build(BuildContext context) {
Expand All @@ -24,9 +24,7 @@ class ExampleApp extends StatelessWidget {
/// Showcase widget of color swatches.
class Showcase extends StatelessWidget {
/// Ctor.
const Showcase({required String title, Key? key})
: _title = title,
super(key: key);
const Showcase({required String title, super.key}) : _title = title;

final String _title;

Expand Down Expand Up @@ -61,11 +59,14 @@ class Showcase extends StatelessWidget {

/// Color swatch widget that mimics the Material Design color showcase.
class SwatchWidget extends StatelessWidget {
const SwatchWidget(Swatch swatch, Contrast contrast, String title, {Key? key})
: _swatch = swatch,
const SwatchWidget(
Swatch swatch,
Contrast contrast,
String title, {
super.key,
}) : _swatch = swatch,
_contrast = contrast,
_title = '$title 50',
super(key: key);
_title = '$title 50';

/// Brown swatch.
const SwatchWidget.browns({Key? key})
Expand Down Expand Up @@ -122,11 +123,10 @@ class ColorTile extends StatelessWidget {
required Color bgColor,
required Color fontColor,
required String label,
Key? key,
super.key,
}) : _bgColor = bgColor,
_fontColor = fontColor,
_label = label,
super(key: key);
_label = label;

final Color _bgColor;
final Color _fontColor;
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ packages:
dependency: "direct dev"
description:
name: lint
sha256: "3e9343b1cededcfb1e8b40d0dbd3592b7a1c6c0121545663a991433390c2bc97"
sha256: d758a5211fce7fd3f5e316f804daefecdc34c7e53559716125e6da7388ae8565
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "2.3.0"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -200,5 +200,5 @@ packages:
source: hosted
version: "14.2.4"
sdks:
dart: ">=3.3.0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ homepage: https://dartoos.dev
repository: https://github.com/dartoos-dev/eo_color

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ^3.5.0

dependencies:
eo_color:
Expand All @@ -20,4 +20,4 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
lint: ^2.0.1
lint: ^2.3.0
3 changes: 1 addition & 2 deletions lib/src/gradient_immut.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import 'dart:ui';

import 'package:eo_color/gradients.dart' as eo_color;
import 'package:eo_color/palettes.dart';
import 'package:eo_color/swatches.dart';

/// Convenience [Gradient] that retrieves immutable lists of colors.
abstract class GradientImmut extends SwatchBase implements eo_color.Gradient {
/// [palettes] is a source of colors to be transformed into an immutable list.
const GradientImmut(Iterable<Palette> palettes) : super(palettes);
const GradientImmut(super.palettes);

/// An **immutable list** of position-dependent colors — a color gradient.
@override
Expand Down
2 changes: 1 addition & 1 deletion lib/src/palette.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:ui';

/// Color palette from which a color can be selected.
abstract class Palette {
abstract interface class Palette {
/// The selected color.
Color get color;
}
16 changes: 8 additions & 8 deletions lib/src/palette_rgb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import 'package:eo_color/palettes.dart';

/// A Palette Color from alpha, red, green and blue.
///
/// The color value consists of four bytes (32 bits):
/// - bits 24-31 are the alpha value (opacity).
/// - bits 16-23 are the red value.
/// - bits 8–15 are the green value.
/// - bits 0–7 are the blue value.
/// The color value consists of 4 bytes (32 bits):
/// - bits 0–7 represent the blue value.
/// - bits 8–15 represent the green value.
/// - bits 16–23 represent the red value.
/// - bits 24–31 represent the alpha value — opacity.
abstract class PaletteRGB implements Palette {
/// Custom [alpha] and [rgb] values.
const PaletteRGB({required int alpha, required int rgb})
Expand All @@ -21,17 +21,17 @@ abstract class PaletteRGB implements Palette {

/// Convenience white #FFFFFF.
///
/// [opacity] the opacity value; it defaults to 0xFF - fully opaque.
/// [opacity] the opacity value; it defaults to `0xFF` fully opaque.
const PaletteRGB.white({int opacity = 0xFF})
: this(alpha: opacity, rgb: 0xFFFFFF); // coverage:ignore-line

/// Convenience black #000000.
///
/// [opacity] the opacity value; it defaults to 0xFF - fully opaque.
/// [opacity] the opacity value; it defaults to `0xFF` fully opaque.
const PaletteRGB.black({int opacity = 0xFF})
: this(alpha: opacity, rgb: 0x000000); // coverage:ignore-line

/// the color's 32 bits.
/// The 32-bit pattern of this color.
final int _value;

/// The rgb color.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/swatch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'dart:ui';
///
/// A group of related colors such as the colors of the rainbow, shades of grey,
/// etc.
abstract class Swatch {
abstract interface class Swatch {
/// const ctor.
const Swatch(); // coverage:ignore-line

Expand Down
6 changes: 3 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ packages:
dependency: "direct dev"
description:
name: lint
sha256: "3e9343b1cededcfb1e8b40d0dbd3592b7a1c6c0121545663a991433390c2bc97"
sha256: d758a5211fce7fd3f5e316f804daefecdc34c7e53559716125e6da7388ae8565
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "2.3.0"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -193,5 +193,5 @@ packages:
source: hosted
version: "14.2.4"
sdks:
dart: ">=3.3.0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
5 changes: 2 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ homepage: https://dartoos.dev
repository: https://github.com/dartoos-dev/eo_color

environment:
sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.17.0"
sdk: ^3.5.0

dependencies:
flutter:
Expand All @@ -15,4 +14,4 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
lint: ^2.0.1
lint: ^2.3.0
3 changes: 1 addition & 2 deletions test/test_palette.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import 'package:eo_color/palettes.dart';

/// Testing purposes Palette subclass.
class TestPalette extends PaletteRGB {
const TestPalette({required int alpha, required int rgb})
: super(alpha: alpha, rgb: rgb);
const TestPalette({required super.alpha, required super.rgb});
const TestPalette.red() : super.opaque(0xFF0000);
const TestPalette.blue() : super.opaque(0x0000FF);
const TestPalette.green() : super.opaque(0x00FF00);
Expand Down

0 comments on commit b95ef24

Please sign in to comment.