From ebc3a38ee246aee6e64254e5726f82ce71434e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Kowali=C5=84ski?= Date: Mon, 24 May 2021 12:33:05 +0200 Subject: [PATCH] fixed short desciptions --- lib/widgets/expander.dart | 15 ++++++++------- pubspec.yaml | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/widgets/expander.dart b/lib/widgets/expander.dart index cc43c58..aa8eb2e 100644 --- a/lib/widgets/expander.dart +++ b/lib/widgets/expander.dart @@ -17,13 +17,14 @@ class _ExpanderState extends State { return Column( mainAxisSize: MainAxisSize.min, children: [ - MarkdownBody(data: widget.body.split(" ").getRange(0, 50).join(" ")), - TextButton.icon( - onPressed: () => setState(() { - expanded = true; - }), - icon: const Icon(Icons.keyboard_arrow_down), - label: Text("Czytaj więcej")) + MarkdownBody(data: widget.body.split(" ").take(50).join(" ")), + if (widget.body.split(" ").length > 50) + TextButton.icon( + onPressed: () => setState(() { + expanded = true; + }), + icon: const Icon(Icons.keyboard_arrow_down), + label: Text("Czytaj więcej")) ], ); else diff --git a/pubspec.yaml b/pubspec.yaml index cf7134c..b7f980b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A new Flutter application. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.7.1+7 +version: 0.7.2+8 environment: sdk: ">=2.6.0 <3.0.0"