183 lines
4.9 KiB
Dart
183 lines
4.9 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,
|
||
});
|
||
|
||
final String amountText;
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return ClipRRect(
|
||
borderRadius: BorderRadius.circular(8),
|
||
child: BackdropFilter(
|
||
filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
|
||
child: Container(
|
||
padding: const EdgeInsets.symmetric(horizontal: 14),
|
||
color: PencilTheme.homeGlassFill,
|
||
height: 35,
|
||
child: 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,
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
),
|
||
);
|
||
}
|
||
}
|
||
|
||
/// bi8Au Create Now:宽 186 高 40,pill blur 28。
|
||
class PencilCreateNowButton extends StatelessWidget {
|
||
const PencilCreateNowButton({super.key, required this.onPressed});
|
||
|
||
final VoidCallback onPressed;
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return ClipRRect(
|
||
borderRadius: BorderRadius.circular(999),
|
||
child: BackdropFilter(
|
||
filter: ImageFilter.blur(sigmaX: 28, sigmaY: 28),
|
||
child: Material(
|
||
color: PencilTheme.createPillFill,
|
||
child: InkWell(
|
||
onTap: onPressed,
|
||
child: SizedBox(
|
||
width: 186,
|
||
height: 40,
|
||
child: Row(
|
||
mainAxisAlignment: MainAxisAlignment.center,
|
||
children: [
|
||
Container(
|
||
width: 25,
|
||
height: 25,
|
||
decoration: const BoxDecoration(
|
||
color: PencilTheme.createPlusDisc,
|
||
shape: BoxShape.circle,
|
||
),
|
||
child: const Icon(Icons.add, size: 14, color: Colors.black),
|
||
),
|
||
const SizedBox(width: 14),
|
||
Text(
|
||
'Create Now',
|
||
style: GoogleFonts.inter(
|
||
fontSize: 18,
|
||
fontWeight: FontWeight.w700,
|
||
color: PencilTheme.homeTextPrimary,
|
||
letterSpacing: 0.3,
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
),
|
||
),
|
||
),
|
||
);
|
||
}
|
||
}
|
||
|
||
/// 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)),
|
||
),
|
||
),
|
||
);
|
||
}
|
||
}
|