selfprivacy.org.app/lib/logic/get_it/console_model.dart
Aliaksei Tratseuski 00545c34b4 feat: console log feature refactor.
listing scroll performance fix, uniform code and widget UI for different log item types, dialog data can now be selected & copy-pasted
2024-04-20 13:53:55 +04:00

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);
}
}
}