mchess-client/lib/utils/widgets/server_log_widget.dart
2023-06-08 17:10:48 +02:00

34 lines
774 B
Dart

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);
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])
],
),
);
}
}