refactor: 重构弹窗组件支持自定义图标组件
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class GuaIcon extends StatelessWidget {
|
||||
const GuaIcon({super.key, this.color, this.size = 20});
|
||||
|
||||
final Color? color;
|
||||
final double size;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final effectiveColor =
|
||||
color ?? Theme.of(context).colorScheme.onPrimaryContainer;
|
||||
return Text(
|
||||
'爻',
|
||||
style: TextStyle(
|
||||
fontSize: size * 0.85,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: effectiveColor,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user