mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-10-25 11:53:45 +02:00
haptic feedback, listed sources
This commit is contained in:
@@ -6,6 +6,7 @@ import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:obtainium/providers/notifications_provider.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
@@ -191,7 +192,7 @@ class AppsProvider with ChangeNotifier {
|
||||
|
||||
Future<App?> getUpdate(String appId) async {
|
||||
App? currentApp = apps[appId]!.app;
|
||||
App newApp = await sourceProvider().getApp(currentApp.url);
|
||||
App newApp = await SourceProvider().getApp(currentApp.url);
|
||||
if (newApp.latestVersion != currentApp.latestVersion) {
|
||||
newApp.installedVersion = currentApp.installedVersion;
|
||||
await saveApp(newApp);
|
||||
@@ -299,11 +300,13 @@ class _APKPickerState extends State<APKPicker> {
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
HapticFeedback.lightImpact();
|
||||
Navigator.of(context).pop(null);
|
||||
},
|
||||
child: const Text('Cancel')),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
HapticFeedback.mediumImpact();
|
||||
Navigator.of(context).pop(apkUrl);
|
||||
},
|
||||
child: const Text('Continue'))
|
||||
|
||||
@@ -195,7 +195,7 @@ class GitLab implements AppSource {
|
||||
}
|
||||
}
|
||||
|
||||
class sourceProvider {
|
||||
class SourceProvider {
|
||||
// Add more source classes here so they are available via the service
|
||||
AppSource getSource(String url) {
|
||||
if (url.toLowerCase().contains('://github.com')) {
|
||||
@@ -227,4 +227,6 @@ class sourceProvider {
|
||||
apk.version,
|
||||
apk.apkUrls);
|
||||
}
|
||||
|
||||
List<String> getSourceHosts() => ['github.com', 'gitlab.com'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user