[version] add updater
This commit is contained in:
parent
e41f11a8c3
commit
52be0507d9
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- https://sparkle-project.org/documentation/publishing/ -->
|
||||
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
|
||||
<channel>
|
||||
<title>noTube</title>
|
||||
<item>
|
||||
<title>Version 0.0.22</title>
|
||||
<description>Base updater</description>
|
||||
<pubDate>Tue, 09 Jul 2024 15:20:11 +0000</pubDate>
|
||||
<enclosure url="https://jscampucci.fr/Libu/noTube/noTube-0.0.22-Win.zip" sparkle:version="0.0.22" sparkle:os="windows" />
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
@ -14,6 +14,7 @@ import 'package:upgrader/upgrader.dart';
|
|||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:notube/videoList/cubit/videos_cubit.dart';
|
||||
import 'package:notube/services/file_logger.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
|
@ -30,6 +31,7 @@ void main() async {
|
|||
await windowManager.show();
|
||||
await windowManager.focus();
|
||||
});
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await FileLogger().init();
|
||||
|
||||
|
|
@ -54,11 +56,14 @@ class NoTubeApp extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _NoTubeAppState extends State<NoTubeApp> {
|
||||
static const appcastURL =
|
||||
'https://raw.githubusercontent.com/larryaasen/upgrader/master/test/testappcast.xml';
|
||||
static const appcastURL = 'https://jscampucci.fr/Libu/noTube/appcast.xml';
|
||||
final upgrader = Upgrader(
|
||||
storeController: UpgraderStoreController(
|
||||
onAndroid: () => UpgraderAppcastStore(appcastURL: appcastURL),
|
||||
oniOS: () => UpgraderAppcastStore(appcastURL: appcastURL),
|
||||
onWindows: () => UpgraderAppcastStore(appcastURL: appcastURL),
|
||||
onLinux: () => UpgraderAppcastStore(appcastURL: appcastURL),
|
||||
onMacOS: () => UpgraderAppcastStore(appcastURL: appcastURL),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:filesystem_picker/filesystem_picker.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
class Settings extends StatefulWidget {
|
||||
Settings({super.key});
|
||||
|
|
@ -17,12 +18,14 @@ class Settings extends StatefulWidget {
|
|||
class _SettingsState extends State<Settings> {
|
||||
late Directory downloadFolder;
|
||||
late SharedPreferences prefs;
|
||||
late PackageInfo packageInfo;
|
||||
|
||||
Future<String> _init() async {
|
||||
prefs = await SharedPreferences.getInstance();
|
||||
Directory defaultDownloadDirectory = await getDownloadDirectory();
|
||||
downloadFolder = Directory(
|
||||
prefs.getString('downloadFolder') ?? defaultDownloadDirectory.path);
|
||||
packageInfo = await PackageInfo.fromPlatform();
|
||||
return 'ok';
|
||||
}
|
||||
|
||||
|
|
@ -97,7 +100,11 @@ class _SettingsState extends State<Settings> {
|
|||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
),
|
||||
ListTile(
|
||||
title: Text('build_version').tr(),
|
||||
subtitle: Text(packageInfo.version),
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
|
|
|
|||
10
pubspec.lock
10
pubspec.lock
|
|
@ -137,14 +137,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.0.2"
|
||||
english_words:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: english_words
|
||||
sha256: "6a7ef6473a97bd8571b6b641d006a6e58a7c67e65fb6f3d6d1151cb46b0e983c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
equatable:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
@ -382,7 +374,7 @@ packages:
|
|||
source: hosted
|
||||
version: "2.0.1"
|
||||
package_info_plus:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: package_info_plus
|
||||
sha256: b93d8b4d624b4ea19b0a5a208b2d6eff06004bc3ce74c06040b120eeadd00ce0
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ description: noTube
|
|||
|
||||
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||
|
||||
version: 0.0.20
|
||||
version: 0.0.21
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
|
@ -12,7 +12,6 @@ dependencies:
|
|||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
english_words: ^4.0.0
|
||||
provider: ^6.1.2
|
||||
flutter_localization: ^0.2.0
|
||||
easy_localization: ^3.0.7
|
||||
|
|
@ -34,6 +33,7 @@ dependencies:
|
|||
file_picker: ^8.0.6
|
||||
rename: ^3.0.2
|
||||
logger: ^2.3.0
|
||||
package_info_plus: ^8.0.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|
|
|||
Loading…
Reference in New Issue