99ceaa87bb
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
60 lines
2.0 KiB
Dart
60 lines
2.0 KiB
Dart
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
|
import 'package:flutter/material.dart';
|
|
import '../core/theme/context_tokens.dart';
|
|
|
|
/// 顶栏通知铃(原型 .icon-btn + #i-bell)。通知中心为二期,暂点开「暂无通知」面板。
|
|
class NotificationBell extends StatelessWidget {
|
|
const NotificationBell({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final t = context.tokens;
|
|
return PopupMenuButton<void>(
|
|
tooltip: '通知',
|
|
// under 已定位在按钮正下方,只留小间隙贴着顶栏(大偏移在手机顶栏
|
|
// 加 safe-area inset 后会悬空漂进内容区——2026-07-04 用户反馈)
|
|
offset: const Offset(0, 8),
|
|
position: PopupMenuPosition.under,
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
|
color: t.surface,
|
|
elevation: 8,
|
|
itemBuilder: (_) => [
|
|
PopupMenuItem<void>(
|
|
enabled: false,
|
|
child: SizedBox(
|
|
width: 200,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text('通知',
|
|
style: TextStyle(
|
|
fontSize: 13,
|
|
fontWeight: FontWeight.w600,
|
|
color: t.heading)),
|
|
const SizedBox(height: 10),
|
|
Row(
|
|
children: [
|
|
Icon(LucideIcons.bellOff, size: 16, color: t.faint),
|
|
const SizedBox(width: 8),
|
|
Text('暂无通知',
|
|
style: TextStyle(fontSize: 13, color: t.muted)),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
child: Container(
|
|
width: 34,
|
|
height: 34,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
alignment: Alignment.center,
|
|
child: Icon(LucideIcons.bell, size: 19, color: t.topFg),
|
|
),
|
|
);
|
|
}
|
|
}
|