update forced checkin for start point and nearbt start points
This commit is contained in:
@ -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");
|
||||
|
||||
@ -548,7 +548,9 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
),
|
||||
|
||||
// forced start / checkin
|
||||
distanceToDest <= 100
|
||||
distanceToDest <=
|
||||
destinationController
|
||||
.getForcedChckinDistance(destination)
|
||||
? ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context)
|
||||
|
||||
@ -94,13 +94,25 @@ class MapWidget extends StatelessWidget {
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
color: Colors.white.withOpacity(0.4),
|
||||
child: Text(TextUtils.getDisplayTextFeture(i),
|
||||
style: const TextStyle(
|
||||
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.bold,
|
||||
color: Colors.red,
|
||||
))),
|
||||
fontWeight: FontWeight.w700,
|
||||
// アウトラインの色と幅を設定
|
||||
foreground: Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 1
|
||||
..color = Colors.white,
|
||||
),
|
||||
))
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user