-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the text field hang issue on lock and unlock the device. (#197)
* Fixed the checkbox issue for gender selection when UI spec set to checkbox Signed-off-by: G S Prakash <[email protected]> * Fixed the textformfield issue while lock and unlocked Signed-off-by: G S Prakash <[email protected]> --------- Signed-off-by: G S Prakash <[email protected]>
- Loading branch information
1 parent
9a43da5
commit ce7618d
Showing
2 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
|
||
class LifecycleEventHandler extends WidgetsBindingObserver { | ||
final AsyncCallback resumeCallBack; | ||
final AsyncCallback suspendingCallBack; | ||
|
||
LifecycleEventHandler({ | ||
required this.resumeCallBack, | ||
required this.suspendingCallBack, | ||
}); | ||
|
||
@override | ||
Future<void> didChangeAppLifecycleState(AppLifecycleState state) async { | ||
switch (state) { | ||
case AppLifecycleState.resumed: | ||
if (resumeCallBack != null) { | ||
await resumeCallBack(); | ||
} | ||
break; | ||
case AppLifecycleState.inactive: | ||
case AppLifecycleState.paused: | ||
case AppLifecycleState.detached: | ||
if (suspendingCallBack != null) { | ||
await suspendingCallBack(); | ||
} | ||
break; | ||
case AppLifecycleState.hidden: | ||
} | ||
} | ||
} |