feat:更新主题色有些失效的场景
This commit is contained in:
@@ -34,6 +34,8 @@ void buildModalBottom({
|
||||
required String title,
|
||||
required Widget body,
|
||||
}) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
@@ -52,7 +54,11 @@ void buildModalBottom({
|
||||
builder: (_, controller) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: colors.surface,
|
||||
border: Border.all(
|
||||
color: colors.outline.withAlpha(50),
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(24),
|
||||
topRight: Radius.circular(24),
|
||||
@@ -69,6 +75,25 @@ void buildModalBottom({
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildModalBottomTitle(BuildContext context, String title) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildModalBottomBody(BuildContext context, String title, Widget body) {
|
||||
return Column(
|
||||
children: [
|
||||
@@ -82,23 +107,8 @@ Widget buildModalBottomBody(BuildContext context, String title, Widget body) {
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
),
|
||||
|
||||
// 标题栏
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w700),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
buildModalBottomTitle(context, title),
|
||||
Divider(height: 1, thickness: 1),
|
||||
|
||||
Expanded(child: Padding(padding: EdgeInsets.all(12), child: body)),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user