diff --git a/CHANGELOG.md b/CHANGELOG.md index 01618c8..d4c3240 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,4 +18,8 @@ pre-release version ## 0.1.0 * Refactor main logic -* Check overflow in all areas horizontally and vertically \ No newline at end of file +* Check overflow in all areas horizontally and vertically + +## 1.0.0 + +* Update "How to Use" in README.md \ No newline at end of file diff --git a/README.md b/README.md index 7a6c614..4e92082 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Size the text to the size of the parent widget. It's similar to using a typical Text Widget. Inputable arguments are left open the same as the arguments in Text Widget. ~~~ + final text = "Strings Strings..."; final style = TextStyle( ... @@ -18,13 +19,72 @@ final style = TextStyle( color: Colors.balck, ... ); -const SizeTailoredText( - text: text, - textStyle: style, +SizeTailoredText( + ... + text, + width: 200, + height: 200, + style: style, maxLines: 5, -); + minFontSize: 1, + textAlign: TextAlign.left, + ... +), + ~~~ +## Example + + + + + + + + + + +
+ + +

+SizeTailoredText(
+    text,
+    maxLines: 5,
+    minFontSize: 1,
+    textAlign: TextAlign.left,
+    style: style,
+);
+Text(
+    text,
+    maxLines: 5,
+    textAlign: TextAlign.left,
+style: style,
+);
+
+ + +

+SizeTailoredText(text,
+    width: 200,
+    height: 200,
+    maxLines: 5,
+    minFontSize: 1,
+    textAlign: TextAlign.left,
+    style: style,
+);
+SizedBox(
+    width: 200,
+    height: 200,
+    child: Text(
+        text,
+        maxLines: 5,
+        textAlign: TextAlign.left,
+        style: style,
+    ),
+);
+
+ ## License MIT License diff --git a/example/lib/main.dart b/example/lib/main.dart index dc57ff2..6929711 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -47,33 +47,20 @@ class _MyAppState extends State { textAlign: TextAlign.left, style: style, ), - Text( - text, - maxLines: 5, - style: style, - - ), - // borderContainer(const Text(text, style: style)), - // SizeTailoredText( - // text: text, - // textStyle: style, - // maxWidth: 100, - // maxHeight: 100, - // maxLines: 6, - // textAlign: TextAlign.start, - // ) + SizedBox( + width: 200, + height: 200, + child: Text( + text, + maxLines: 5, + textAlign: TextAlign.left, + style: style, + ), + ) ], ), ), ), ); } - - Widget borderContainer(Widget child) => Container( - width: double.infinity, - height: 200, - decoration: const BoxDecoration( - border: Border.fromBorderSide(BorderSide(color: Colors.red))), - child: child, - ); } diff --git a/example/pubspec.lock b/example/pubspec.lock index 9a3e448..7417d76 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -176,7 +176,7 @@ packages: path: ".." relative: true source: path - version: "0.1.0" + version: "1.0.0" sky_engine: dependency: transitive description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 6a7872f..42d1219 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: size_tailored_text description: "Size the text to the size of the parent widget." -version: 0.1.0 +version: 1.0.0 homepage: https://github.com/aqoong/size_tailored_text environment: