Skip to content

Commit befaf3a

Browse files
authored
Merge pull request #1 from BoxCatTeam/dev
[Test] 初版本未完工
2 parents d1d8827 + 9c8e84b commit befaf3a

File tree

103 files changed

+5919
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+5919
-2
lines changed

.gitignore

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
**/ios/Flutter/.last_build_id
27+
.dart_tool/
28+
.flutter-plugins
29+
.flutter-plugins-dependencies
30+
.packages
31+
.pub-cache/
32+
.pub/
33+
/build/
34+
35+
# Symbolication related
36+
app.*.symbols
37+
38+
# Obfuscation related
39+
app.*.map.json
40+
41+
# Android Studio will place build artifacts here
42+
/android/app/debug
43+
/android/app/profile
44+
/android/app/release

.metadata

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled.
5+
6+
version:
7+
revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
8+
channel: stable
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
17+
base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
18+
- platform: windows
19+
create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
20+
base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

README.md

+31-2

analysis_options.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options

assets/fonts/Cattie-Regular.ttf

44 KB
Binary file not shown.

assets/fonts/PingFang-Bold.ttf

10.4 MB
Binary file not shown.

assets/fonts/VarelaRound-Regular.ttf

123 KB
Binary file not shown.

assets/iconfont/srcat-icon.ttf

2.6 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

lib/application.dart

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/// ===========================================================================
2+
/// Copyright (c) 2020-2023, BoxCat. All rights reserved.
3+
/// Date: 2023-04-28 18:09:31
4+
/// LastEditTime: 2023-05-03 03:20:15
5+
/// FilePath: /lib/application.dart
6+
/// ===========================================================================
7+
8+
import 'package:fluent_ui/fluent_ui.dart';
9+
import 'package:go_router/go_router.dart';
10+
11+
class Application {
12+
static late GoRouter router;
13+
static late GlobalKey<NavigatorState> rootNavigatorKey;
14+
static int appNumVersion = 100001;
15+
16+
/* App NavigatorKey */
17+
static GlobalKey<NavigatorState> appNavigatorKey = GlobalKey<NavigatorState>();
18+
}

lib/components/global/card/item.dart

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/// Card
2+
/// ===========================================================================
3+
/// Copyright (c) 2020-2023, BoxCat. All rights reserved.
4+
/// Date: 2023-04-29 00:25:27
5+
/// LastEditTime: 2023-05-02 01:38:52
6+
/// FilePath: /lib/components/global/card/item.dart
7+
/// ===========================================================================
8+
9+
import 'package:fluent_ui/fluent_ui.dart';
10+
import 'package:srcat/components/global/icon/main.dart';
11+
12+
class SCItemCard extends StatefulWidget {
13+
const SCItemCard({
14+
Key? key,
15+
this.icon,
16+
required this.title,
17+
this.description,
18+
this.rightChild,
19+
this.margin,
20+
this.onTap,
21+
}) : super(key: key);
22+
23+
/// 图标
24+
final IconData? icon;
25+
26+
/// 标题
27+
final String title;
28+
29+
/// 介绍/简介
30+
final String? description;
31+
32+
/// 右侧组件
33+
final Widget? rightChild;
34+
35+
/// 外边距
36+
final EdgeInsets? margin;
37+
38+
/// 点击回调
39+
final void Function()? onTap;
40+
41+
@override
42+
State<SCItemCard> createState() => _SCItemCardState();
43+
}
44+
45+
class _SCItemCardState extends State<SCItemCard> {
46+
Widget _icon() {
47+
return SCIcon(
48+
widget.icon!,
49+
size: 20,
50+
weight: FontWeight.w600,
51+
);
52+
}
53+
54+
Widget _text() {
55+
Widget title = Text(
56+
widget.title,
57+
style: const TextStyle(
58+
fontSize: 15,
59+
),
60+
overflow: TextOverflow.ellipsis,
61+
maxLines: 1,
62+
);
63+
64+
Widget description = widget.description != null ? Text(
65+
widget.description!,
66+
style: const TextStyle(
67+
fontSize: 12,
68+
),
69+
overflow: TextOverflow.ellipsis,
70+
maxLines: 1,
71+
) : Container();
72+
73+
return Expanded(child: Column(
74+
crossAxisAlignment: CrossAxisAlignment.start,
75+
mainAxisSize: MainAxisSize.min,
76+
children: <Widget>[title, description],
77+
));
78+
}
79+
80+
@override
81+
Widget build(BuildContext context) {
82+
Widget child = Row(
83+
children: <Widget>[
84+
if (widget.icon != null) _icon(),
85+
if (widget.icon != null) const SizedBox(width: 18),
86+
_text(),
87+
if (widget.rightChild != null) widget.rightChild!
88+
],
89+
);
90+
91+
return HoverButton(
92+
onPressed: widget.onTap,
93+
cursor: SystemMouseCursors.click,
94+
builder: (context, states) {
95+
Widget ac = AnimatedContainer(
96+
duration: FluentTheme.of(context).fasterAnimationDuration,
97+
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
98+
decoration: BoxDecoration(
99+
color: ButtonThemeData.uncheckedInputColor(
100+
FluentTheme.of(context),
101+
states,
102+
transparentWhenNone: true,
103+
),
104+
borderRadius: BorderRadius.circular(4.0),
105+
),
106+
child: child,
107+
);
108+
109+
return FocusBorder(
110+
focused: states.isFocused,
111+
renderOutside: false,
112+
child: RepaintBoundary(
113+
child: Card(
114+
padding: EdgeInsets.zero,
115+
child: ac
116+
)
117+
)
118+
);
119+
},
120+
);
121+
}
122+
}

lib/components/global/icon/main.dart

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/// 自定义图标组件
2+
/// ===========================================================================
3+
/// Copyright (c) 2020-2023, BoxCat. All rights reserved.
4+
/// Date: 2023-04-28 22:28:11
5+
/// LastEditTime: 2023-04-29 01:41:26
6+
/// FilePath: /lib/components/global/icon/main.dart
7+
/// ===========================================================================
8+
9+
import 'package:fluent_ui/fluent_ui.dart';
10+
11+
class SCIcon extends StatefulWidget {
12+
const SCIcon(this.icon, {
13+
Key? key,
14+
this.size,
15+
this.color,
16+
this.weight,
17+
}) : super(key: key);
18+
19+
/// 图标
20+
final IconData icon;
21+
22+
/// 图标大小
23+
final double? size;
24+
25+
/// 图标颜色
26+
final Color? color;
27+
28+
/// 图标粗细
29+
final FontWeight? weight;
30+
31+
@override
32+
State<SCIcon> createState() => _SCIconState();
33+
}
34+
35+
class _SCIconState extends State<SCIcon> {
36+
@override
37+
Widget build(BuildContext context) {
38+
return Text(
39+
String.fromCharCode(widget.icon.codePoint),
40+
style: TextStyle(
41+
fontSize: widget.size ?? 19,
42+
fontWeight: widget.weight ?? FontWeight.w500,
43+
fontFamily: widget.icon.fontFamily,
44+
package: widget.icon.fontPackage,
45+
color: widget.color
46+
)
47+
);
48+
}
49+
}
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/// 普通的滚动容器
2+
/// ===========================================================================
3+
/// Copyright (c) 2020-2023, BoxCat. All rights reserved.
4+
/// Date: 2023-04-28 23:46:19
5+
/// LastEditTime: 2023-05-02 19:37:08
6+
/// FilePath: /lib/components/global/scroll/normal.dart
7+
/// ===========================================================================
8+
9+
import 'package:fluent_ui/fluent_ui.dart';
10+
11+
class SCNormalScroll extends StatefulWidget {
12+
const SCNormalScroll({
13+
Key? key,
14+
required this.child,
15+
this.physics,
16+
this.controller,
17+
this.defaultPhysics = true,
18+
this.hiddenBar = false,
19+
}) : super(key: key);
20+
21+
/// 子容器
22+
final Widget child;
23+
24+
/// 滚动效果
25+
final ScrollPhysics? physics;
26+
27+
/// 滑动控制器
28+
final ScrollController? controller;
29+
30+
/// 是否使用默认的滚动效果
31+
final bool defaultPhysics;
32+
33+
/// 是否隐藏滚动条
34+
final bool hiddenBar;
35+
36+
@override
37+
State<SCNormalScroll> createState() => _SCNormalScrollState();
38+
}
39+
40+
class _SCNormalScrollState extends State<SCNormalScroll> {
41+
final defaultScrollController = ScrollController();
42+
43+
@override
44+
Widget build(BuildContext context) {
45+
Widget scroll = SingleChildScrollView(
46+
key: widget.key,
47+
controller: widget.controller ?? defaultScrollController,
48+
physics: widget.physics ??
49+
(widget.defaultPhysics == true
50+
? const BouncingScrollPhysics(
51+
parent: AlwaysScrollableScrollPhysics())
52+
: null),
53+
child: widget.child,
54+
);
55+
56+
return widget.hiddenBar ? ScrollConfiguration(
57+
behavior: ScrollConfiguration.of(context).copyWith(scrollbars: false),
58+
child: scroll
59+
) : scroll;
60+
}
61+
}

0 commit comments

Comments
 (0)