update forced checkin for start point and nearbt start points

This commit is contained in:
2023-11-15 16:27:28 +05:30
parent e8d65ba725
commit 85b8c4705f
3 changed files with 45 additions and 8 deletions

View File

@ -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");

View File

@ -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)

View File

@ -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,
),
))
],
);
}