From 4d5f3eb14afada06ca8469c5eed819134cfa8de8 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sun, 15 Oct 2023 16:49:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8A=A8=E6=80=81ADDITIONAL=5FTYPE=5FRE?= =?UTF-8?q?SERVE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dynamics/widgets/additional_panel.dart | 82 ++++++++++--------- 1 file changed, 45 insertions(+), 37 deletions(-) diff --git a/lib/pages/dynamics/widgets/additional_panel.dart b/lib/pages/dynamics/widgets/additional_panel.dart index f25b913e..248076c5 100644 --- a/lib/pages/dynamics/widgets/additional_panel.dart +++ b/lib/pages/dynamics/widgets/additional_panel.dart @@ -83,45 +83,53 @@ Widget addWidget(item, context, type, {floor = 1}) { ); case 'ADDITIONAL_TYPE_RESERVE': return dynamicProperty[type].state != -1 - ? Padding( - padding: const EdgeInsets.only(top: 8), - child: InkWell( - onTap: () {}, - child: Container( - width: double.infinity, - padding: const EdgeInsets.only( - left: 12, top: 10, right: 12, bottom: 10), - color: bgColor, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - dynamicProperty[type].title, - maxLines: 1, - overflow: TextOverflow.ellipsis, + ? dynamicProperty[type].title != null + ? Padding( + padding: const EdgeInsets.only(top: 8), + child: InkWell( + onTap: () {}, + child: Container( + width: double.infinity, + padding: const EdgeInsets.only( + left: 12, top: 10, right: 12, bottom: 10), + color: bgColor, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + dynamicProperty[type].title, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + const SizedBox(height: 1), + Text.rich( + TextSpan( + style: TextStyle( + color: Theme.of(context).colorScheme.outline, + fontSize: Theme.of(context) + .textTheme + .labelMedium! + .fontSize), + children: [ + if (dynamicProperty[type].desc1 != null) + TextSpan( + text: + dynamicProperty[type].desc1['text']), + const TextSpan(text: ' '), + if (dynamicProperty[type].desc2 != null) + TextSpan( + text: + dynamicProperty[type].desc2['text']), + ], + ), + ) + ], ), - const SizedBox(height: 1), - Text.rich( - TextSpan( - style: TextStyle( - color: Theme.of(context).colorScheme.outline, - fontSize: Theme.of(context) - .textTheme - .labelMedium! - .fontSize), - children: [ - TextSpan(text: dynamicProperty[type].desc1['text']), - const TextSpan(text: ' '), - TextSpan(text: dynamicProperty[type].desc2['text']), - ], - ), - ) - ], + // TextButton(onPressed: () {}, child: Text('123')) + ), ), - // TextButton(onPressed: () {}, child: Text('123')) - ), - ), - ) + ) + : const SizedBox() : const SizedBox(); case 'ADDITIONAL_TYPE_GOODS': return Padding(