Skip to content

Commit

Permalink
init ui
Browse files Browse the repository at this point in the history
  • Loading branch information
bai-3 authored and bai-3 committed Oct 30, 2024
1 parent 6c7d4e5 commit 2951444
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 30 deletions.
4 changes: 2 additions & 2 deletions lib/domain/utils/identicon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>) _digest;

List<int> _fgColour = [255, 255, 255];
Expand Down
2 changes: 1 addition & 1 deletion lib/infra/components/avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<BaseAvatar> createState() => _BaseAvatarState();
Expand Down
5 changes: 3 additions & 2 deletions lib/infra/components/close_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<StatefulWidget> createState() => _CloseBarState();
Expand Down Expand Up @@ -65,10 +65,11 @@ class _CloseBarState extends State<CloseBar> 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!,
],
);
Expand Down
6 changes: 3 additions & 3 deletions lib/infra/components/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ class _AeroFrameState extends State<AeroFrame> with WindowListener {
final constTheme = Theme.of(context).extension<ExtColors>()!;
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: <BoxShadow>[
if (!_isMaximized && !_isFullScreen)
Expand All @@ -72,7 +72,7 @@ class _AeroFrameState extends State<AeroFrame> with WindowListener {
child: ClipRRect(
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(
(_isMaximized || _isFullScreen) ? 0 : 20,
(_isMaximized || _isFullScreen) ? 0 : 12,
),
child: widget.child,
),
Expand Down
7 changes: 4 additions & 3 deletions lib/infra/pages/channel/bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChannelBar> createState() => _ChannelBarState();
Expand Down Expand Up @@ -59,6 +58,8 @@ class _ChannelBarState extends State<ChannelBar> {
Container(
height: widget._height,
decoration: BoxDecoration(
color: constTheme.centerChannelBg,
borderRadius: BorderRadius.only(topLeft: Radius.circular(10.w)),
border: Border(
bottom: BorderSide(color: constTheme.centerChannelDivider),
),
Expand Down
7 changes: 5 additions & 2 deletions lib/infra/pages/channel/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,12 @@ class _ChannelDetailPageState extends State<ChannelDetailPage> 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(
Expand Down
3 changes: 1 addition & 2 deletions lib/infra/pages/channel/input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChannelInputPage> createState() => _ChannelInputPageState();
Expand Down Expand Up @@ -253,7 +253,6 @@ class _ChannelInputPageState extends State<ChannelInputPage> {
height: 66.w,
padding: EdgeInsets.symmetric(horizontal: 15.w),
decoration: BoxDecoration(
color: constTheme.centerChannelBg,
border: Border(top: BorderSide(color: constTheme.centerChannelDivider)),
),
child: Row(
Expand Down
11 changes: 4 additions & 7 deletions lib/infra/pages/main_pc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class _PCPageState extends State<PCPage> {
Widget build(BuildContext context) {
final constTheme = Theme.of(context).extension<ExtColors>()!;
return Scaffold(
backgroundColor: Colors.transparent,
body: AutoTabsRouter.pageView(
routes: mainPages,
scrollDirection: Axis.vertical,
Expand All @@ -116,19 +117,15 @@ class _PCPageState extends State<PCPage> {
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,
Expand Down
12 changes: 8 additions & 4 deletions lib/infra/pages/org/org.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ class _OrgPageState extends State<OrgPage> {
Widget build(BuildContext context) {
final constTheme = Theme.of(context).extension<ExtColors>()!;
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(
Expand All @@ -48,8 +52,8 @@ class _OrgPageState extends State<OrgPage> {
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),
Expand Down
14 changes: 10 additions & 4 deletions lib/infra/router/pop_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down Expand Up @@ -106,9 +106,15 @@ Future<T?> showModelOrPage<T>(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();
}),
),
);
},
);
Expand Down

0 comments on commit 2951444

Please sign in to comment.