mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix: set isRooted state at RootCheckerView init
This commit is contained in:
parent
db02dc623f
commit
5e8e090e34
@ -11,6 +11,7 @@ class RootCheckerView extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<RootCheckerViewModel>.reactive(
|
||||
onModelReady: (model) => model.initialize(),
|
||||
viewModelBuilder: () => RootCheckerViewModel(),
|
||||
builder: (context, model, child) => Scaffold(
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
|
@ -10,6 +10,10 @@ class RootCheckerViewModel extends BaseViewModel {
|
||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
bool isRooted = false;
|
||||
|
||||
void initialize() {
|
||||
isRooted = _managerAPI.isRooted() ?? false;
|
||||
}
|
||||
|
||||
Future<void> navigateAsRoot() async {
|
||||
bool? res = await Root.isRooted();
|
||||
isRooted = res != null && res == true;
|
||||
|
Loading…
Reference in New Issue
Block a user