fixed history
This commit is contained in:
@ -23,6 +23,7 @@ class Destination {
|
||||
double? checkin_point;
|
||||
double? buy_point;
|
||||
int? hidden_location;
|
||||
String? checkin_image;
|
||||
|
||||
Destination({
|
||||
this.name,
|
||||
@ -46,7 +47,8 @@ class Destination {
|
||||
this.cp,
|
||||
this.checkin_point,
|
||||
this.buy_point,
|
||||
this.hidden_location
|
||||
this.hidden_location,
|
||||
this.checkin_image
|
||||
});
|
||||
|
||||
factory Destination.fromMap(Map<String, dynamic> json) {
|
||||
@ -76,7 +78,8 @@ class Destination {
|
||||
cp: json['cp'],
|
||||
checkin_point: json['checkin_point'],
|
||||
buy_point: json['buy_point'],
|
||||
hidden_location: json['hidden_location']
|
||||
hidden_location: json['hidden_location'],
|
||||
checkin_image: json['checkin_image']
|
||||
);
|
||||
}
|
||||
|
||||
@ -105,7 +108,8 @@ class Destination {
|
||||
'cp' : cp,
|
||||
'checkin_point' : checkin_point,
|
||||
'buy_point' : buy_point,
|
||||
'hidden_location' : hidden_location
|
||||
'hidden_location' : hidden_location,
|
||||
'checkin_image': checkin_image
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -442,7 +442,7 @@ class DestinationController extends GetxController {
|
||||
|
||||
try {
|
||||
print("--- 000 ---- $skip_gps----");
|
||||
await Future.delayed(const Duration(milliseconds: 1500));
|
||||
await Future.delayed(const Duration(milliseconds: 3500));
|
||||
final la = current_lat;
|
||||
final ln = current_lon;
|
||||
for (GeoJsonFeature fs in indexController.locations[0].collection) {
|
||||
@ -541,6 +541,7 @@ class DestinationController extends GetxController {
|
||||
|
||||
if (ddd.isEmpty) {
|
||||
destination.checkedin = true;
|
||||
destination.checkin_image = imageurl;
|
||||
await db.insertDestination(destination);
|
||||
}
|
||||
|
||||
|
||||
@ -41,17 +41,24 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
print("----- history -----");
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 150,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: ListView.builder(
|
||||
itemCount: dests.length,
|
||||
itemBuilder: (ctx, index) {
|
||||
print("--- photo ${dests[index].checkin_image!} ----");
|
||||
return ListTile(
|
||||
title: Text(dests[index].name ?? ""),
|
||||
subtitle:
|
||||
Text(dests[index].address ?? ""),
|
||||
leading: dests[0].photos != null
|
||||
? Container(width: 100, height: 100, child: Image.file(File(dests[0].photos!)))
|
||||
leading: dests[index].checkin_image != null
|
||||
? Container(width: 100, height: 100, child: Image.file(File(dests[index].checkin_image!)))
|
||||
: Container(),
|
||||
trailing: ElevatedButton(
|
||||
child: Text(dests[index].cp.toString()),
|
||||
style: ElevatedButton.styleFrom(shape: CircleBorder()),
|
||||
onPressed: () {
|
||||
|
||||
},),
|
||||
);
|
||||
}));
|
||||
} else {
|
||||
|
||||
@ -48,7 +48,8 @@ class DatabaseHelper{
|
||||
cp REAL,
|
||||
checkin_point REAL,
|
||||
buy_point REAL,
|
||||
hidden_location INTEGER
|
||||
hidden_location INTEGER,
|
||||
checkin_image TEXT
|
||||
)
|
||||
''');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user