Skip to content

Commit

Permalink
fix realtime view controller
Browse files Browse the repository at this point in the history
  • Loading branch information
LezdCS committed Jun 8, 2024
1 parent 5c50931 commit 75fad20
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class RealtimeIrlViewController extends GetxController {
realtimeIrl.status.value = RtIrlStatus.updating;
timerRtIrl = Timer.periodic(const Duration(seconds: 4), (Timer t) async {
DataState<Position> p = await determinePosition();
if (p is DataSuccess && realtimeIrl.status == RtIrlStatus.updating) {
if (p is DataSuccess && realtimeIrl.status.value == RtIrlStatus.updating) {
DataState updateResult = await realtimeIrl.updatePosition(p.data!);
if(updateResult is DataFailed) {
realtimeIrl.status.value = RtIrlStatus.stopped;
Expand Down
14 changes: 8 additions & 6 deletions lib/src/presentation/widgets/tabs/realtime_irl_tab_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ class RealtimeIrlTabView extends GetView<RealtimeIrlViewController> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Obx(() => Container(
alignment: Alignment.center,
child: controller.realtimeIrl.status.value == RtIrlStatus.updating
? _stopUpdatingPosition()
: _startUpdatingPosition(),
),),
child: Obx(
() => Container(
alignment: Alignment.center,
child: controller.realtimeIrl.status.value == RtIrlStatus.updating
? _stopUpdatingPosition()
: _startUpdatingPosition(),
),
),
);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.4.0+58
version: 2.4.1+59

environment:
sdk: '>=2.19.0-0 <4.0.0'
Expand Down

0 comments on commit 75fad20

Please sign in to comment.