selfprivacy.org.app/lib/logic/get_it/console.dart

22 lines
470 B
Dart
Raw Normal View History

2021-01-14 21:48:05 +00:00
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();
}
}