feat: lots of fixes
This commit is contained in:
@ -3,6 +3,8 @@ import 'dart:convert';
|
||||
|
||||
import 'package:fast_immutable_collections/fast_immutable_collections.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:ot_viewer_app/global_location_store.dart';
|
||||
import 'package:rust_core/option.dart';
|
||||
import 'package:anyhow/anyhow.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
@ -72,6 +74,16 @@ class UserPathBloc extends Bloc<UserPathEvent, UserPathState> {
|
||||
|
||||
@override
|
||||
void onTransition(Transition<UserPathEvent, UserPathState> transition) {
|
||||
super.onTransition(transition);
|
||||
|
||||
if (transition.nextState is MainUserPathState) {
|
||||
// add current location to global location thingy
|
||||
final pt = (transition.nextState as MainUserPathState).livePoints.lastOrNull;
|
||||
if (pt != null) {
|
||||
GetIt.I.get<GlobalLocationStoreCubit>().updatePoint(deviceId.$1, deviceId.$2, pt);
|
||||
}
|
||||
}
|
||||
|
||||
print("upb $deviceId: $transition");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user