From 74df55471cac1b14ed43de07462295d9486b215e Mon Sep 17 00:00:00 2001 From: Jagrit Date: Wed, 17 Mar 2021 16:42:57 +0530 Subject: [PATCH] migrate: to null safety --- CHANGELOG.md | 6 +++- README.md | 2 +- example/pubspec.lock | 42 +++++++++++++-------------- lib/Clippers/ticket_pass_clipper.dart | 12 ++++---- pubspec.lock | 40 ++++++++++++------------- pubspec.yaml | 4 +-- 6 files changed, 55 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75d44eb..3645c5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -## [0.0.1] - 2021-01-30 +## [1.0.0] - 2021-03-17 + +* migrate to null safety + +## [0.0.2] - 2021-01-30 * added new custom clippers * added new message clippers diff --git a/README.md b/README.md index fe2bbf5..32d27e2 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ To use this package, add `custom_clippers` as a [dependency in your pubspec.yaml ## Add dependency ``` dependencies: - custom_clippers: ^0.0.2 + custom_clippers: ^1.0.0 ``` ## Import diff --git a/example/pubspec.lock b/example/pubspec.lock index 940f962..60d36e3 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,56 +7,56 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.5.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" custom_clippers: dependency: "direct main" description: path: ".." relative: true source: path - version: "0.0.2" + version: "1.0.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" flutter: dependency: "direct main" description: flutter @@ -73,21 +73,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" sky_engine: dependency: transitive description: flutter @@ -99,56 +99,56 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.0" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.2.19" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" sdks: - dart: ">=2.10.0-110 <2.11.0" - flutter: ">=1.17.0 <2.0.0" + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" diff --git a/lib/Clippers/ticket_pass_clipper.dart b/lib/Clippers/ticket_pass_clipper.dart index 5dffd12..978148d 100644 --- a/lib/Clippers/ticket_pass_clipper.dart +++ b/lib/Clippers/ticket_pass_clipper.dart @@ -3,27 +3,27 @@ import 'package:flutter/material.dart'; class TicketPassClipper extends CustomClipper { TicketPassClipper({this.position, this.holeRadius = 16}); - double position; + double? position; final double holeRadius; @override Path getClip(Size size) { if (position == null) position = size.width - 16; - if (position > size.width) + if (position! > size.width) throw Exception('position is greater than width.'); final path = Path() ..moveTo(0, 0) - ..lineTo(position - holeRadius, 0.0) + ..lineTo(position! - holeRadius, 0.0) ..arcToPoint( - Offset(position, 0), + Offset(position!, 0), clockwise: false, radius: Radius.circular(1), ) ..lineTo(size.width, 0.0) ..lineTo(size.width, size.height) - ..lineTo(position, size.height) + ..lineTo(position!, size.height) ..arcToPoint( - Offset(position - holeRadius, size.height), + Offset(position! - holeRadius, size.height), clockwise: false, radius: Radius.circular(1), ); diff --git a/pubspec.lock b/pubspec.lock index 58937f9..b55f540 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,49 +7,49 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.5.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" flutter: dependency: "direct main" description: flutter @@ -66,21 +66,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" sky_engine: dependency: transitive description: flutter @@ -92,56 +92,56 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.0" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.2.19" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" sdks: - dart: ">=2.10.0-110 <2.11.0" - flutter: ">=1.17.0 <2.0.0" + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" diff --git a/pubspec.yaml b/pubspec.yaml index 5e18254..53c6f8c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,12 +1,12 @@ name: custom_clippers description: custom_clippers is a package that contains multiple custom clippers and different types of message clippers which you can give to clipper property of ClipPath. -version: 0.0.2 +version: 1.0.0 author: Jagrit Kharbanda homepage: https://github.com/jagritjkh/custom_clippers environment: - sdk: ">=2.7.0 <3.0.0" + sdk: '>=2.12.0 <3.0.0' flutter: ">=1.17.0 <2.0.0" dependencies: