From 25bc0d41013c39832508bf82165c4fa1be64f036 Mon Sep 17 00:00:00 2001 From: jyuesong <425698907@qq.com> Date: Thu, 20 Jan 2022 11:27:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../others/login_log/login_log_page.dart | 116 +++++++++--------- lib/module/others/other_page.dart | 63 ++++++---- 2 files changed, 97 insertions(+), 82 deletions(-) diff --git a/lib/module/others/login_log/login_log_page.dart b/lib/module/others/login_log/login_log_page.dart index 61d646d..7ceb496 100644 --- a/lib/module/others/login_log/login_log_page.dart +++ b/lib/module/others/login_log/login_log_page.dart @@ -32,73 +32,73 @@ class _LoginLogPageState extends ConsumerState with LazyLoadState< backCall: () { Navigator.of(context).pop(); }, - title: "任务日志", + title: "登录日志", ), body: list.isEmpty ? const Center( - child: CupertinoActivityIndicator(), - ) + child: CupertinoActivityIndicator(), + ) : ListView.builder( - itemBuilder: (context, index) { - LoginLogBean item = list[index]; + itemBuilder: (context, index) { + LoginLogBean item = list[index]; - return ColoredBox( - color: ref.watch(themeProvider).themeColor.settingBgColor(), - child: ListTile( - isThreeLine: true, - title: Text( - Utils.formatMessageTime(item.timestamp ?? 0), - style: TextStyle( - fontSize: 16, - color: ref.watch(themeProvider).themeColor.titleColor(), - ), - ), - subtitle: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox( - height: 5, - ), - SelectableText( - "${item.address}", - selectionWidthStyle: BoxWidthStyle.max, - selectionHeightStyle: BoxHeightStyle.max, - style: TextStyle( - color: ref.watch(themeProvider).themeColor.descColor(), - fontSize: 14, + return ColoredBox( + color: ref.watch(themeProvider).themeColor.settingBgColor(), + child: ListTile( + isThreeLine: true, + title: Text( + Utils.formatMessageTime(item.timestamp ?? 0), + style: TextStyle( + fontSize: 16, + color: ref.watch(themeProvider).themeColor.titleColor(), + ), ), - ), - const SizedBox( - height: 5, - ), - SelectableText( - "${item.ip}", - selectionWidthStyle: BoxWidthStyle.max, - selectionHeightStyle: BoxHeightStyle.max, - style: TextStyle( - color: ref.watch(themeProvider).themeColor.descColor(), - fontSize: 14, + subtitle: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox( + height: 5, + ), + SelectableText( + "${item.address}", + selectionWidthStyle: BoxWidthStyle.max, + selectionHeightStyle: BoxHeightStyle.max, + style: TextStyle( + color: ref.watch(themeProvider).themeColor.descColor(), + fontSize: 14, + ), + ), + const SizedBox( + height: 5, + ), + SelectableText( + "${item.ip}", + selectionWidthStyle: BoxWidthStyle.max, + selectionHeightStyle: BoxHeightStyle.max, + style: TextStyle( + color: ref.watch(themeProvider).themeColor.descColor(), + fontSize: 14, + ), + ), + ], ), + trailing: item.status == 0 + ? Icon( + CupertinoIcons.checkmark_circle, + color: primaryColor, + size: 16, + ) + : const Icon( + CupertinoIcons.clear_circled, + color: Colors.red, + size: 16, + ), ), - ], - ), - trailing: item.status == 0 - ? Icon( - CupertinoIcons.checkmark_circle, - color: primaryColor, - size: 16, - ) - : const Icon( - CupertinoIcons.clear_circled, - color: Colors.red, - size: 16, - ), + ); + }, + itemCount: list.length, ), - ); - }, - itemCount: list.length, - ), ); } diff --git a/lib/module/others/other_page.dart b/lib/module/others/other_page.dart index 3c56c13..f1b0063 100644 --- a/lib/module/others/other_page.dart +++ b/lib/module/others/other_page.dart @@ -138,9 +138,24 @@ class _OtherPageState extends ConsumerState { ), ), ), - const Divider( - indent: 15, - ), + ], + ), + ), + Container( + margin: const EdgeInsets.symmetric( + horizontal: 15, + vertical: 15, + ), + decoration: BoxDecoration( + color: ref.watch(themeProvider).themeColor.settingBgColor(), + borderRadius: const BorderRadius.all( + Radius.circular(15), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -176,24 +191,9 @@ class _OtherPageState extends ConsumerState { ), ), ), - ], - ), - ), - Container( - margin: const EdgeInsets.symmetric( - horizontal: 15, - vertical: 15, - ), - decoration: BoxDecoration( - color: ref.watch(themeProvider).themeColor.settingBgColor(), - borderRadius: const BorderRadius.all( - Radius.circular(15), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + const Divider( + indent: 15, + ), GestureDetector( onTap: () { if (getIt().useSecretLogined) { @@ -230,9 +230,24 @@ class _OtherPageState extends ConsumerState { ), ), ), - const Divider( - indent: 15, - ), + ], + ), + ), + Container( + margin: const EdgeInsets.symmetric( + horizontal: 15, + vertical: 15, + ), + decoration: BoxDecoration( + color: ref.watch(themeProvider).themeColor.settingBgColor(), + borderRadius: const BorderRadius.all( + Radius.circular(15), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Padding( padding: const EdgeInsets.only( left: 15,