AlienTechCover(textInput: "blue alien tech futuristic")import 'package:flutter/material.dart'; import 'dart:math'; class AlienTechCover extends StatelessWidget { final String textInput; const AlienTechCover({Key? key, required this.textInput}) : super(key: key); // Map keywords to colors for more variety Color _getBaseColor(List keywords) { if (keywords.contains('blue')) return Colors.blue; if (keywords.contains('red')) return Colors.red; if (keywords.contains('purple')) return Colors.purple; if (keywords.contains('orange')) return Colors.orange; return Colors.green; } @override Widget build(BuildContext context) { final keywords = textInput.split(' '); final baseColor = _getBaseColor(keywords); final numLines = keywords.length + 5; final random = Random(); return LayoutBuilder( builder: (context, constraints) { final width = constraints.maxWidth; final height = constraints.maxHeight; return Container( decoration: BoxDecoration( color: baseColor.shade900, ), child: Stack( children: [ // Circuit Lines for (int i = 0; i < numLines; i++) Positioned( left: random.nextDouble() * width, top: random.nextDouble() * height, child: Container( width: random.nextDouble() * (width * 0.15) + 10, height: 2, color: baseColor.shade200.withOpacity(0.5), ), ), // Central Glow Center( child: Container( width: width * 0.25, height: width * 0.25, 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() * width, top: random.nextDouble() * height, child: Transform.rotate( angle: random.nextDouble() * pi * 2, child: CustomPaint( size: Size(width * 0.07, width * 0.07 * 0.866), 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 w = size.width; final h = size.height; path.moveTo(w / 2, 0); path.lineTo(w, h * 0.25); path.lineTo(w, h * 0.75); path.lineTo(w / 2, h); path.lineTo(0, h * 0.75); path.lineTo(0, h * 0.25); path.close(); final paint = Paint() ..color = color ..style = PaintingStyle.fill; canvas.drawPath(path, paint); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) => false; }