fix(mining-app): 修复 ProfilePage._buildUserHeader 缺少 ref 参数导致编译失败

_buildNotificationIcon 需要 WidgetRef ref 来 watch 未读通知数,
但 _buildUserHeader 方法签名未声明该参数,导致编译错误:
"The getter 'ref' isn't defined for the type 'ProfilePage'"

修复:将 ref 从 build() 透传给 _buildUserHeader()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-02 09:05:36 -08:00
parent 2706eef54f
commit dc27fe9e44
1 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@ class ProfilePage extends ConsumerWidget {
child: Column( child: Column(
children: [ children: [
// //
_buildUserHeader(context, user), _buildUserHeader(context, user, ref),
const SizedBox(height: 16), const SizedBox(height: 16),
@ -127,7 +127,7 @@ class ProfilePage extends ConsumerWidget {
); );
} }
Widget _buildUserHeader(BuildContext context, UserState user) { Widget _buildUserHeader(BuildContext context, UserState user, WidgetRef ref) {
final avatarColor = _avatarColors[user.avatarIndex % _avatarColors.length]; final avatarColor = _avatarColors[user.avatarIndex % _avatarColors.length];
return Container( return Container(