64 lines
1.9 KiB
Dart
Executable File
64 lines
1.9 KiB
Dart
Executable File
import 'package:flutter/material.dart';
|
|
|
|
class StatusChip extends StatelessWidget {
|
|
final String label;
|
|
final bool ready;
|
|
const StatusChip({super.key, required this.label, required this.ready});
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Chip(
|
|
label: Text(label),
|
|
avatar: Icon(ready ? Icons.check_circle : Icons.radio_button_unchecked,
|
|
color: ready ? Colors.green : Colors.grey, size: 18),
|
|
backgroundColor: ready ? Colors.green.shade50 : Colors.grey.shade100);
|
|
}
|
|
}
|
|
|
|
class ActionButton extends StatelessWidget {
|
|
final String label;
|
|
final IconData icon;
|
|
final Color color;
|
|
final bool loading;
|
|
final VoidCallback onTap;
|
|
const ActionButton(
|
|
{super.key,
|
|
required this.label,
|
|
required this.icon,
|
|
required this.color,
|
|
required this.loading,
|
|
required this.onTap});
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ElevatedButton.icon(
|
|
onPressed: loading ? null : onTap,
|
|
icon: Icon(icon, color: color),
|
|
label: Text(label),
|
|
style: ElevatedButton.styleFrom(backgroundColor: color.withAlpha(25)));
|
|
}
|
|
}
|
|
|
|
class LogArea extends StatelessWidget {
|
|
final List<String> log;
|
|
const LogArea({super.key, required this.log});
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (log.isEmpty) return const SizedBox.shrink();
|
|
return Container(
|
|
height: 120,
|
|
width: double.infinity,
|
|
padding: const EdgeInsets.all(8),
|
|
decoration: BoxDecoration(
|
|
color: const Color(0xFF1E1E1E),
|
|
borderRadius: BorderRadius.circular(8)),
|
|
child: ListView.builder(
|
|
reverse: true,
|
|
itemCount: log.length,
|
|
itemBuilder: (_, i) => Text(log[log.length - 1 - i],
|
|
style: const TextStyle(
|
|
color: Color(0xFF4EC9B0),
|
|
fontSize: 11,
|
|
fontFamily: 'monospace'))),
|
|
);
|
|
}
|
|
}
|