关怀模式
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../utils/responsive_layout.dart';
|
||||
import '../constants/app_constants.dart';
|
||||
import '../services/get/theme_controller.dart';
|
||||
|
||||
class ResponsiveButton extends StatelessWidget {
|
||||
final String text;
|
||||
@@ -25,6 +27,8 @@ class ResponsiveButton extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final buttonSize = size ?? (ResponsiveLayout.isMobile(context) ? ButtonSize.small : ButtonSize.medium);
|
||||
final themeController = Get.find<ThemeController>();
|
||||
final primaryColor = themeController.currentThemeColor;
|
||||
|
||||
return SizedBox(
|
||||
width: ResponsiveLayout.isMobile(context) ? double.infinity : null,
|
||||
@@ -32,7 +36,7 @@ class ResponsiveButton extends StatelessWidget {
|
||||
child: ElevatedButton(
|
||||
onPressed: isLoading ? null : onPressed,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: backgroundColor ?? AppConstants.primaryColor,
|
||||
backgroundColor: backgroundColor ?? primaryColor,
|
||||
foregroundColor: textColor ?? Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(_getBorderRadius(buttonSize)),
|
||||
|
||||
Reference in New Issue
Block a user