mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-09-08 04:56:58 +00:00
17 lines
409 B
Dart
17 lines
409 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'package:selfprivacy/logic/models/console_log.dart';
|
||
|
|
||
|
class ConsoleModel extends ChangeNotifier {
|
||
|
final List<ConsoleLog> _logs = [];
|
||
|
List<ConsoleLog> get logs => _logs;
|
||
|
|
||
|
void log(final ConsoleLog newLog) {
|
||
|
logs.add(newLog);
|
||
|
notifyListeners();
|
||
|
// Make sure we don't have too many
|
||
|
if (logs.length > 500) {
|
||
|
logs.removeAt(0);
|
||
|
}
|
||
|
}
|
||
|
}
|