2022-12-18 00:04:08 +00:00
|
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
|
|
|
|
class ServerLogWidget extends StatefulWidget {
|
|
|
|
final Color textColor;
|
|
|
|
final String addString;
|
|
|
|
|
|
|
|
const ServerLogWidget(this.addString, {required this.textColor, super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() => ServerLogWidgetState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class ServerLogWidgetState extends State<ServerLogWidget> {
|
|
|
|
List<String> log = [];
|
|
|
|
|
|
|
|
ServerLogWidgetState();
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
log.add(widget.addString);
|
2023-06-08 15:10:48 +00:00
|
|
|
return SizedBox(
|
|
|
|
height: 200,
|
|
|
|
width: 200,
|
|
|
|
child: ListView(
|
|
|
|
children: [
|
|
|
|
for (int i = 0; i < log.length; i++)
|
|
|
|
Text(
|
|
|
|
style: TextStyle(color: widget.textColor, fontSize: 20), log[i])
|
|
|
|
],
|
|
|
|
),
|
2022-12-18 00:04:08 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|