import 'package:flutter/material.dart'; import 'dart:math'; class AlienTechCover { static Widget generate(String textInput) { // 1. Keyword Extraction (Simplified) List keywords = textInput.split(' '); // 2. Base Color Color baseColor = keywords.contains('blue') ? Colors.blue : Colors.green; // 3. Number of Circuit Lines int numLines = keywords.length + 5; return Container( decoration: BoxDecoration( color: baseColor.shade900, // Dark background ), child: Stack( children: [ // Circuit Lines for (int i = 0; i < numLines; i++) Positioned( left: Random().nextDouble() * 300, top: Random().nextDouble() * 300, child: Container( width: Random().nextDouble() * 50 + 10, height: 2, color: baseColor.shade200.withOpacity(0.5), // Glowing line ), ), // Central Glow Center( child: Container( width: 80, height: 80, decoration: BoxDecoration( color: baseColor.shade400.withOpacity(0.7), shape: BoxShape.circle, boxShadow: [ BoxShadow( color: baseColor.shade400, blurRadius: 20, spreadRadius: 5, ), ], ), ), ), // Hexagon Pattern for (int i = 0; i < 5; i++) Positioned( left: Random().nextDouble() * 300, top: Random().nextDouble() * 300, child: Transform.rotate( angle: Random().nextDouble() * pi * 2, child: CustomPaint( size: Size(20, (20 * 0.8660254037844386)), // Hexagon painter: HexagonPainter(color: baseColor.shade300.withOpacity(0.6)), ), ), ), ], ), ); } } class HexagonPainter extends CustomPainter { final Color color; HexagonPainter({required this.color}); @override void paint(Canvas canvas, Size size) { final path = Path(); final height = size.height; final width = size.width; path.moveTo(size.width / 2, 0); path.lineTo(width, height * 0.25); path.lineTo(width, height * 0.75); path.lineTo(size.width / 2, height); path.lineTo(0, height * 0.75); path.lineTo(0, height * 0.25); path.close(); final paint = Paint() ..color = color ..style = PaintingStyle.fill; canvas.drawPath(path, paint); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) { return false; } }