Check WorkInfo is not Null #374

Merged
dan merged 2 commits from cwtch1.6.1-fixes into trunk 2022-02-16 23:58:45 +00:00
2 changed files with 3 additions and 1 deletions

View File

@ -218,7 +218,7 @@ class MainActivity: FlutterActivity() {
WorkManager.getInstance(this).enqueue(workRequest)
WorkManager.getInstance(applicationContext).getWorkInfoByIdLiveData(workRequest.id).observe(
this, Observer { workInfo ->
if (workInfo.state == WorkInfo.State.SUCCEEDED) {
if (workInfo != null && workInfo.state == WorkInfo.State.SUCCEEDED) {
val res = workInfo.outputData.keyValueMap.toString()
result.success(workInfo.outputData.getString("result"))
}

View File

@ -140,6 +140,7 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
trailing: Container(
width: MediaQuery.of(context).size.width / 4,
child: DropdownButton(
isExpanded: true,
value: settings.uiColumnModeLandscape.toString(),
onChanged: (String? newValue) {
settings.uiColumnModeLandscape = Settings.uiColumnModeFromString(newValue!);
@ -197,6 +198,7 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
trailing: Container(
width: MediaQuery.of(context).size.width / 4,
child: DropdownButton(
isExpanded: true,
value: settings.notificationContent,
onChanged: (NotificationContent? newValue) {
settings.notificationContent = newValue!;