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