conditionally show Android proxy server option and update notes

This commit is contained in:
Moustapha Kodjo Amadou 2025-12-10 13:42:34 +01:00
parent 6e4d3dd52e
commit 23e41373dc
2 changed files with 36 additions and 31 deletions

View file

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
@ -58,37 +60,38 @@ class BrowseSScreen extends ConsumerWidget {
],
),
),
ListTile(
onTap: () => _showAndroidProxyServerDialog(
context,
ref,
androidProxyServer,
),
title: Text(l10n.android_proxy_server),
subtitle: Text(
androidProxyServer,
style: TextStyle(
fontSize: 11,
color: context.secondaryColor,
if (!Platform.isAndroid)
ListTile(
onTap: () => _showAndroidProxyServerDialog(
context,
ref,
androidProxyServer,
),
title: Text(l10n.android_proxy_server),
subtitle: Text(
androidProxyServer,
style: TextStyle(
fontSize: 11,
color: context.secondaryColor,
),
),
trailing: OutlinedButton.icon(
onPressed: () async {
if (!await launchUrl(
Uri.parse(apkUrl),
mode: LaunchMode.externalApplication,
)) {
AppLogger.log(
'Could not launch $apkUrl',
logLevel: LogLevel.error,
);
botToast('Could not launch $apkUrl');
}
},
label: Text(l10n.get_apk_bridge),
icon: const Icon(Icons.download_outlined),
),
),
trailing: OutlinedButton.icon(
onPressed: () async {
if (!await launchUrl(
Uri.parse(apkUrl),
mode: LaunchMode.externalApplication,
)) {
AppLogger.log(
'Could not launch $apkUrl',
logLevel: LogLevel.error,
);
botToast('Could not launch $apkUrl');
}
},
label: Text(l10n.get_apk_bridge),
icon: const Icon(Icons.download_outlined),
),
),
ListTile(
onTap: () {
context.push(

View file

@ -1,4 +1,5 @@
import 'dart:convert';
import 'dart:io';
import 'package:http_interceptor/http_interceptor.dart';
import 'package:isar_community/isar.dart';
import 'package:mangayomi/eval/lib.dart';
@ -69,8 +70,9 @@ Future<void> fetchSourcesList({
? ItemType.anime
: ItemType.manga
..iconUrl = "$repoUrl/icon/${e['pkg']}.png"
..notes =
"Requires Android Proxy Server (ApkBridge) for installing and using the extensions!";
..notes = Platform.isAndroid
? null
: "Requires Android Proxy Server (ApkBridge) for installing and using the extensions!";
src.id = 'mihon-${source['id']}'.hashCode;
yield src;
}