app version and whats new
This commit is contained in:
parent
02ea45469f
commit
b86602bcdb
@ -157,10 +157,11 @@ part 'popups.dart';
|
|||||||
EventBus eventBus = new EventBus();
|
EventBus eventBus = new EventBus();
|
||||||
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
|
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
|
||||||
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = new FlutterLocalNotificationsPlugin();
|
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = new FlutterLocalNotificationsPlugin();
|
||||||
const String appName = "HA Client";
|
const String appName = 'HA Client';
|
||||||
const appVersionNumber = "1.0.1";
|
const appVersionNumber = '1.0.1';
|
||||||
const appVersionAdd = "";
|
final String appVersionAdd = secrets['version_type'] ?? '';
|
||||||
const appVersion = "$appVersionNumber$appVersionAdd";
|
final String appVersion = '$appVersionNumber${appVersionAdd.isNotEmpty ? '-' : ''}$appVersionAdd';
|
||||||
|
const whatsNewUrl = 'http://ha-client.app/service/whats_new_1.0.1.md';
|
||||||
|
|
||||||
Future<void> _reportError(dynamic error, dynamic stackTrace) async {
|
Future<void> _reportError(dynamic error, dynamic stackTrace) async {
|
||||||
// Print the exception to the console.
|
// Print the exception to the console.
|
||||||
|
@ -14,13 +14,13 @@ class StartupUserMessagesManager {
|
|||||||
bool _supportAppDevelopmentMessageShown;
|
bool _supportAppDevelopmentMessageShown;
|
||||||
bool _whatsNewMessageShown;
|
bool _whatsNewMessageShown;
|
||||||
static final _supportAppDevelopmentMessageKey = "user-message-shown-support-development_3";
|
static final _supportAppDevelopmentMessageKey = "user-message-shown-support-development_3";
|
||||||
static final _whatsNewMessageKey = "user-message-shown-whats-new-1006";
|
static final _whatsNewMessageKey = "user-msg-whats-new-url";
|
||||||
|
|
||||||
void checkMessagesToShow() async {
|
void checkMessagesToShow() async {
|
||||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
await prefs.reload();
|
await prefs.reload();
|
||||||
_supportAppDevelopmentMessageShown = prefs.getBool(_supportAppDevelopmentMessageKey) ?? false;
|
_supportAppDevelopmentMessageShown = prefs.getBool(_supportAppDevelopmentMessageKey) ?? false;
|
||||||
_whatsNewMessageShown = prefs.getBool(_whatsNewMessageKey) ?? false;
|
_whatsNewMessageShown = '${prefs.getString(_whatsNewMessageKey)}' == whatsNewUrl;
|
||||||
if (!_whatsNewMessageShown) {
|
if (!_whatsNewMessageShown) {
|
||||||
_showWhatsNewMessage();
|
_showWhatsNewMessage();
|
||||||
} else if (!_supportAppDevelopmentMessageShown) {
|
} else if (!_supportAppDevelopmentMessageShown) {
|
||||||
@ -52,7 +52,7 @@ class StartupUserMessagesManager {
|
|||||||
|
|
||||||
void _showWhatsNewMessage() {
|
void _showWhatsNewMessage() {
|
||||||
SharedPreferences.getInstance().then((prefs) {
|
SharedPreferences.getInstance().then((prefs) {
|
||||||
prefs.setBool(_whatsNewMessageKey, true);
|
prefs.setString(_whatsNewMessageKey, whatsNewUrl);
|
||||||
eventBus.fire(ShowPageEvent(path: "/whats-new"));
|
eventBus.fire(ShowPageEvent(path: "/whats-new"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class _WhatsNewPageState extends State<WhatsNewPage> {
|
|||||||
error = "";
|
error = "";
|
||||||
});
|
});
|
||||||
http.Response response;
|
http.Response response;
|
||||||
response = await http.get("http://ha-client.app/service/whats_new_1.0.0_stable.md");
|
response = await http.get(whatsNewUrl);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
setState(() {
|
setState(() {
|
||||||
data = response.body;
|
data = response.body;
|
||||||
|
@ -4,6 +4,7 @@ import 'dart:io';
|
|||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
final config = {
|
final config = {
|
||||||
'syncfusion_license_key': Platform.environment['SYNCFUSION_LICENSE_KEY'],
|
'syncfusion_license_key': Platform.environment['SYNCFUSION_LICENSE_KEY'],
|
||||||
|
'version_type': Platform.environment['HA_CLIENT_VERSION_TYPE']
|
||||||
};
|
};
|
||||||
|
|
||||||
final filename = 'lib/.secrets.dart';
|
final filename = 'lib/.secrets.dart';
|
||||||
|
Reference in New Issue
Block a user