From 29514445a650c6f4a4e462f373f52cdbe1232c67 Mon Sep 17 00:00:00 2001 From: bai-3 Date: Wed, 30 Oct 2024 20:44:44 +0800 Subject: [PATCH] init ui --- lib/domain/utils/identicon.dart | 4 ++-- lib/infra/components/avatar.dart | 2 +- lib/infra/components/close_bar.dart | 5 +++-- lib/infra/components/window.dart | 6 +++--- lib/infra/pages/channel/bar.dart | 7 ++++--- lib/infra/pages/channel/chat.dart | 7 +++++-- lib/infra/pages/channel/input.dart | 3 +-- lib/infra/pages/main_pc.dart | 11 ++++------- lib/infra/pages/org/org.dart | 12 ++++++++---- lib/infra/router/pop_router.dart | 14 ++++++++++---- 10 files changed, 41 insertions(+), 30 deletions(-) diff --git a/lib/domain/utils/identicon.dart b/lib/domain/utils/identicon.dart index e9b572e6..e35e0514 100644 --- a/lib/domain/utils/identicon.dart +++ b/lib/domain/utils/identicon.dart @@ -5,8 +5,8 @@ import 'package:crypto/crypto.dart'; import 'package:image/image.dart' as img; class Identicon { - final int _rows = 10; - final int _cols = 10; + final int _rows = 6; + final int _cols = 6; late Function(List) _digest; List _fgColour = [255, 255, 255]; diff --git a/lib/infra/components/avatar.dart b/lib/infra/components/avatar.dart index 02d39c28..da2f2a4b 100644 --- a/lib/infra/components/avatar.dart +++ b/lib/infra/components/avatar.dart @@ -114,7 +114,7 @@ class BaseAvatar extends StatefulWidget { final Color? bg; final Color? color; - const BaseAvatar(this.avatarSrc, this.online, this.avatarWidth, {Key? key, this.bg, this.color}) : super(key: key); + const BaseAvatar(this.avatarSrc, this.online, this.avatarWidth, {super.key, this.bg, this.color}); @override State createState() => _BaseAvatarState(); diff --git a/lib/infra/components/close_bar.dart b/lib/infra/components/close_bar.dart index 8f489cee..3d7278db 100644 --- a/lib/infra/components/close_bar.dart +++ b/lib/infra/components/close_bar.dart @@ -12,7 +12,7 @@ class CloseBar extends StatefulWidget { final Widget? child; final Color? color; - const CloseBar({Key? key, this.child, this.color}) : super(key: key); + const CloseBar({super.key, this.child, this.color}); @override State createState() => _CloseBarState(); @@ -65,10 +65,11 @@ class _CloseBarState extends State with WindowListener { } if (widget.child == null) return renderIcons(constTheme); return Column( + mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.end, children: [ renderIcons(constTheme), - SizedBox(height: 6.w), + // SizedBox(height: 2.w), widget.child!, ], ); diff --git a/lib/infra/components/window.dart b/lib/infra/components/window.dart index 3173d93a..982a96de 100644 --- a/lib/infra/components/window.dart +++ b/lib/infra/components/window.dart @@ -44,13 +44,13 @@ class _AeroFrameState extends State with WindowListener { final constTheme = Theme.of(context).extension()!; return Container( decoration: BoxDecoration( - color: constTheme.sidebarBg.withOpacity(0.70), + color: constTheme.sidebarBg.withOpacity(0.90), border: Border.all( color: Theme.of(context).dividerColor.withOpacity(0.3), width: (_isMaximized || _isFullScreen) ? 0 : 1, ), borderRadius: BorderRadius.circular( - (_isMaximized || _isFullScreen) ? 0 : 24 + (_isMaximized || _isFullScreen) ? 0 : 14 ), boxShadow: [ if (!_isMaximized && !_isFullScreen) @@ -72,7 +72,7 @@ class _AeroFrameState extends State with WindowListener { child: ClipRRect( clipBehavior: Clip.hardEdge, borderRadius: BorderRadius.circular( - (_isMaximized || _isFullScreen) ? 0 : 20, + (_isMaximized || _isFullScreen) ? 0 : 12, ), child: widget.child, ), diff --git a/lib/infra/pages/channel/bar.dart b/lib/infra/pages/channel/bar.dart index a8112833..205f88c0 100644 --- a/lib/infra/pages/channel/bar.dart +++ b/lib/infra/pages/channel/bar.dart @@ -16,9 +16,8 @@ class ChannelBar extends StatefulWidget implements PreferredSizeWidget { final link.Room room; final Widget? tools; final Function? onBack; - ChannelBar({Key? key, this.onBack, this.tools, required this.room, double? height}) - : _height = height ?? 60.w, - super(key: key); + ChannelBar({super.key, this.onBack, this.tools, required this.room, double? height}) + : _height = height ?? 60.w; @override State createState() => _ChannelBarState(); @@ -59,6 +58,8 @@ class _ChannelBarState extends State { Container( height: widget._height, decoration: BoxDecoration( + color: constTheme.centerChannelBg, + borderRadius: BorderRadius.only(topLeft: Radius.circular(10.w)), border: Border( bottom: BorderSide(color: constTheme.centerChannelDivider), ), diff --git a/lib/infra/pages/channel/chat.dart b/lib/infra/pages/channel/chat.dart index a4d31cf4..f355942d 100644 --- a/lib/infra/pages/channel/chat.dart +++ b/lib/infra/pages/channel/chat.dart @@ -399,9 +399,12 @@ class _ChannelDetailPageState extends State with WindowListen ), ), ), - backgroundColor: constTheme.centerChannelBg, + backgroundColor: Colors.transparent, body: Container( - color: constTheme.centerChannelBg, + decoration: BoxDecoration( + borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10.w)), + color: constTheme.centerChannelBg, + ), child: Column( children: [ Expanded( diff --git a/lib/infra/pages/channel/input.dart b/lib/infra/pages/channel/input.dart index 394ef506..8d1953c2 100644 --- a/lib/infra/pages/channel/input.dart +++ b/lib/infra/pages/channel/input.dart @@ -27,7 +27,7 @@ import 'package:dtim/domain/utils/matrix_sdk_extensions/matrix_file_extension.da class ChannelInputPage extends StatefulWidget { final link.Room room; - const ChannelInputPage({Key? key, required this.room}) : super(key: key); + const ChannelInputPage({super.key, required this.room}); @override State createState() => _ChannelInputPageState(); @@ -253,7 +253,6 @@ class _ChannelInputPageState extends State { height: 66.w, padding: EdgeInsets.symmetric(horizontal: 15.w), decoration: BoxDecoration( - color: constTheme.centerChannelBg, border: Border(top: BorderSide(color: constTheme.centerChannelDivider)), ), child: Row( diff --git a/lib/infra/pages/main_pc.dart b/lib/infra/pages/main_pc.dart index c33a5099..50ba14c7 100644 --- a/lib/infra/pages/main_pc.dart +++ b/lib/infra/pages/main_pc.dart @@ -103,6 +103,7 @@ class _PCPageState extends State { Widget build(BuildContext context) { final constTheme = Theme.of(context).extension()!; return Scaffold( + backgroundColor: Colors.transparent, body: AutoTabsRouter.pageView( routes: mainPages, scrollDirection: Axis.vertical, @@ -116,19 +117,15 @@ class _PCPageState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ moveWindow( - Container( - width: 65.w, + SizedBox( + width: 55.w, height: double.maxFinite, - decoration: BoxDecoration( - color: constTheme.sidebarHeaderBg, - border: Border(right: BorderSide(color: constTheme.sidebarHeaderBg.lighter(0.08), width: 1)), - ), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, children: [ if (PlatformInfos.isMacOS) SizedBox(height: 20.w), - SizedBox(height: 12.w), + SizedBox(height: 6.w), // 用户 SizedBox( width: 40.w, diff --git a/lib/infra/pages/org/org.dart b/lib/infra/pages/org/org.dart index ed2d81bd..3d3ae5cd 100644 --- a/lib/infra/pages/org/org.dart +++ b/lib/infra/pages/org/org.dart @@ -32,14 +32,18 @@ class _OrgPageState extends State { Widget build(BuildContext context) { final constTheme = Theme.of(context).extension()!; return Scaffold( - backgroundColor: constTheme.centerChannelBg, + backgroundColor: Colors.transparent, body: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Container( height: double.maxFinite, width: leftWidth, - color: constTheme.sidebarBg, + decoration: BoxDecoration( + color: constTheme.centerChannelBg, + borderRadius: BorderRadius.circular(10.w) + ), + margin: EdgeInsets.only(left: 5.w), child: OrgViewPage(key: const Key("OrgViewPage"), width: leftWidth), ), GestureDetector( @@ -48,8 +52,8 @@ class _OrgPageState extends State { child: Row( children: [ Container( - color: constTheme.centerChannelColor.withOpacity(0.08), - width: 1, + color: Colors.transparent, + width: 3.w, height: double.infinity, ), const SizedBox(width: 1, height: double.infinity), diff --git a/lib/infra/router/pop_router.dart b/lib/infra/router/pop_router.dart index cd81f113..9f600bec 100644 --- a/lib/infra/router/pop_router.dart +++ b/lib/infra/router/pop_router.dart @@ -70,7 +70,7 @@ getPage(String url, Function closeModel) { return KycPage(closeModel: closeModel); } else if (url.indexOf("/user_setting") == 0) { return UserSettingPage(closeModel: closeModel); - } + } return const Center(child: Text("404")); } @@ -106,9 +106,15 @@ Future showModelOrPage(context, url, {double width = 520, double height = ), ], ), - child: getPage(url, () { - context.router.pop(); - }), + child: ClipRRect( + // clipBehavior: Clip.hardEdge, + borderRadius: BorderRadius.circular( + 7.w, + ), + child: getPage(url, () { + context.router.pop(); + }), + ), ); }, );