211 lines
5.6 KiB
Dart
211 lines
5.6 KiB
Dart
import 'dart:ui';
|
||
|
||
import 'package:flutter/material.dart';
|
||
import 'package:google_fonts/google_fonts.dart';
|
||
|
||
import '../design/pencil_theme.dart';
|
||
|
||
/// bi8Au 玻璃方钮 35×35 / blur 半径约 20。
|
||
class PencilGlassSquareButton extends StatelessWidget {
|
||
const PencilGlassSquareButton({
|
||
super.key,
|
||
required this.child,
|
||
required this.onTap,
|
||
this.size = 35,
|
||
this.borderRadius = 8,
|
||
});
|
||
|
||
final Widget child;
|
||
final VoidCallback onTap;
|
||
final double size;
|
||
final double borderRadius;
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return ClipRRect(
|
||
borderRadius: BorderRadius.circular(borderRadius),
|
||
child: BackdropFilter(
|
||
filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
|
||
child: Material(
|
||
color: PencilTheme.homeGlassFill,
|
||
child: InkWell(
|
||
onTap: onTap,
|
||
child: SizedBox(
|
||
width: size,
|
||
height: size,
|
||
child: Center(child: child),
|
||
),
|
||
),
|
||
),
|
||
),
|
||
);
|
||
}
|
||
}
|
||
|
||
/// bi8Au 积分胶囊:竖向 padding 由外层控制,横向 padding 约 14。
|
||
class PencilGlassCreditsPill extends StatelessWidget {
|
||
const PencilGlassCreditsPill({
|
||
super.key,
|
||
required this.amountText,
|
||
this.onTap,
|
||
});
|
||
|
||
final String amountText;
|
||
final VoidCallback? onTap;
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
final row = Row(
|
||
mainAxisSize: MainAxisSize.min,
|
||
children: [
|
||
const Icon(Icons.diamond_rounded,
|
||
size: 18, color: PencilTheme.gemYellow),
|
||
const SizedBox(width: 8),
|
||
Text(
|
||
amountText,
|
||
style: GoogleFonts.inter(
|
||
fontSize: 15,
|
||
fontWeight: FontWeight.w600,
|
||
color: PencilTheme.homeTextPrimary,
|
||
shadows: PencilTheme.homeCreditsTextShadows,
|
||
),
|
||
),
|
||
],
|
||
);
|
||
return ClipRRect(
|
||
borderRadius: BorderRadius.circular(8),
|
||
child: BackdropFilter(
|
||
filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
|
||
child: onTap != null
|
||
? Material(
|
||
color: PencilTheme.homeGlassFill,
|
||
child: InkWell(
|
||
onTap: onTap,
|
||
child: Container(
|
||
padding: const EdgeInsets.symmetric(horizontal: 14),
|
||
height: 35,
|
||
alignment: Alignment.centerLeft,
|
||
child: row,
|
||
),
|
||
),
|
||
)
|
||
: Container(
|
||
padding: const EdgeInsets.symmetric(horizontal: 14),
|
||
color: PencilTheme.homeGlassFill,
|
||
height: 35,
|
||
child: row,
|
||
),
|
||
),
|
||
);
|
||
}
|
||
}
|
||
|
||
/// bi8Au Create Now:与 `desgin/funymee_home.pen` [aHMps] 一致 — 金渐变、白描边、投影。
|
||
class PencilCreateNowButton extends StatelessWidget {
|
||
const PencilCreateNowButton({super.key, required this.onPressed});
|
||
|
||
final VoidCallback onPressed;
|
||
|
||
static const double _w = 212;
|
||
static const double _h = 50;
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return Material(
|
||
color: Colors.transparent,
|
||
child: InkWell(
|
||
onTap: onPressed,
|
||
borderRadius: BorderRadius.circular(999),
|
||
child: Ink(
|
||
decoration: BoxDecoration(
|
||
borderRadius: BorderRadius.circular(999),
|
||
gradient: const LinearGradient(
|
||
begin: Alignment.topCenter,
|
||
end: Alignment.bottomCenter,
|
||
colors: [
|
||
Color(0xFFFFFDE7),
|
||
Color(0xFFFDE047),
|
||
Color(0xFFF59E0B),
|
||
],
|
||
stops: [0.0, 0.42, 1.0],
|
||
),
|
||
border: Border.all(
|
||
color: Color(0xD9FFFFFF),
|
||
width: 2,
|
||
),
|
||
boxShadow: const [
|
||
BoxShadow(
|
||
color: Color(0x52B45309),
|
||
offset: Offset(0, 10),
|
||
blurRadius: 28,
|
||
),
|
||
],
|
||
),
|
||
child: SizedBox(
|
||
width: _w,
|
||
height: _h,
|
||
child: Center(
|
||
child: Text(
|
||
'Create Now',
|
||
style: GoogleFonts.inter(
|
||
fontSize: 18,
|
||
fontWeight: FontWeight.w800,
|
||
color: PencilTheme.stone900,
|
||
letterSpacing: 0.4,
|
||
),
|
||
),
|
||
),
|
||
),
|
||
),
|
||
),
|
||
);
|
||
}
|
||
}
|
||
|
||
/// EYsUi / WBRp4 返回钮(无底色、无描边)。
|
||
class PencilRoundBackButton extends StatelessWidget {
|
||
const PencilRoundBackButton({super.key, required this.onPressed});
|
||
|
||
final VoidCallback onPressed;
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return Material(
|
||
color: Colors.transparent,
|
||
child: InkWell(
|
||
onTap: onPressed,
|
||
borderRadius: BorderRadius.circular(14),
|
||
child: const SizedBox(
|
||
width: 44,
|
||
height: 44,
|
||
child: Icon(Icons.chevron_left_rounded,
|
||
size: 26, color: Color(0xFF374151)),
|
||
),
|
||
),
|
||
);
|
||
}
|
||
}
|
||
|
||
/// 5J8Po 关闭钮(无底色、无描边)。
|
||
class PencilRoundCloseButton extends StatelessWidget {
|
||
const PencilRoundCloseButton({super.key, required this.onPressed});
|
||
|
||
final VoidCallback onPressed;
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return Material(
|
||
color: Colors.transparent,
|
||
child: InkWell(
|
||
onTap: onPressed,
|
||
borderRadius: BorderRadius.circular(14),
|
||
child: const SizedBox(
|
||
width: 44,
|
||
height: 44,
|
||
child: Icon(Icons.close_rounded, size: 24, color: Color(0xFF374151)),
|
||
),
|
||
),
|
||
);
|
||
}
|
||
}
|