feat: adopt material 3 theme and billing adjustments
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../theme/app_colors.dart';
|
||||
import '../../../theme/color_scheme_ext.dart';
|
||||
|
||||
/// 앱 전체에서 사용되는 통합 스낵바
|
||||
/// 성공, 에러, 정보 등 다양한 타입의 메시지를 표시합니다.
|
||||
@@ -16,9 +16,9 @@ class AppSnackBar {
|
||||
context: context,
|
||||
message: message,
|
||||
icon: icon,
|
||||
backgroundColor: AppColors.successColor,
|
||||
iconColor: AppColors.pureWhite,
|
||||
textColor: AppColors.pureWhite,
|
||||
backgroundColor: Theme.of(context).colorScheme.success,
|
||||
iconColor: Theme.of(context).colorScheme.onPrimary,
|
||||
textColor: Theme.of(context).colorScheme.onPrimary,
|
||||
duration: duration,
|
||||
showAtTop: showAtTop,
|
||||
);
|
||||
@@ -32,13 +32,14 @@ class AppSnackBar {
|
||||
Duration duration = const Duration(seconds: 4),
|
||||
bool showAtTop = true,
|
||||
}) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
_show(
|
||||
context: context,
|
||||
message: message,
|
||||
icon: icon,
|
||||
backgroundColor: AppColors.dangerColor,
|
||||
iconColor: AppColors.pureWhite,
|
||||
textColor: AppColors.pureWhite,
|
||||
backgroundColor: cs.error,
|
||||
iconColor: Theme.of(context).colorScheme.onPrimary,
|
||||
textColor: Theme.of(context).colorScheme.onPrimary,
|
||||
duration: duration,
|
||||
showAtTop: showAtTop,
|
||||
);
|
||||
@@ -56,9 +57,9 @@ class AppSnackBar {
|
||||
context: context,
|
||||
message: message,
|
||||
icon: icon,
|
||||
backgroundColor: AppColors.primaryColor,
|
||||
iconColor: AppColors.pureWhite,
|
||||
textColor: AppColors.pureWhite,
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
iconColor: Theme.of(context).colorScheme.onPrimary,
|
||||
textColor: Theme.of(context).colorScheme.onPrimary,
|
||||
duration: duration,
|
||||
showAtTop: showAtTop,
|
||||
);
|
||||
@@ -76,9 +77,9 @@ class AppSnackBar {
|
||||
context: context,
|
||||
message: message,
|
||||
icon: icon,
|
||||
backgroundColor: AppColors.warningColor,
|
||||
iconColor: AppColors.pureWhite,
|
||||
textColor: AppColors.pureWhite,
|
||||
backgroundColor: Theme.of(context).colorScheme.warning,
|
||||
iconColor: Theme.of(context).colorScheme.onPrimary,
|
||||
textColor: Theme.of(context).colorScheme.onPrimary,
|
||||
duration: duration,
|
||||
showAtTop: showAtTop,
|
||||
);
|
||||
@@ -90,8 +91,8 @@ class AppSnackBar {
|
||||
required String message,
|
||||
required IconData icon,
|
||||
required Color backgroundColor,
|
||||
Color iconColor = AppColors.pureWhite,
|
||||
Color textColor = AppColors.pureWhite,
|
||||
Color iconColor = Colors.white,
|
||||
Color textColor = Colors.white,
|
||||
Duration duration = const Duration(seconds: 3),
|
||||
bool showAtTop = true,
|
||||
SnackBarAction? action,
|
||||
@@ -200,25 +201,25 @@ class AppSnackBar {
|
||||
width: 24,
|
||||
height: 24,
|
||||
margin: const EdgeInsets.only(right: 12),
|
||||
child: const CircularProgressIndicator(
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2.5,
|
||||
color: AppColors.pureWhite,
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
),
|
||||
),
|
||||
// 메시지
|
||||
Expanded(
|
||||
child: Text(
|
||||
message,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.pureWhite,
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
backgroundColor: AppColors.primaryColor,
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
margin: showAtTop
|
||||
? EdgeInsets.only(
|
||||
@@ -249,7 +250,7 @@ class AppSnackBar {
|
||||
required String actionLabel,
|
||||
required VoidCallback onActionPressed,
|
||||
IconData icon = Icons.info_rounded,
|
||||
Color backgroundColor = AppColors.primaryColor,
|
||||
Color? backgroundColor,
|
||||
Duration duration = const Duration(seconds: 4),
|
||||
bool showAtTop = true,
|
||||
}) {
|
||||
@@ -257,14 +258,14 @@ class AppSnackBar {
|
||||
context: context,
|
||||
message: message,
|
||||
icon: icon,
|
||||
backgroundColor: backgroundColor,
|
||||
iconColor: AppColors.pureWhite,
|
||||
textColor: AppColors.pureWhite,
|
||||
backgroundColor: backgroundColor ?? Theme.of(context).colorScheme.primary,
|
||||
iconColor: Theme.of(context).colorScheme.onPrimary,
|
||||
textColor: Theme.of(context).colorScheme.onPrimary,
|
||||
duration: duration,
|
||||
showAtTop: showAtTop,
|
||||
action: SnackBarAction(
|
||||
label: actionLabel,
|
||||
textColor: AppColors.pureWhite,
|
||||
textColor: Theme.of(context).colorScheme.onPrimary,
|
||||
onPressed: onActionPressed,
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user