You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
690 B
33 lines
690 B
import 'package:flutter/material.dart';
|
|
|
|
class TorStatus extends ChangeNotifier {
|
|
int progress;
|
|
String status;
|
|
bool connected;
|
|
String version;
|
|
|
|
TorStatus({this.connected = false, this.progress = 0, this.status = "", this.version = ""});
|
|
|
|
/// Called by the event bus.
|
|
handleUpdate(int new_progress, String new_status) {
|
|
if (progress == 100) {
|
|
connected = true;
|
|
} else {
|
|
connected = false;
|
|
}
|
|
|
|
progress = new_progress;
|
|
status = new_status;
|
|
if (new_progress != 100) {
|
|
status = "$new_progress% - $new_status";
|
|
}
|
|
|
|
notifyListeners();
|
|
}
|
|
|
|
updateVersion(String new_version) {
|
|
version = new_version;
|
|
notifyListeners();
|
|
}
|
|
}
|