mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-12 01:50:15 +02:00
Support for normal text changelogs (by Source)
This commit is contained in:
@@ -231,8 +231,9 @@ class AppsPageState extends State<AppsPage> {
|
||||
SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
String? changesUrl = SourceProvider()
|
||||
.getSource(listedApps[index].app.url)
|
||||
AppSource appSource =
|
||||
SourceProvider().getSource(listedApps[index].app.url);
|
||||
String? changesUrl = appSource
|
||||
.changeLogPageFromStandardUrl(listedApps[index].app.url);
|
||||
String? changeLog = listedApps[index].app.changeLog;
|
||||
var showChanges = (changeLog == null && changesUrl == null)
|
||||
@@ -267,17 +268,21 @@ class AppsPageState extends State<AppsPage> {
|
||||
height: 16,
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height:
|
||||
MediaQuery.of(context).size.height -
|
||||
appSource.changeLogIfAnyIsMarkDown
|
||||
? SizedBox(
|
||||
width:
|
||||
MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context)
|
||||
.size
|
||||
.height -
|
||||
350,
|
||||
child: Markdown(
|
||||
data: changeLog,
|
||||
onTapLink: (text, href, title) {
|
||||
if (href != null) {
|
||||
launchUrlString(
|
||||
href.startsWith('http://') ||
|
||||
href.startsWith(
|
||||
'http://') ||
|
||||
href.startsWith(
|
||||
'https://')
|
||||
? href
|
||||
@@ -291,11 +296,14 @@ class AppsPageState extends State<AppsPage> {
|
||||
.blockSyntaxes,
|
||||
[
|
||||
md.EmojiSyntax(),
|
||||
...md.ExtensionSet.gitHubFlavored
|
||||
...md
|
||||
.ExtensionSet
|
||||
.gitHubFlavored
|
||||
.inlineSyntaxes
|
||||
],
|
||||
),
|
||||
)),
|
||||
))
|
||||
: Text(changeLog),
|
||||
],
|
||||
singleNullReturnButton: tr('ok'),
|
||||
);
|
||||
|
@@ -228,6 +228,7 @@ class AppSource {
|
||||
String? host;
|
||||
late String name;
|
||||
bool enforceTrackOnly = false;
|
||||
bool changeLogIfAnyIsMarkDown = true;
|
||||
|
||||
AppSource() {
|
||||
name = runtimeType.toString();
|
||||
|
Reference in New Issue
Block a user