diff --git a/lib/pages/destination/destination_controller.dart b/lib/pages/destination/destination_controller.dart index 464ab6b..f74500d 100644 --- a/lib/pages/destination/destination_controller.dart +++ b/lib/pages/destination/destination_controller.dart @@ -667,6 +667,29 @@ class DestinationController extends GetxController { super.onInit(); } + int getForcedChckinDistance(Destination dest) { + int _retValue = 100; + if (dest.cp == -1) { + return 500; + } + Destination? ds; + for (Destination d in destinations) { + if (d.cp == -1) { + ds = d; + } + } + if (ds != null) { + var distance = const Distance(); + double distanceToDest = distance.as(LengthUnit.Meter, + LatLng(dest.lat!, dest.lon!), LatLng(ds.lat!, ds.lon!)); + if (distanceToDest <= 500) { + return 500; + } + } + + return _retValue; + } + readUserToken() async { final SharedPreferences prefs = await SharedPreferences.getInstance(); indexController.userToken = prefs.getString("user_token"); diff --git a/lib/widgets/bottom_sheet_new.dart b/lib/widgets/bottom_sheet_new.dart index ef75ae1..d4212c6 100644 --- a/lib/widgets/bottom_sheet_new.dart +++ b/lib/widgets/bottom_sheet_new.dart @@ -548,7 +548,9 @@ class BottomSheetNew extends GetView { ), // forced start / checkin - distanceToDest <= 100 + distanceToDest <= + destinationController + .getForcedChckinDistance(destination) ? ElevatedButton( style: ElevatedButton.styleFrom( backgroundColor: Theme.of(context) diff --git a/lib/widgets/map_widget.dart b/lib/widgets/map_widget.dart index 1749496..8cfbe41 100644 --- a/lib/widgets/map_widget.dart +++ b/lib/widgets/map_widget.dart @@ -94,13 +94,25 @@ class MapWidget extends StatelessWidget { )), ), Container( - color: Colors.white.withOpacity(0.4), - child: Text(TextUtils.getDisplayTextFeture(i), - style: const TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold, - color: Colors.red, - ))), + color: Colors.purple.withOpacity(0.4), + // child: Text(TextUtils.getDisplayTextFeture(i), + // style: const TextStyle( + // fontSize: 16, + // fontWeight: FontWeight.bold, + // color: Colors.red, + // ))), + child: Text( + TextUtils.getDisplayTextFeture(i), + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + // アウトラインの色と幅を設定 + foreground: Paint() + ..style = PaintingStyle.stroke + ..strokeWidth = 1 + ..color = Colors.white, + ), + )) ], ); }