feat:更新菜谱表单
This commit is contained in:
@@ -92,13 +92,50 @@ Widget buildTag(BuildContext context, String title) {
|
||||
);
|
||||
}
|
||||
|
||||
/// 确认按钮样式
|
||||
ButtonStyle primaryButtonStyle() {
|
||||
return ButtonStyle(
|
||||
backgroundColor: WidgetStateProperty.all(Colors.green),
|
||||
shape: WidgetStateProperty.all(
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
Widget buildPrimaryButton({
|
||||
required BuildContext context,
|
||||
required String text,
|
||||
required VoidCallback onPressed,
|
||||
}) {
|
||||
return ElevatedButton(
|
||||
onPressed: () => onPressed(),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
elevation: 0,
|
||||
),
|
||||
child: Text(text, style: TextStyle(color: Colors.white)),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildErrorButton({
|
||||
required String text,
|
||||
required VoidCallback onPressed,
|
||||
}) {
|
||||
return ElevatedButton(
|
||||
onPressed: () => onPressed(),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
elevation: 0,
|
||||
),
|
||||
child: Text(text, style: TextStyle(color: Colors.white)),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildInfoButton({
|
||||
required BuildContext context,
|
||||
required String text,
|
||||
required VoidCallback onPressed,
|
||||
}) {
|
||||
return ElevatedButton(
|
||||
onPressed: () => onPressed(),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
elevation: 0,
|
||||
),
|
||||
child: Text(text, style: TextStyle(color: Colors.white)),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user