From 0cb4f256d77892b4f2da24ef99769b4fadfdef30 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Tue, 23 Feb 2021 09:17:55 +0800 Subject: [PATCH] =?UTF-8?q?fix=20subTitle=20empty=20issue=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/views/info_view.dart | 4 ++-- lib/src/views/settings_view.dart | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/src/views/info_view.dart b/lib/src/views/info_view.dart index 4fb33be..87fdc42 100644 --- a/lib/src/views/info_view.dart +++ b/lib/src/views/info_view.dart @@ -74,7 +74,7 @@ class _InfoViewState extends State children: [ Text(title), Text( - subTitle, + subTitle ?? '', style: TextStyle(fontSize: 22), maxLines: 2, overflow: TextOverflow.ellipsis, @@ -89,7 +89,7 @@ class _InfoViewState extends State _buildTile(String title, String subTitle) { return ListTile( title: Text(title), - subtitle: Text(subTitle), + subtitle: Text(subTitle ?? ''), onLongPress: () { Clipboard.setData(ClipboardData(text: subTitle)); Scaffold.of(context).showSnackBar(SnackBar(content: Text('已复制'))); diff --git a/lib/src/views/settings_view.dart b/lib/src/views/settings_view.dart index c04b3e6..00dbff0 100644 --- a/lib/src/views/settings_view.dart +++ b/lib/src/views/settings_view.dart @@ -10,6 +10,15 @@ class SettingsView extends StatefulWidget { class _SettingsViewState extends State { @override Widget build(BuildContext context) { - return ListView(); + return ListView( + children: [ + SwitchListTile( + title: Text('终端日志'), + subtitle: Text(''), + value: false, + onChanged: (state) {}, + ), + ], + ); } }