mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: 无障碍语义适配
This commit is contained in:
@@ -220,41 +220,46 @@ class UserInfoWidget extends StatelessWidget {
|
||||
const SizedBox(width: 4),
|
||||
ClipRect(
|
||||
child: IconButton(
|
||||
tooltip: '消息',
|
||||
onPressed: () => Get.toNamed('/whisper'),
|
||||
icon: const Icon(Icons.notifications_none),
|
||||
icon: const Icon(
|
||||
Icons.notifications_none,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(width: 8),
|
||||
Obx(
|
||||
() => userLogin.value
|
||||
? Stack(
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
type: 'avatar',
|
||||
width: 34,
|
||||
height: 34,
|
||||
src: userFace,
|
||||
),
|
||||
Positioned.fill(
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => callback?.call(),
|
||||
splashColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.primaryContainer
|
||||
.withOpacity(0.3),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(50),
|
||||
),
|
||||
Semantics(
|
||||
label: "我的",
|
||||
child: Obx(
|
||||
() => userLogin.value
|
||||
? Stack(
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
type: 'avatar',
|
||||
width: 34,
|
||||
height: 34,
|
||||
src: userFace,
|
||||
),
|
||||
),
|
||||
Positioned.fill(
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => callback?.call(),
|
||||
splashColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.primaryContainer
|
||||
.withOpacity(0.3),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(50),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
: DefaultUser(callback: () => callback!()),
|
||||
),
|
||||
: DefaultUser(callback: () => callback!()),
|
||||
)),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -270,6 +275,7 @@ class DefaultUser extends StatelessWidget {
|
||||
width: 38,
|
||||
height: 38,
|
||||
child: IconButton(
|
||||
tooltip: '默认用户头像',
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor: MaterialStateProperty.resolveWith((states) {
|
||||
@@ -409,6 +415,7 @@ class SearchBar extends StatelessWidget {
|
||||
Icon(
|
||||
Icons.search_outlined,
|
||||
color: colorScheme.onSecondaryContainer,
|
||||
semanticLabel: '搜索',
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
|
||||
@@ -43,6 +43,7 @@ class HomeAppBar extends StatelessWidget {
|
||||
Hero(
|
||||
tag: 'searchTag',
|
||||
child: IconButton(
|
||||
tooltip: '搜索',
|
||||
onPressed: () {
|
||||
Get.toNamed('/search');
|
||||
},
|
||||
@@ -72,11 +73,13 @@ class HomeAppBar extends StatelessWidget {
|
||||
width: 32,
|
||||
height: 32,
|
||||
src: userInfo.face,
|
||||
semanticsLabel: '我的',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
] else ...[
|
||||
IconButton(
|
||||
tooltip: '登录',
|
||||
onPressed: () => showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (_) => const SizedBox(
|
||||
|
||||
Reference in New Issue
Block a user