diff --git a/CHANGELOG.md b/CHANGELOG.md index 3316b8a..22841ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,4 +13,11 @@ Added onTap to specify a function. ## 0.0.4 -Fixed onTap to specify a callback. \ No newline at end of file +Fixed onTap to specify a callback. + +## 0.0.5 + +Fixed an issue with onTap causing null value. +`title` is now a required property. +The `title` is now centred if a `subtitle` is not provided. +An example app is added to check implementation. \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index 2cd0a91..54f8cc6 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -63,7 +63,7 @@ packages: path: ".." relative: true source: path - version: "0.0.4" + version: "0.0.5" flutter: dependency: "direct main" description: flutter diff --git a/lib/src/fancy_containers.dart b/lib/src/fancy_containers.dart index 05036bf..17e28e2 100644 --- a/lib/src/fancy_containers.dart +++ b/lib/src/fancy_containers.dart @@ -2,7 +2,7 @@ import 'package:fancy_containers/src/utils/fancy_containers_typedef.dart'; import 'package:flutter/material.dart'; class FancyContainer extends StatefulWidget { - FancyContainer({ + const FancyContainer({ Key? key, this.height = 120.0, this.width, @@ -18,18 +18,18 @@ class FancyContainer extends StatefulWidget { this.subtitleStyle, }) : super(key: key); - double? width; - double height = 120; - Color? color1; - Color? color2; - String title; - Color? textColor; - String? subtitle; - Color? subtitleColor; - FancyContainersCallback? onTap; - EdgeInsetsGeometry? padding; - TextStyle? titleStyle; - TextStyle? subtitleStyle; + final double? width; + final double height; + final Color? color1; + final Color? color2; + final String title; + final Color? textColor; + final String? subtitle; + final Color? subtitleColor; + final FancyContainersCallback? onTap; + final EdgeInsetsGeometry? padding; + final TextStyle? titleStyle; + final TextStyle? subtitleStyle; @override _FancyContainerState createState() => _FancyContainerState(); diff --git a/pubspec.yaml b/pubspec.yaml index 5a8eb1c..e78cf1d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fancy_containers description: Fancy Containers Flutter Package -version: 0.0.4 +version: 0.0.5 homepage: https://github.com/adityathakurxd/fancy_containers environment: