我如何从showModalBottomSheet
后面go 掉这个平坦的边缘,这样我就可以拥有完全圆形和漂亮的边框了.
窗口小部件:
class Profile extends StatefulWidget {
const Profile({super.key});
@override
State<Profile> createState() => _ProfileState();
}
class _ProfileState extends State<Profile> {
showBottomSheet(BuildContext context) {
showModalBottomSheet(
context: context,
builder: (context) {
return Container(
decoration: BoxDecoration(
color: Color.fromRGBO(0, 0, 0, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
height: 36,
),
ListTile(
leading: Icon(Icons.settings),
title: Text('Settings'),
),
ListTile(
leading: Icon(Icons.bookmark_border),
title: Text('Saved'),
)
],
),
);
},
);
}
@override
Widget build(BuildContext context) {
model.User? user = Provider.of<UserProvider>(context).getuser; // get the current SignedIn user
return Scaffold(
backgroundColor: Color.fromRGBO(0, 0, 0, 1),
appBar: AppBar(
title: Text('${user!.username}'), // Display the username of user
backgroundColor: Color.fromRGBO(0, 0, 0, 1),
actions: [
IconButton(
onPressed: () => showBottomSheet(context),
icon: Icon(Icons.menu),
),
],
),
);
}
}
我try 了所有可用的解决方案 但它们都没有奏效.我不能理解这件事.