Skip to content

Commit

Permalink
migrate: to null safety
Browse files Browse the repository at this point in the history
  • Loading branch information
jagritjkh committed Mar 17, 2021
1 parent f052e9f commit 83e47cd
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 74 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
## [1.0.1] - 02-11-2020
## [2.0.0] - 2021-03-17

* migrate to null safety.

## [1.0.1] - 2020-11-02

* Add: `padding` property to `Frost` widget.
* Add: `Frost.text` which takes string as input.
* Add: `Frost.icon` which takes iconData as input.

## [1.0.0] - 02-11-2020
## [1.0.0] - 2020-11-02

* Breaking: The `borderRadius` datatype has changed from `double` to `BorderRadius`.
* Add: `height` and `width` properties to `ImageBlur.asset` and `ImageBlur.network`.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To use this package, add `blur` as a [dependency in your pubspec.yaml file](http
## Add dependency
```
dependencies:
blur: ^1.0.1
blur: ^2.0.0
```

## Import
Expand Down
42 changes: 21 additions & 21 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,56 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.1"
version: "2.5.0"
blur:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "1.0.1"
version: "2.0.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
Expand All @@ -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
Expand All @@ -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"
56 changes: 28 additions & 28 deletions lib/blur.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import 'package:flutter/material.dart';
///alignment is the alignment geometry of the overlay
class Blur extends StatelessWidget {
Blur({
Key key,
@required this.child,
Key? key,
required this.child,
this.blur = 5,
this.blurColor = Colors.white,
this.borderRadius,
Expand All @@ -26,9 +26,9 @@ class Blur extends StatelessWidget {
final Widget child;
final double blur;
final Color blurColor;
final BorderRadius borderRadius;
final BorderRadius? borderRadius;
final double colorOpacity;
final Widget overlay;
final Widget? overlay;
final AlignmentGeometry alignment;

@override
Expand Down Expand Up @@ -64,11 +64,11 @@ class ImageBlur extends StatelessWidget {
///acts as Image.asset
ImageBlur.asset(
String path, {
Key key,
BoxFit fit,
double height,
double width,
double scale,
Key? key,
BoxFit? fit,
double? height,
double? width,
double? scale,
this.blur = 5,
this.blurColor = Colors.white,
this.borderRadius,
Expand All @@ -86,11 +86,11 @@ class ImageBlur extends StatelessWidget {
///acts as Image.network
ImageBlur.network(
String url, {
Key key,
BoxFit fit,
double height,
double width,
double scale,
Key? key,
BoxFit? fit,
double? height,
double? width,
required double scale,
this.blur = 5,
this.blurColor = Colors.white,
this.borderRadius,
Expand All @@ -108,9 +108,9 @@ class ImageBlur extends StatelessWidget {
final Widget image;
final double blur;
final Color blurColor;
final BorderRadius borderRadius;
final BorderRadius? borderRadius;
final double colorOpacity;
final Widget overlay;
final Widget? overlay;

@override
Widget build(BuildContext context) {
Expand All @@ -135,7 +135,7 @@ class ImageBlur extends StatelessWidget {
///padding is the child padding
class Frost extends StatelessWidget {
Frost({
Key key,
Key? key,
this.child,
this.blur = 5,
this.frostColor = Colors.white,
Expand All @@ -152,9 +152,9 @@ class Frost extends StatelessWidget {
///textStyle is the styling of the string text
Frost.text(
String text, {
Key key,
TextAlign textAlign,
TextStyle textStyle,
Key? key,
TextAlign? textAlign,
TextStyle? textStyle,
this.blur = 5,
this.frostColor = Colors.white,
this.alignment = Alignment.center,
Expand All @@ -171,9 +171,9 @@ class Frost extends StatelessWidget {
///iconSize is the size of the icon
Frost.icon(
IconData iconData, {
Color iconColor,
double iconSize,
Key key,
Color? iconColor,
double? iconSize,
Key? key,
this.blur = 5,
this.frostColor = Colors.white,
this.alignment = Alignment.center,
Expand All @@ -185,14 +185,14 @@ class Frost extends StatelessWidget {
}) : child = Icon(iconData, color: iconColor, size: iconSize),
super(key: key);

final Widget child;
final Widget? child;
final double blur;
final Color frostColor;
final double frostOpacity;
final double height;
final double width;
final double? height;
final double? width;
final AlignmentGeometry alignment;
final BorderRadius borderRadius;
final BorderRadius? borderRadius;
final EdgeInsets padding;

@override
Expand All @@ -204,7 +204,7 @@ class Frost extends StatelessWidget {
child: Container(
height: height,
width: width,
padding: padding ?? EdgeInsets.zero,
padding: padding,
child: height == null || width == null ? child : SizedBox.shrink(),
color: frostColor.withOpacity(frostOpacity),
),
Expand Down
Loading

0 comments on commit 83e47cd

Please sign in to comment.