fix(ui): 修正六屏顶栏与内容间距
This commit is contained in:
1 parent
e03ea76505
commit
2fd92cdbea
11 files changed
+281
-66
No files matched your search
@@ -185,6 +185,7 @@ class _MyPageState extends State<MyPage> {
|
||||
),
|
||||
const Spacer(),
|
||||
_RoundHeaderButton(
|
||||
key: const Key('mine-search-button'),
|
||||
tooltip: l10n.search,
|
||||
icon: Icons.search_rounded,
|
||||
onTap: () => logic.act(
|
||||
@@ -194,10 +195,11 @@ class _MyPageState extends State<MyPage> {
|
||||
onAction: widget.onAction,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 7),
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
width: 28,
|
||||
height: 28,
|
||||
key: const Key('mine-avatar'),
|
||||
width: 36,
|
||||
height: 36,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
gradient: LinearGradient(
|
||||
@@ -209,7 +211,7 @@ class _MyPageState extends State<MyPage> {
|
||||
child: const Icon(
|
||||
Icons.person_rounded,
|
||||
color: AppColors.onSurface,
|
||||
size: 15,
|
||||
size: 18,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -455,37 +457,59 @@ class _MyPageState extends State<MyPage> {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
for (var index = 0; index < tabs.length; index++)
|
||||
Expanded(
|
||||
child: Semantics(
|
||||
selected: logic.section == index,
|
||||
button: true,
|
||||
child: InkWell(
|
||||
key: Key('mine-library-tab-$index'),
|
||||
onTap: () => logic.selectSection(index),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4),
|
||||
child: Text(
|
||||
tabs[index],
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: logic.section == index
|
||||
? AppColors.blue
|
||||
: const Color(0xFFE4DBDD),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w800,
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
children: [
|
||||
for (var index = 0; index < tabs.length; index++)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: index == tabs.length - 1 ? 0 : 20,
|
||||
),
|
||||
child: Semantics(
|
||||
selected: logic.section == index,
|
||||
button: true,
|
||||
child: InkWell(
|
||||
key: Key('mine-library-tab-$index'),
|
||||
onTap: () => logic.selectSection(index),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 6),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
tabs[index],
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
color: logic.section == index
|
||||
? AppColors.blue
|
||||
: const Color(0xFFE4DBDD),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 160),
|
||||
width: 18,
|
||||
height: 2,
|
||||
decoration: BoxDecoration(
|
||||
color: logic.section == index
|
||||
? AppColors.blue
|
||||
: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(1),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const SizedBox(height: 12),
|
||||
if (logic.section == 1 && context.watch<FavoriteController>().loading)
|
||||
const Center(
|
||||
child: Padding(
|
||||
@@ -935,6 +959,7 @@ class _MyPageState extends State<MyPage> {
|
||||
|
||||
class _RoundHeaderButton extends StatelessWidget {
|
||||
const _RoundHeaderButton({
|
||||
super.key,
|
||||
required this.tooltip,
|
||||
required this.icon,
|
||||
required this.onTap,
|
||||
@@ -947,8 +972,8 @@ class _RoundHeaderButton extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: 28,
|
||||
height: 28,
|
||||
width: 36,
|
||||
height: 36,
|
||||
child: IconButton(
|
||||
tooltip: tooltip,
|
||||
onPressed: onTap,
|
||||
@@ -957,7 +982,7 @@ class _RoundHeaderButton extends StatelessWidget {
|
||||
backgroundColor: const Color(0xFF2C2D33),
|
||||
foregroundColor: AppColors.onSurface,
|
||||
),
|
||||
icon: Icon(icon, size: 14),
|
||||
icon: Icon(icon, size: 18),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user