Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix realtime view controller #209

Merged
merged 1 commit into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading