mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-04 16:03:13 +00:00
18 lines
439 B
Dart
18 lines
439 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:selfprivacy/logic/models/message.dart';
|
|
|
|
class ConsoleModel extends ChangeNotifier {
|
|
final List<Message> _messages = [];
|
|
|
|
List<Message> get messages => _messages;
|
|
|
|
void addMessage(final Message message) {
|
|
messages.add(message);
|
|
notifyListeners();
|
|
// Make sure we don't have too many messages
|
|
if (messages.length > 500) {
|
|
messages.removeAt(0);
|
|
}
|
|
}
|
|
}
|