fix:按html的假数据demo
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../theme/wise_tokens.dart';
|
||||
import '../theme/yanting_text.dart';
|
||||
import '../theme/yanting_tokens.dart';
|
||||
|
||||
class AppButton extends StatelessWidget {
|
||||
const AppButton({
|
||||
@@ -21,10 +22,26 @@ class AppButton extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = switch (kind) {
|
||||
AppButtonKind.primary => (WiseColors.secondary, WiseColors.primary),
|
||||
AppButtonKind.dark => (WiseColors.primary, Colors.white),
|
||||
AppButtonKind.accent => (WiseColors.accent, Colors.white),
|
||||
AppButtonKind.ghost => (WiseColors.surface, WiseColors.primary),
|
||||
AppButtonKind.primary => (
|
||||
YantingColors.primary,
|
||||
YantingColors.primaryForeground,
|
||||
Colors.transparent,
|
||||
),
|
||||
AppButtonKind.dark => (
|
||||
YantingColors.foreground,
|
||||
YantingColors.background,
|
||||
Colors.transparent,
|
||||
),
|
||||
AppButtonKind.accent => (
|
||||
YantingColors.brandSoft,
|
||||
YantingColors.primaryForeground,
|
||||
Colors.transparent,
|
||||
),
|
||||
AppButtonKind.ghost => (
|
||||
YantingColors.background,
|
||||
YantingColors.foreground,
|
||||
YantingColors.border,
|
||||
),
|
||||
};
|
||||
final child = FilledButton.icon(
|
||||
onPressed: onPressed,
|
||||
@@ -33,10 +50,16 @@ class AppButton extends StatelessWidget {
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: colors.$1,
|
||||
foregroundColor: colors.$2,
|
||||
disabledBackgroundColor: WiseColors.border,
|
||||
disabledForegroundColor: WiseColors.textTertiary,
|
||||
disabledBackgroundColor: YantingColors.border,
|
||||
disabledForegroundColor: YantingColors.mutedForeground,
|
||||
minimumSize: Size(expand ? double.infinity : 0, 44),
|
||||
shape: const StadiumBorder(),
|
||||
textStyle: YantingText.body.copyWith(fontWeight: FontWeight.w600),
|
||||
side: colors.$3 == Colors.transparent
|
||||
? BorderSide.none
|
||||
: BorderSide(color: colors.$3),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(YantingRadius.md),
|
||||
),
|
||||
),
|
||||
);
|
||||
return expand ? SizedBox(width: double.infinity, child: child) : child;
|
||||
|
||||
Reference in New Issue
Block a user