generated from dellevin/template
优化主界面显示
This commit is contained in:
@@ -277,16 +277,19 @@ class _BookFormPageState extends State<BookFormPage> {
|
||||
Row(children: [
|
||||
Text('状态', style: TextStyle(fontSize: 12, color: colors.onSurface.withValues(alpha: 0.4))),
|
||||
const SizedBox(width: 12),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(color: colors.surfaceContainerHighest, borderRadius: BorderRadius.circular(6)),
|
||||
child: Row(mainAxisSize: MainAxisSize.min, children: [
|
||||
_buildStatusOption('想读', 'want_to_read'),
|
||||
_buildStatusOption('在读', 'reading'),
|
||||
_buildStatusOption('已读', 'read'),
|
||||
_buildStatusOption('弃读', 'abandoned'),
|
||||
]),
|
||||
),
|
||||
Expanded(child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(color: colors.surfaceContainerHighest, borderRadius: BorderRadius.circular(6)),
|
||||
child: Row(mainAxisSize: MainAxisSize.min, children: [
|
||||
_buildStatusOption('想读', 'want_to_read'),
|
||||
_buildStatusOption('在读', 'reading'),
|
||||
_buildStatusOption('已读', 'read'),
|
||||
_buildStatusOption('弃读', 'abandoned'),
|
||||
]),
|
||||
),
|
||||
)),
|
||||
]),
|
||||
const SizedBox(height: 12),
|
||||
// 评分
|
||||
|
||||
@@ -213,6 +213,8 @@ class _NoteFormPageState extends State<NoteFormPage> {
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
padding: const EdgeInsets.only(left: 12, right: 4),
|
||||
constraints: const BoxConstraints(),
|
||||
onPressed: () async {
|
||||
final shouldPop = await _confirmLeave();
|
||||
if (shouldPop && context.mounted) Navigator.pop(context);
|
||||
@@ -282,11 +284,11 @@ class _NoteFormPageState extends State<NoteFormPage> {
|
||||
Widget _buildFloatingToolbar() {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
return Container(
|
||||
margin: const EdgeInsets.fromLTRB(12, 8, 12, 10),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||
margin: const EdgeInsets.fromLTRB(12, 4, 12, 6),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: colors.surfaceContainerHigh,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: colors.outlineVariant, width: 0.5),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
@@ -321,14 +323,6 @@ class _NoteFormPageState extends State<NoteFormPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
// 视图模式切换
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
width: 1, height: 20, color: colors.outline,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
_modeSwitch(Icons.edit, 'edit'),
|
||||
_modeSwitch(Icons.visibility, 'preview'),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -344,8 +338,8 @@ class _NoteFormPageState extends State<NoteFormPage> {
|
||||
child: Tooltip(
|
||||
message: tooltip,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 6),
|
||||
child: Icon(icon, size: 21, color: colors.onSurface.withValues(alpha: 0.7)),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 3),
|
||||
child: Icon(icon, size: 18, color: colors.onSurface.withValues(alpha: 0.7)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -355,9 +349,9 @@ class _NoteFormPageState extends State<NoteFormPage> {
|
||||
Widget _toolGap() {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: SizedBox(
|
||||
height: 18,
|
||||
height: 14,
|
||||
child: VerticalDivider(width: 0, thickness: 0.5, color: colors.outline),
|
||||
),
|
||||
);
|
||||
@@ -474,6 +468,7 @@ class _NoteFormPageState extends State<NoteFormPage> {
|
||||
height: 1.6,
|
||||
),
|
||||
border: InputBorder.none,
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
contentPadding: const EdgeInsets.all(16),
|
||||
),
|
||||
@@ -641,6 +636,7 @@ class _NoteFormPageState extends State<NoteFormPage> {
|
||||
hintText: '添加标题',
|
||||
hintStyle: TextStyle(fontSize: 15, fontWeight: FontWeight.w700, color: colors.onSurface.withValues(alpha: 0.2)),
|
||||
border: InputBorder.none,
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 8),
|
||||
isDense: true,
|
||||
|
||||
@@ -75,6 +75,8 @@ class _ProfilePageState extends State<ProfilePage> with RouteAware {
|
||||
return Column(
|
||||
children: [
|
||||
AppBar(
|
||||
titleSpacing: 8,
|
||||
leadingWidth: 44,
|
||||
leading: Builder(
|
||||
builder: (context) => IconButton(
|
||||
icon: Icon(Icons.menu, color: colors.onSurface),
|
||||
|
||||
@@ -106,32 +106,32 @@ void showAddSheet(BuildContext context, AppProvider provider) {
|
||||
final bc = Theme.of(ctx).colorScheme;
|
||||
return SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
width: 40,
|
||||
height: 4,
|
||||
width: 32,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
color: bc.onSurface.withValues(alpha: 0.15),
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const SizedBox(height: 12),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('新增记录',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: bc.onSurface)),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
...options,
|
||||
],
|
||||
),
|
||||
@@ -151,38 +151,38 @@ Widget _buildOption({
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 14),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 44,
|
||||
height: 44,
|
||||
width: 36,
|
||||
height: 36,
|
||||
decoration: BoxDecoration(
|
||||
color: colors.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(icon, size: 22, color: colors.onSurface.withValues(alpha: 0.6)),
|
||||
child: Icon(icon, size: 18, color: colors.onSurface.withValues(alpha: 0.6)),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(title,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: colors.onSurface)),
|
||||
const SizedBox(height: 2),
|
||||
const SizedBox(height: 1),
|
||||
Text(subtitle,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontSize: 12,
|
||||
color: colors.onSurface.withValues(alpha: 0.4))),
|
||||
],
|
||||
),
|
||||
),
|
||||
Icon(Icons.chevron_right,
|
||||
color: colors.onSurface.withValues(alpha: 0.25), size: 20),
|
||||
color: colors.onSurface.withValues(alpha: 0.25), size: 18),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user