Skip to content

Commit

Permalink
feat: open browser when clicking on changelog link
Browse files Browse the repository at this point in the history
  • Loading branch information
Aunali321 committed Apr 16, 2024
1 parent 5e6cc86 commit bc300d8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Expand Up @@ -26,7 +26,8 @@
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:largeHeap="true"
android:requestLegacyExternalStorage="true">
android:requestLegacyExternalStorage="true"
android:enableOnBackInvokedCallback="true">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
51 changes: 29 additions & 22 deletions lib/ui/widgets/homeView/update_confirmation_sheet.dart
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:revanced_manager/app/app.locator.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
import 'package:url_launcher/url_launcher.dart';

class UpdateConfirmationSheet extends StatelessWidget {
const UpdateConfirmationSheet({
Expand Down Expand Up @@ -55,15 +56,15 @@ class UpdateConfirmationSheet extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
Text(
isPatches
? t.homeView.updatePatchesSheetTitle
: t.homeView.updateSheetTitle,
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
? t.homeView.updatePatchesSheetTitle
: t.homeView.updateSheetTitle,
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 4.0),
Row(
children: [
Expand Down Expand Up @@ -96,7 +97,7 @@ class UpdateConfirmationSheet extends StatelessWidget {
? model.updatePatches(context)
: model.updateManager(context);
},
child: Text(t.updateButton),
child: Text(t.updateButton),
),
],
),
Expand All @@ -110,31 +111,37 @@ class UpdateConfirmationSheet extends StatelessWidget {
child: Text(
t.homeView.updateChangelogTitle,
style: TextStyle(
fontSize: changelog ? 24 : 20,
fontSize: changelog ? 24 : 20,
fontWeight: FontWeight.w500,
color:
Theme.of(context).colorScheme.onSecondaryContainer,
),
),
),
Container(
margin: const EdgeInsets.symmetric(horizontal: 24.0),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(12.0),
),
child: Markdown(
),
Container(
margin: const EdgeInsets.symmetric(horizontal: 24.0),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(12.0),
),
child: Markdown(
styleSheet: MarkdownStyleSheet(
a: TextStyle(
color: Theme.of(context).colorScheme.primary,
),
),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(20.0),
data: snapshot.data!['body'] ?? '',
),
onTapLink: (text, href, title) => href != null
? launchUrl(
Uri.parse(href),
mode: LaunchMode.externalApplication,
)
: null,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(20.0),
data: snapshot.data!['body'] ?? '',
),
),
],
);
},
Expand Down

0 comments on commit bc300d8

Please sign in to comment.