mchess-client/lib/utils/widgets/server_log_widget.dart

30 lines
679 B
Dart
Raw Normal View History

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);
return Column(
children: [
for (int i = 0; i < log.length; i++)
Text(style: TextStyle(color: widget.textColor, fontSize: 20), log[i])
],
);
}
}