Files
BlockSeasons/lib/ui/branding/feature_graphic_painter.dart
T
2026-06-13 18:15:11 +09:00

37 lines
1.3 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// lib/ui/branding/feature_graphic_painter.dart
import 'package:flutter/material.dart';
import 'app_icon_painter.dart';
/// Paints the Play feature graphic (1024×500): navy field, the brand blocks on
/// the left, wordmark + tagline on the right.
class FeatureGraphic {
static void paint(Canvas canvas, Size size) {
final rect = Offset.zero & size;
AppIconMark.paintBackground(canvas, rect);
// Blocks on the left, vertically centered.
canvas.save();
final blockArea = size.height * 0.74;
canvas.translate(size.height * 0.16, (size.height - blockArea) / 2);
AppIconMark.paintBlocks(canvas, blockArea, groupFraction: 0.92);
canvas.restore();
void text(String s, double dy, double fontSize, FontWeight w, Color c) {
final tp = TextPainter(
text: TextSpan(
text: s,
style: TextStyle(
color: c, fontSize: fontSize, fontWeight: w, letterSpacing: 0.5),
),
textDirection: TextDirection.ltr,
)..layout();
tp.paint(canvas, Offset(size.height * 1.02, dy));
}
text('Block Seasons', size.height * 0.34, 76, FontWeight.w900, Colors.white);
text('A new season of blocks every few weeks.', size.height * 0.50, 30,
FontWeight.w500, const Color(0xFFB9C4E6));
}
}