diff --git a/CHANGELOG.md b/CHANGELOG.md index ac07159..1de16ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ -## [0.0.1] - TODO: Add release date. +## [0.1.1] - January 21, 2020 -* TODO: Describe initial release. +* Initial release. diff --git a/LICENSE b/LICENSE index ba75c69..3d792ed 100644 --- a/LICENSE +++ b/LICENSE @@ -1 +1,7 @@ -TODO: Add your license here. +Copyright 2020 Michael Charles Aubrey + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/lib/clay_containers.dart b/lib/clay_containers.dart index a03ae5e..c0db1a3 100644 --- a/lib/clay_containers.dart +++ b/lib/clay_containers.dart @@ -1,4 +1,4 @@ -library neumorphic_containers; +library clay_containers; import 'package:flutter/material.dart'; @@ -14,11 +14,21 @@ class ClayContainer extends StatelessWidget { final int depth; ClayContainer( - {this.child, this.height, this.width, @required this.color, this.spread, this.borderRadius, this.customBorderRadius, this.curveType, this.depth}); + {this.child, + this.height, + this.width, + @required this.color, + this.spread, + this.borderRadius, + this.customBorderRadius, + this.curveType, + this.depth}); Color _getAdjustColor(Color baseColor, amount) { Map colors = { - "red": baseColor.red, "green": baseColor.green, "blue": baseColor.blue + "red": baseColor.red, + "green": baseColor.green, + "blue": baseColor.blue }; colors = colors.map((key, value) { int result = 0; @@ -64,9 +74,8 @@ class ClayContainer extends StatelessWidget { if (customBorderRadius != null) { borderRadiusValue = customBorderRadius; } - final CurveType curveTypeValue = curveType == null - ? CurveType.none - : curveType; + final CurveType curveTypeValue = + curveType == null ? CurveType.none : curveType; List gradientColors; switch (curveTypeValue) { @@ -81,7 +90,6 @@ class ClayContainer extends StatelessWidget { break; } - return Container( height: heightValue, width: widthValue, @@ -102,14 +110,9 @@ class ClayContainer extends StatelessWidget { color: _getAdjustColor(colorValue, 0 - depthValue), offset: Offset(spreadValue, spreadValue), blurRadius: spreadValue) - ] - ), + ]), ); } } -enum CurveType { - concave, - convex, - none -} \ No newline at end of file +enum CurveType { concave, convex, none } diff --git a/pubspec.yaml b/pubspec.yaml index b9de129..e4c3e5b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,6 @@ name: clay_containers description: Easily create custom neumorphic container widgets for your own unique design. version: 0.1.1 -author: Michael Charles Aubrey homepage: https://michaelcharl.es environment: diff --git a/test/clay_containers.dart b/test/clay_containers.dart index 8556c97..bea3263 100644 --- a/test/clay_containers.dart +++ b/test/clay_containers.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:neumorphic_containers/clay_containers.dart'; + +import '../lib/clay_containers.dart'; void main() { testWidgets('ClayContainer can have a child.', (WidgetTester tester) async {