mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix: minor UI and UX fixes
This commit is contained in:
parent
165bd4aec2
commit
3a63f63a3c
@ -36,8 +36,8 @@ class PatchedApplication {
|
||||
|
||||
Map toJson() => _$PatchedApplicationToJson(this);
|
||||
|
||||
static Uint8List bytesFromString(String pictureUrl) =>
|
||||
Uint8List.fromList(pictureUrl.codeUnits);
|
||||
static Uint8List bytesFromString(String icon) =>
|
||||
Uint8List.fromList(icon.codeUnits);
|
||||
|
||||
static String bytesToString(Uint8List bytes) => String.fromCharCodes(bytes);
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ class RootCheckerView extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<RootCheckerViewModel>.reactive(
|
||||
disposeViewModel: false,
|
||||
onModelReady: (model) => model.initialize,
|
||||
viewModelBuilder: () => RootCheckerViewModel(),
|
||||
builder: (context, model, child) => Scaffold(
|
||||
floatingActionButton: Column(
|
||||
@ -64,11 +63,7 @@ class RootCheckerView extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 170),
|
||||
MagiskButton(
|
||||
onPressed: () {
|
||||
model
|
||||
.getMagiskPermissions()
|
||||
.then((value) => model.checkRoot());
|
||||
},
|
||||
onPressed: () => model.checkRoot(),
|
||||
),
|
||||
I18nText(
|
||||
'rootCheckerView.grantedPermission',
|
||||
|
@ -9,11 +9,6 @@ class RootCheckerViewModel extends BaseViewModel {
|
||||
final _navigationService = locator<NavigationService>();
|
||||
bool? isRooted = false;
|
||||
|
||||
Future<void> initialize() async {
|
||||
await checkRoot();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> checkRoot() async {
|
||||
isRooted = await Root.isRooted();
|
||||
if (isRooted == true) {
|
||||
@ -22,15 +17,6 @@ class RootCheckerViewModel extends BaseViewModel {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<bool> getMagiskPermissions() async {
|
||||
try {
|
||||
await Root.exec(cmd: 'cat /proc/version');
|
||||
} on Exception {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<void> navigateToHome() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
prefs.setBool('isRooted', isRooted!);
|
||||
|
@ -54,7 +54,12 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
'latestCommitCard.loadingLabel',
|
||||
),
|
||||
builder: (context, snapshot) => Text(
|
||||
"${snapshot.data!} ago",
|
||||
snapshot.data!.isNotEmpty
|
||||
? snapshot.data!
|
||||
: FlutterI18n.translate(
|
||||
context,
|
||||
'latestCommitCard.loadingLabel',
|
||||
),
|
||||
style: robotoTextStyle,
|
||||
),
|
||||
),
|
||||
@ -82,7 +87,12 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
'latestCommitCard.loadingLabel',
|
||||
),
|
||||
builder: (context, snapshot) => Text(
|
||||
"${snapshot.data!} ago",
|
||||
snapshot.data!.isNotEmpty
|
||||
? snapshot.data!
|
||||
: FlutterI18n.translate(
|
||||
context,
|
||||
'latestCommitCard.loadingLabel',
|
||||
),
|
||||
style: robotoTextStyle,
|
||||
),
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user