init static method
Implementation
static init(
{required String version,
required BuildContext context,
required String baseURL}) async {
final response = await BemeliUpdateService.initializeService(baseURL);
if (response != null) {
final data = response.data[0];
if (Platform.isAndroid && data.andriod && version != data.versioKey) {
showDialog(
context: context,
builder: (context) => UpdateWidget(
title: data.title,
desc: data.desc,
topImage: data.image,
isForce: false,
submitButton: data.submitButton,
skipButton: data.ignoreButton,
onSubmit: data.andriodClick,
),
);
} else if (Platform.isIOS && data.ios && version != data.versioKey) {
showDialog(
context: context,
builder: (context) => UpdateWidget(
title: data.title,
desc: data.desc,
topImage: data.image,
isForce: data.forceUpdate,
submitButton: data.submitButton,
onSubmit: data.iosClick,
skipButton: data.ignoreButton,
),
);
}
}
}