Eliminar valores innecesarios de la configuración
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class ServicioVersionApp {
|
||||
static const _channel = MethodChannel('farolero/app_info');
|
||||
|
||||
static Future<String> obtenerVersion() async {
|
||||
final Map<String, dynamic>? info;
|
||||
try {
|
||||
info = await _channel.invokeMapMethod<String, dynamic>(
|
||||
'getAppVersion',
|
||||
);
|
||||
} on PlatformException {
|
||||
return '-';
|
||||
} on MissingPluginException {
|
||||
return '-';
|
||||
}
|
||||
|
||||
final versionName = info?['versionName']?.toString();
|
||||
final versionCode = info?['versionCode']?.toString();
|
||||
|
||||
if (versionName == null || versionName.isEmpty) {
|
||||
return '-';
|
||||
}
|
||||
if (versionCode == null || versionCode.isEmpty) {
|
||||
return versionName;
|
||||
}
|
||||
return '$versionName+$versionCode';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user