selfprivacy.org.app/lib/logic/get_it/console.dart
2021-01-14 22:48:05 +01:00

22 lines
470 B
Dart

import 'package:flutter/material.dart';
import 'package:selfprivacy/logic/models/message.dart';
abstract class ConsoleModel extends ChangeNotifier {
void addMessage(Message message);
List<Message> get messages;
}
class ConsoleModelImplementation extends ConsoleModel {
List<Message> _messages = [];
@override
List<Message> get messages => _messages;
@override
void addMessage(Message message) {
messages.add(message);
notifyListeners();
}
}