120 lines
3.4 KiB
Dart
120 lines
3.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../../core/theme/app_colors.dart';
|
|
|
|
/// Tloto brand mark (SVG/PNG asset) with optional wordmark.
|
|
class PrediqoLogo extends StatelessWidget {
|
|
const PrediqoLogo({
|
|
super.key,
|
|
this.size = 48,
|
|
this.showWordmark = true,
|
|
this.wordmarkStyle,
|
|
this.gap = 12,
|
|
});
|
|
|
|
final double size;
|
|
final bool showWordmark;
|
|
final TextStyle? wordmarkStyle;
|
|
final double gap;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final mark = ClipRRect(
|
|
borderRadius: BorderRadius.circular(size * 0.22),
|
|
child: Image.asset(
|
|
'assets/brand/prediqo-mark.png',
|
|
width: size,
|
|
height: size,
|
|
fit: BoxFit.cover,
|
|
errorBuilder: (_, __, ___) => _FallbackMark(size: size),
|
|
),
|
|
);
|
|
|
|
if (!showWordmark) return mark;
|
|
|
|
return Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
mark,
|
|
SizedBox(width: gap),
|
|
Text(
|
|
'TLOTO',
|
|
style: wordmarkStyle ??
|
|
Theme.of(context).textTheme.headlineMedium?.copyWith(
|
|
fontWeight: FontWeight.w900,
|
|
letterSpacing: 0.3,
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|
|
class _FallbackMark extends StatelessWidget {
|
|
const _FallbackMark({required this.size});
|
|
final double size;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: size,
|
|
height: size,
|
|
decoration: BoxDecoration(
|
|
color: AppColors.bgDark,
|
|
borderRadius: BorderRadius.circular(size * 0.22),
|
|
border: Border.all(color: AppColors.accentGold, width: 1.5),
|
|
),
|
|
child: CustomPaint(
|
|
size: Size(size, size),
|
|
painter: _TlMarkPainter(),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Fallback fused T+L mark when the brand PNG is unavailable.
|
|
class _TlMarkPainter extends CustomPainter {
|
|
@override
|
|
void paint(Canvas canvas, Size size) {
|
|
final s = size.shortestSide;
|
|
final paint = Paint()
|
|
..color = AppColors.primary
|
|
..style = PaintingStyle.fill;
|
|
|
|
final path = Path()
|
|
..moveTo(s * 0.28, s * 0.19)
|
|
..lineTo(s * 0.66, s * 0.19)
|
|
..cubicTo(s * 0.74, s * 0.19, s * 0.80, s * 0.25, s * 0.80, s * 0.32)
|
|
..cubicTo(s * 0.80, s * 0.39, s * 0.74, s * 0.45, s * 0.66, s * 0.45)
|
|
..lineTo(s * 0.42, s * 0.45)
|
|
..lineTo(s * 0.42, s * 0.56)
|
|
..lineTo(s * 0.61, s * 0.56)
|
|
..cubicTo(s * 0.70, s * 0.56, s * 0.76, s * 0.62, s * 0.76, s * 0.70)
|
|
..cubicTo(s * 0.76, s * 0.77, s * 0.70, s * 0.83, s * 0.61, s * 0.83)
|
|
..lineTo(s * 0.28, s * 0.83)
|
|
..cubicTo(s * 0.20, s * 0.83, s * 0.13, s * 0.77, s * 0.13, s * 0.70)
|
|
..lineTo(s * 0.13, s * 0.32)
|
|
..cubicTo(s * 0.13, s * 0.25, s * 0.20, s * 0.19, s * 0.28, s * 0.19)
|
|
..close();
|
|
|
|
canvas.drawPath(path, paint);
|
|
|
|
final spark = Paint()..color = AppColors.accentGold;
|
|
final c = Offset(s * 0.50, s * 0.35);
|
|
final r = s * 0.035;
|
|
final star = Path()
|
|
..moveTo(c.dx, c.dy - r * 1.6)
|
|
..lineTo(c.dx + r * 0.35, c.dy - r * 0.35)
|
|
..lineTo(c.dx + r * 1.6, c.dy)
|
|
..lineTo(c.dx + r * 0.35, c.dy + r * 0.35)
|
|
..lineTo(c.dx, c.dy + r * 1.6)
|
|
..lineTo(c.dx - r * 0.35, c.dy + r * 0.35)
|
|
..lineTo(c.dx - r * 1.6, c.dy)
|
|
..lineTo(c.dx - r * 0.35, c.dy - r * 0.35)
|
|
..close();
|
|
canvas.drawPath(star, spark);
|
|
}
|
|
|
|
@override
|
|
bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
|
|
}
|