import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:remixicon/remixicon.dart'; import 'widget/avatar_name.dart'; import 'widget/profile_section.dart'; class MyPage extends StatefulWidget { final GlobalKey scaffoldKey; const MyPage({super.key, required this.scaffoldKey}); @override State createState() => _MyPageState(); } class _MyPageState extends State { @override Widget build(BuildContext context) { return CupertinoPageScaffold( backgroundColor: Colors.white, navigationBar: CupertinoNavigationBar( middle: Text("个人资料"), leading: IconButton( onPressed: () { widget.scaffoldKey.currentState?.closeDrawer(); }, icon: Icon(RemixIcons.close_circle_line, size: 25), ), ), child: SafeArea( child: ListView( padding: EdgeInsets.symmetric(horizontal: 30, vertical: 20), children: [ AvatarName(), ProfileSection(), ], ), ), ); } }