2022-08-14 16:03:01 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2022-09-02 15:35:25 +02:00
|
|
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
2022-08-14 16:03:01 +02:00
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
import 'package:revanced_manager/ui/views/root_checker/root_checker_viewmodel.dart';
|
2022-08-21 12:47:44 +02:00
|
|
|
import 'package:revanced_manager/ui/widgets/rootCheckerView/magisk_button.dart';
|
2022-08-14 16:03:01 +02:00
|
|
|
import 'package:stacked/stacked.dart';
|
|
|
|
|
|
|
|
class RootCheckerView extends StatelessWidget {
|
|
|
|
const RootCheckerView({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ViewModelBuilder<RootCheckerViewModel>.reactive(
|
2022-08-14 21:16:08 +02:00
|
|
|
viewModelBuilder: () => RootCheckerViewModel(),
|
2022-08-14 16:03:01 +02:00
|
|
|
builder: (context, model, child) => Scaffold(
|
2022-09-01 02:25:19 +02:00
|
|
|
floatingActionButton: FloatingActionButton.extended(
|
|
|
|
label: I18nText('rootCheckerView.nonRootButton'),
|
|
|
|
icon: const Icon(Icons.keyboard_arrow_right),
|
|
|
|
onPressed: () => model.navigateAsNonRoot(),
|
2022-08-14 16:03:01 +02:00
|
|
|
),
|
|
|
|
body: Container(
|
|
|
|
height: double.infinity,
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 28.0),
|
|
|
|
child: Column(
|
2022-09-02 15:35:25 +02:00
|
|
|
children: <Widget>[
|
2022-08-14 16:03:01 +02:00
|
|
|
const SizedBox(height: 120),
|
|
|
|
I18nText(
|
|
|
|
'rootCheckerView.widgetTitle',
|
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
style: GoogleFonts.jetBrainsMono(
|
|
|
|
fontSize: 24,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 24),
|
|
|
|
I18nText(
|
|
|
|
'rootCheckerView.widgetDescription',
|
2022-09-05 04:32:36 +02:00
|
|
|
child: const Text(
|
2022-08-14 16:03:01 +02:00
|
|
|
'',
|
|
|
|
textAlign: TextAlign.center,
|
2022-09-05 04:32:36 +02:00
|
|
|
style: TextStyle(
|
2022-08-14 16:03:01 +02:00
|
|
|
fontSize: 17,
|
|
|
|
letterSpacing: 1.1,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
2022-09-01 02:25:19 +02:00
|
|
|
Expanded(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
2022-09-02 15:35:25 +02:00
|
|
|
children: <Widget>[
|
2022-09-01 02:25:19 +02:00
|
|
|
MagiskButton(
|
|
|
|
onPressed: () => model.navigateAsRoot(),
|
|
|
|
),
|
|
|
|
I18nText(
|
|
|
|
'rootCheckerView.grantedPermission',
|
|
|
|
translationParams: {
|
|
|
|
'isRooted': model.isRooted.toString(),
|
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
2022-08-14 20:40:34 +02:00
|
|
|
),
|
2022-08-14 16:03:01 +02:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|