mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-19 13:09:30 +02:00
Refactor - removed duplicate code
This commit is contained in:
@@ -219,6 +219,9 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
SliverList(
|
SliverList(
|
||||||
delegate: SliverChildBuilderDelegate(
|
delegate: SliverChildBuilderDelegate(
|
||||||
(BuildContext context, int index) {
|
(BuildContext context, int index) {
|
||||||
|
String? changesUrl = SourceProvider()
|
||||||
|
.getSource(sortedApps[index].app.url)
|
||||||
|
.changeLogPageFromStandardUrl(sortedApps[index].app.url);
|
||||||
return ListTile(
|
return ListTile(
|
||||||
tileColor: sortedApps[index].app.pinned
|
tileColor: sortedApps[index].app.pinned
|
||||||
? Colors.grey.withOpacity(0.1)
|
? Colors.grey.withOpacity(0.1)
|
||||||
@@ -274,22 +277,10 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
sortedApps[index].app.installedVersion !=
|
sortedApps[index].app.installedVersion !=
|
||||||
sortedApps[index].app.latestVersion
|
sortedApps[index].app.latestVersion
|
||||||
? GestureDetector(
|
? GestureDetector(
|
||||||
onTap: SourceProvider()
|
onTap: changesUrl == null
|
||||||
.getSource(
|
|
||||||
sortedApps[index].app.url)
|
|
||||||
.changeLogPageFromStandardUrl(
|
|
||||||
sortedApps[index].app.url) ==
|
|
||||||
null
|
|
||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
launchUrlString(
|
launchUrlString(changesUrl,
|
||||||
SourceProvider()
|
|
||||||
.getSource(
|
|
||||||
sortedApps[index].app.url)
|
|
||||||
.changeLogPageFromStandardUrl(
|
|
||||||
sortedApps[index]
|
|
||||||
.app
|
|
||||||
.url)!,
|
|
||||||
mode: LaunchMode
|
mode: LaunchMode
|
||||||
.externalApplication);
|
.externalApplication);
|
||||||
},
|
},
|
||||||
@@ -297,15 +288,7 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
'${tr('updateAvailable')}${sortedApps[index].app.trackOnly ? ' ${tr('estimateInBracketsShort')}' : ''}',
|
'${tr('updateAvailable')}${sortedApps[index].app.trackOnly ? ' ${tr('estimateInBracketsShort')}' : ''}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontStyle: FontStyle.italic,
|
fontStyle: FontStyle.italic,
|
||||||
decoration: SourceProvider()
|
decoration: changesUrl == null
|
||||||
.getSource(sortedApps[index]
|
|
||||||
.app
|
|
||||||
.url)
|
|
||||||
.changeLogPageFromStandardUrl(
|
|
||||||
sortedApps[index]
|
|
||||||
.app
|
|
||||||
.url) ==
|
|
||||||
null
|
|
||||||
? TextDecoration.none
|
? TextDecoration.none
|
||||||
: TextDecoration.underline),
|
: TextDecoration.underline),
|
||||||
))
|
))
|
||||||
|
Reference in New Issue
Block a user