Files
rog_app/lib/widgets/bottom_sheet_new.dart

712 lines
29 KiB
Dart
Raw Normal View History

2022-06-27 12:15:54 +05:30
import 'package:flutter/material.dart';
import 'package:geojson/geojson.dart';
2023-02-16 19:36:39 +05:30
import 'package:geolocator/geolocator.dart';
2022-06-27 12:15:54 +05:30
import 'package:get/get.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:image_picker/image_picker.dart';
2022-07-09 22:51:34 +05:30
import 'package:latlong2/latlong.dart';
2022-11-05 22:02:21 +05:30
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
2022-07-09 22:51:34 +05:30
import 'package:rogapp/model/destination.dart';
2023-06-09 15:55:59 +05:30
import 'package:rogapp/model/location_response.dart';
2022-06-27 12:15:54 +05:30
import 'package:rogapp/routes/app_pages.dart';
2023-06-09 15:55:59 +05:30
import 'package:rogapp/screens/auth/controller/auth_controller.dart';
import 'package:rogapp/screens/home/home_controller.dart';
import 'package:rogapp/screens/home/location_controller.dart';
2022-11-05 22:02:21 +05:30
import 'package:rogapp/services/external_service.dart';
2023-06-09 15:55:59 +05:30
import 'package:rogapp/utils/checkin_db_helper.dart';
2022-10-30 21:43:29 +05:30
import 'package:rogapp/utils/const.dart';
2022-07-09 22:51:34 +05:30
import 'package:rogapp/utils/database_helper.dart';
2022-10-12 21:46:17 +05:30
import 'package:rogapp/utils/text_util.dart';
2022-06-27 12:15:54 +05:30
import 'package:rogapp/widgets/bottom_sheet_controller.dart';
import 'package:url_launcher/url_launcher.dart';
class BottomSheetNew extends GetView<BottomSheetController> {
BottomSheetNew({ Key? key }) : super(key: key);
2023-06-09 15:55:59 +05:30
//final IndexController indexController = Get.find<IndexController>();
//final DestinationController destinationController = Get.find<DestinationController>();
HomeController homeController = Get.find<HomeController>();
LocationController locationController = Get.find<LocationController>();
AuthController authController = Get.find<AuthController>();
CheckinDBHelper checkinDBHelper = CheckinDBHelper.instance;
2022-06-27 12:15:54 +05:30
2022-07-14 23:10:24 +05:30
Image getImage(){
2022-10-30 21:43:29 +05:30
String server_url = ConstValues.currentServer();
2022-09-27 17:52:54 +05:30
//print("----- rogaining mode 1");
2023-06-09 15:55:59 +05:30
if(homeController.currentFeature.isEmpty || homeController.currentFeature[0].properties!.photos == ""){
2022-07-14 23:10:24 +05:30
return Image(image: AssetImage('assets/images/empty_image.png'));
}
else{
2022-09-27 17:52:54 +05:30
//print("@@@@@@@@@@@@@ rog mode -------------------- ${indexController.currentDestinationFeature[0].photos} @@@@@@@@@@@");
2023-06-09 15:55:59 +05:30
String _photo = homeController.currentFeature[0].properties!.photos!;
2022-09-27 17:52:54 +05:30
if(_photo.contains('http')){
return Image(image: NetworkImage(
2023-06-09 15:55:59 +05:30
homeController.currentFeature[0].properties!.photos!,
2022-09-27 17:52:54 +05:30
),
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Image.asset("assets/images/empty_image.png");
},
);
}
else {
return Image(image: NetworkImage(
2023-06-09 15:55:59 +05:30
'${server_url}/media/compressed/' + homeController.currentFeature[0].properties!.photos!,
2022-09-27 17:52:54 +05:30
),
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Image.asset("assets/images/empty_image.png");
},
2022-07-14 23:10:24 +05:30
);
2022-09-27 17:52:54 +05:30
}
2022-07-14 23:10:24 +05:30
}
2022-06-27 12:15:54 +05:30
}
void _launchURL(url) async {
if (!await launch(url)) throw 'Could not launch $url';
}
2023-06-09 15:55:59 +05:30
// bool isInDestination(String locationid){
// int lid = int.parse(locationid);
// if(destinationController.destinations.where((element) => element.location_id == lid).length > 0){
// return true;
// }
// else{
// return false;
// }
// }
2022-06-27 12:15:54 +05:30
@override
Widget build(BuildContext context) {
2023-06-09 15:55:59 +05:30
locationController.skip_gps = true;
return destinationSheet(context);
2022-07-14 23:10:24 +05:30
}
2022-09-01 19:14:18 +05:30
// Show destination detais
2022-07-14 23:10:24 +05:30
SingleChildScrollView destinationSheet(BuildContext context) {
2022-10-30 21:43:29 +05:30
2022-07-14 23:10:24 +05:30
return SingleChildScrollView(
child: Column(
2022-06-27 12:15:54 +05:30
children: [
2022-07-14 23:10:24 +05:30
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Row(
children: [
MaterialButton(
onPressed: () {
2022-09-29 15:32:33 +05:30
Get.back();
//destinationController.makePrevious(indexController.currentDestinationFeature[0]);
2022-07-14 23:10:24 +05:30
},
color: Colors.blue,
textColor: Colors.white,
child: Icon(
Icons.arrow_back_ios,
size: 14,
),
padding: EdgeInsets.all(16),
shape: CircleBorder(),
),
Expanded(
child: Container(
alignment: Alignment.center,
child: Obx(() =>
2023-06-09 15:55:59 +05:30
authController.authList.isNotEmpty ?
Text("${TextUtils.getDisplayText(homeController.currentFeature[0])} : ${TextUtils.getDisplayText(homeController.currentFeature[0])} : ${homeController.currentFeature[0].properties!.location_name}", style: TextStyle(
2022-10-12 21:46:17 +05:30
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
)
:
2023-06-09 15:55:59 +05:30
Text("${homeController.currentFeature[0].properties!.location_name}", style: TextStyle(
2022-10-12 21:46:17 +05:30
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
)
2022-06-27 12:15:54 +05:30
),
2022-07-14 23:10:24 +05:30
),
2022-06-27 12:15:54 +05:30
),
],
),
2022-07-14 23:10:24 +05:30
),
),
Row(
children: [
Expanded(
child: SizedBox(
height: 260.0,
child: Obx(() => getImage()),
)
2022-06-27 12:15:54 +05:30
),
2022-07-14 23:10:24 +05:30
],
),
2022-10-30 21:43:29 +05:30
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Obx(() =>
2023-06-09 15:55:59 +05:30
homeController.currentBound.isNotEmpty && locationController.is_in_checkin.value == true && locationController.is_at_start.value == false ?
2022-10-30 21:43:29 +05:30
Row(
children: [
ElevatedButton(
2023-06-09 15:55:59 +05:30
onPressed: () async {
final _locId = homeController.currentFeature[0].location_id;
final _exist = await checkinDBHelper.exists(_locId!);
if(_exist){
if(homeController.currentFeature[0].properties!.hidden_location == 0){
locationController.skip_gps = false;
locationController.is_photo_shoot.value = true;
2022-11-05 22:02:21 +05:30
Get.back();
}
else{
2023-06-09 15:55:59 +05:30
locationController.makeCheckin(homeController.currentFeature[0], true, "");
if(homeController.currentFeature[0].properties!.cp != -1){
locationController.rogaining_counted.value =true;
2022-11-05 22:02:21 +05:30
}
2022-10-30 21:43:29 +05:30
}
2022-11-05 22:02:21 +05:30
2022-10-30 21:43:29 +05:30
}
else{
2023-06-09 15:55:59 +05:30
locationController.makeCheckin(homeController.currentFeature[0], false, "");
2022-10-30 21:43:29 +05:30
}
2022-11-05 22:02:21 +05:30
//Get.back();
2022-10-30 21:43:29 +05:30
},
2023-06-09 15:55:59 +05:30
child: FutureBuilder<bool>(
future: checkinDBHelper.exists(homeController.currentFeature[0].location_id!),
builder: (BuildContext context, AsyncSnapshot<bool> snapshot){
if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator(); // return a circular progress indicator while waiting
} else {
if (snapshot.hasError)
return Text('Error: ${snapshot.error}'); // return error text if something went wrong
else
return snapshot.data! ?
const Text("チェックイン") : // Widget to show if locationId exists
const Text("チェックアウト");
}
},
),
2022-10-30 21:43:29 +05:30
),
],
)
:
Container(),
),
Obx(() =>
2023-06-09 15:55:59 +05:30
locationController.is_at_start.value == true ?
2022-10-30 21:43:29 +05:30
ElevatedButton(
onPressed: (){
2023-06-09 15:55:59 +05:30
locationController.is_in_rog.value = true;
locationController.addToRogaining(locationController.current_lat, locationController.current_lon, homeController.currentFeature[0].location_id!);
2022-11-05 22:02:21 +05:30
ExternalService().StartRogaining().then((value) => Get.back());
2022-10-30 21:43:29 +05:30
},
2023-06-09 15:55:59 +05:30
child:
FutureBuilder<bool>(
future: checkinDBHelper.exists(homeController.currentFeature[0].location_id!),
builder: (context, snapshot){
if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator(); // return a circular progress indicator while waiting
} else {
if (snapshot.hasError)
return Text('Error: ${snapshot.error}'); // return error text if something went wrong
else
return snapshot.data! ?
const Text("ロゲイニングを開始") : // Widget to show if locationId exists
const Text("間違った目的地...");
}
},
2022-10-30 21:43:29 +05:30
)
)
:
Container(),
),
Obx(() =>
2023-06-09 15:55:59 +05:30
locationController.is_at_goal.value == true && locationController.rogaining_counted ==true ?
2022-10-30 21:43:29 +05:30
ElevatedButton(
onPressed: (){
Get.toNamed(AppPages.CAMERA_PAGE);
Get.back();
},
2023-06-09 15:55:59 +05:30
child:
FutureBuilder<bool>(
future: checkinDBHelper.exists(homeController.currentFeature[0].location_id!),
builder: (context, snapshot){
if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator(); // return a circular progress indicator while waiting
} else {
if (snapshot.hasError)
return Text('Error: ${snapshot.error}'); // return error text if something went wrong
else
return snapshot.data! ?
const Text("ロゲイニングを終える") : // Widget to show if locationId exists
const Text("間違った目的地 ...");
}
},
2022-10-30 21:43:29 +05:30
)
)
:
Container(),
),
],
),
2022-07-14 23:10:24 +05:30
Obx(() =>
2023-06-09 15:55:59 +05:30
homeController.currentFeature[0].properties!.address != null ?
getDetails(context, "address".tr, homeController.currentFeature[0].properties!.address! ?? '')
2022-07-14 23:10:24 +05:30
:
Container(width: 0.0, height: 0,),
),
Obx(() =>
2023-06-09 15:55:59 +05:30
homeController.currentFeature[0].properties!.phone != null ?
getDetails(context, "telephone".tr, homeController.currentFeature[0].properties!.phone! ?? '')
2022-07-14 23:10:24 +05:30
:
Container(width: 0.0, height: 0,),
),
Obx(() =>
2023-06-09 15:55:59 +05:30
homeController.currentFeature[0].properties!.email != null ?
getDetails(context, "email".tr, homeController.currentFeature[0].properties!.email! ?? '')
2022-07-14 23:10:24 +05:30
:
Container(width: 0.0, height: 0,),
),
Obx(() =>
2023-06-09 15:55:59 +05:30
homeController.currentFeature[0].properties!.webcontents != null ?
getDetails(context, "web".tr, homeController.currentFeature[0].properties!.webcontents! ?? '', isurl: true)
2022-07-14 23:10:24 +05:30
:
Container(width: 0.0, height: 0,),
),
Obx(() =>
2023-06-09 15:55:59 +05:30
homeController.currentFeature[0].properties!.videos != null ?
getDetails(context, "video".tr, homeController.currentFeature[0].properties!.videos! ?? '', isurl: true)
2022-07-14 23:10:24 +05:30
:
Container(width: 0.0, height: 0,),
),
SizedBox(height: 20.0,),
2022-10-30 21:43:29 +05:30
// Obx(() =>
// //wantToGo(context),
2022-07-14 23:10:24 +05:30
2022-10-30 21:43:29 +05:30
// FutureBuilder<Widget>(
// future: wantToGo(context),
// builder: (context, snapshot) {
// return Container(
// child: snapshot.data,
// );
// },
// ),
2022-07-14 23:10:24 +05:30
2022-10-30 21:43:29 +05:30
// ),
2022-07-14 23:10:24 +05:30
SizedBox(height: 60.0,)
],
),
);
}
2022-07-10 23:50:43 +05:30
2022-11-02 22:47:49 +05:30
2022-09-01 19:14:18 +05:30
// show add location details
2022-07-14 23:10:24 +05:30
SingleChildScrollView detailsSheet(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Row(
children: [
MaterialButton(
onPressed: () {
2022-09-29 15:32:33 +05:30
Get.back();
//indexController.makePrevious(indexController.currentFeature[0]);
2022-07-14 23:10:24 +05:30
},
color: Colors.blue,
textColor: Colors.white,
child: Icon(
Icons.arrow_back_ios,
2023-01-26 23:30:48 +05:30
//Icons.arrow_back_ios,
2022-07-14 23:10:24 +05:30
size: 14,
),
padding: EdgeInsets.all(16),
shape: CircleBorder(),
),
Expanded(
child: Container(
alignment: Alignment.center,
child: Obx(() =>
2023-06-09 15:55:59 +05:30
Text(homeController.currentFeature[0].properties!.location_name!, style: TextStyle(
2022-07-14 23:10:24 +05:30
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
)
),
),
),
],
2022-07-10 23:50:43 +05:30
),
2022-07-14 23:10:24 +05:30
),
),
Row(
children: [
Expanded(
child: SizedBox(
height: 260.0,
child: Obx(() => getImage()),
)
2022-07-10 23:50:43 +05:30
),
2022-06-27 12:15:54 +05:30
],
2022-07-14 23:10:24 +05:30
),
2022-07-22 10:27:11 +05:30
Obx(() =>
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
2022-11-04 14:11:18 +05:30
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
2022-11-08 15:29:42 +05:30
Obx(() =>
2023-06-09 15:55:59 +05:30
FutureBuilder<bool>(
future: checkinDBHelper.exists(homeController.currentFeature[0].location_id!),
builder: (context, snapshot){
if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator(); // return a circular progress indicator while waiting
} else {
if (snapshot.hasError)
return Text('Error: ${snapshot.error}'); // return error text if something went wrong
else
if(homeController.currentFeature[0].properties!.cp == -1 && locationController.is_at_start.value ==true){
return ElevatedButton(
onPressed: (){
locationController.is_in_rog.value = true;
locationController.addToRogaining(locationController.current_lat, locationController.current_lon, homeController.currentFeature[0].location_id!);
ExternalService().StartRogaining().then((value) => Get.back());
},
child: Text(
// start
snapshot.data! == true ?
"ロゲイニングを開始"
:
"間違った目的地..."
)
);
}
else {
return Container();
}
}
},
)
2022-11-08 15:29:42 +05:30
),
Obx(() =>
2023-06-09 15:55:59 +05:30
locationController.is_at_goal.value == true && locationController.rogaining_counted ==true ?
2022-11-08 15:29:42 +05:30
ElevatedButton(
2022-11-04 14:11:18 +05:30
onPressed: (){
2022-11-08 15:29:42 +05:30
Get.toNamed(AppPages.CAMERA_PAGE);
2022-11-04 14:11:18 +05:30
Get.back();
},
2023-06-09 15:55:59 +05:30
child:
FutureBuilder<bool>(
future: checkinDBHelper.exists(homeController.currentFeature[0].location_id!),
builder: (context, snapshot){
if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator(); // return a circular progress indicator while waiting
} else {
if (snapshot.hasError)
return Text('Error: ${snapshot.error}'); // return error text if something went wrong
else
return snapshot.data! ?
const Text("ロゲイニングを終える") : // Widget to show if locationId exists
const Text("間違った目的地 ...");
}
},
2022-11-04 14:11:18 +05:30
)
2022-11-08 15:29:42 +05:30
)
:
Container(),
),
2022-11-04 14:11:18 +05:30
],
),
2022-07-22 10:27:11 +05:30
Row(
children: [
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
2023-06-09 15:55:59 +05:30
FutureBuilder<bool>(
future: checkinDBHelper.exists(homeController.currentFeature[0].location_id!),
builder: (context, snapshot){
if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator(); // return a circular progress indicator while waiting
} else {
if (snapshot.hasError)
return Text('Error: ${snapshot.error}'); // return error text if something went wrong
else{
if(snapshot.data == true){
return Container();
}
else{
return FutureBuilder<Widget>(
future: wantToGo(context),
builder: (context, snapshot) {
return Container(
child: snapshot.data,
);
},
);
}
}
}
},
)
// indexController.currentFeature[0].properties!["location_name"] != null && (indexController.currentFeature[0].properties!["location_name"] as String).isNotEmpty ?
// Flexible(child: Text(indexController.currentFeature[0].properties!["location_name"]))
// :
// Container(width: 0.0, height: 0,),
2022-07-22 10:27:11 +05:30
],
),
),
2023-02-16 19:36:39 +05:30
ElevatedButton(
onPressed:() async {
2023-06-09 15:55:59 +05:30
Feature mp = homeController.currentFeature[0];
2023-02-16 19:36:39 +05:30
Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
2023-06-09 15:55:59 +05:30
Feature ds = Feature(
latitude: position.latitude,
longitude: position.longitude
2023-02-16 19:36:39 +05:30
);
2023-06-09 15:55:59 +05:30
Feature tp = Feature(
latitude: mp.latitude,
longitude: mp.longitude
2023-02-16 19:36:39 +05:30
);
Get.back();
2023-06-09 15:55:59 +05:30
locationController.destinationMatrixFromCurrentPoint([ds, tp]);
2023-02-16 19:36:39 +05:30
},
child:Text("ここへ行く")),
2022-07-22 10:27:11 +05:30
],
),
SizedBox(height: 8.0,),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Icon(Icons.roundabout_left),
SizedBox(width: 8.0,),
2023-06-09 15:55:59 +05:30
homeController.currentFeature[0].properties!.address != null && homeController.currentFeature[0].properties!.address!.isNotEmpty ?
getDetails(context, "address".tr, homeController.currentFeature[0].properties!.address ?? '')
2022-07-22 10:27:11 +05:30
:
Container(width: 0.0, height: 0,),
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Icon(Icons.phone),
SizedBox(width: 8.0,),
2023-06-09 15:55:59 +05:30
homeController.currentFeature[0].properties!.phone != null && homeController.currentFeature[0].properties!.phone!.isNotEmpty ?
getDetails(context, "telephone".tr, homeController.currentFeature[0].properties!.phone ?? '')
2022-07-22 10:27:11 +05:30
:
Container(width: 0.0, height: 0,),
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Icon(Icons.email),
SizedBox(width: 8.0,),
2023-06-09 15:55:59 +05:30
homeController.currentFeature[0].properties!.email != null && homeController.currentFeature[0].properties!.email!.isNotEmpty ?
getDetails(context, "email".tr, homeController.currentFeature[0].properties!.email ?? '')
2022-07-22 10:27:11 +05:30
:
Container(width: 0.0, height: 0,),
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Icon(Icons.language),
SizedBox(width: 8.0,),
2023-06-09 15:55:59 +05:30
homeController.currentFeature[0].properties!.webcontents != null && homeController.currentFeature[0].properties!.webcontents!.isNotEmpty ?
getDetails(context, "web".tr, homeController.currentFeature[0].properties!.webcontents ?? '', isurl: true)
2022-07-22 10:27:11 +05:30
:
Container(width: 0.0, height: 0,),
],
),
2022-09-01 19:14:18 +05:30
),
2022-09-29 15:32:33 +05:30
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
SizedBox(width: 8.0,),
2023-06-09 15:55:59 +05:30
homeController.currentFeature[0].properties!.remark != null && homeController.currentFeature[0].properties!.remark!.isNotEmpty ?
getDetails(context, "remarks".tr, homeController.currentFeature[0].properties!.remark ?? '', isurl: false)
2022-09-29 15:32:33 +05:30
:
Container(width: 0.0, height: 0,),
],
),
),
2022-10-12 21:46:17 +05:30
// Text('${TextUtils.getDisplayText(indexController.currentFeature[0].properties!["cp"].toString())} - id: ${TextUtils.getDisplayText(indexController.currentFeature[0].properties!["checkin_point"].toString())}'),
2022-07-22 10:27:11 +05:30
],
),
)
2022-07-14 23:10:24 +05:30
),
SizedBox(height: 60.0,)
2022-06-27 12:15:54 +05:30
],
2022-07-14 23:10:24 +05:30
),
);
2022-06-27 12:15:54 +05:30
}
2022-11-02 22:47:49 +05:30
2022-07-10 23:50:43 +05:30
Future<Widget> wantToGo(BuildContext context)async {
2023-06-09 15:55:59 +05:30
2022-10-12 21:46:17 +05:30
2023-06-09 15:55:59 +05:30
bool _selected = await checkinDBHelper.exists(homeController.currentFeature[0].location_id!);
2022-07-14 23:10:24 +05:30
2022-07-10 23:50:43 +05:30
DatabaseHelper db = DatabaseHelper.instance;
return
Row(
2022-07-09 22:51:34 +05:30
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
2023-02-16 19:36:39 +05:30
mainAxisAlignment: MainAxisAlignment.spaceBetween,
2022-07-09 22:51:34 +05:30
children: [
2023-06-09 15:55:59 +05:30
ElevatedButton(
2022-07-14 23:10:24 +05:30
onPressed: () async {
2023-06-09 15:55:59 +05:30
Feature dest = homeController.currentFeature[0];
2022-07-14 23:10:24 +05:30
//print("------ curent destination is ${dest!.checkedIn}-------");
if(dest != null){
2022-07-25 19:56:32 +05:30
//print("------ curent destination is ${dest!.checkedin}-------::::::::::");
2023-06-09 15:55:59 +05:30
bool checkin = await checkinDBHelper.exists(homeController.currentFeature[0].location_id!);
locationController.makeCheckin(dest, checkin, "");
2022-07-14 23:10:24 +05:30
}
},
2023-06-09 15:55:59 +05:30
child:
FutureBuilder<bool>(
future: checkinDBHelper.exists(homeController.currentFeature[0].location_id!),
builder: (context, snapshot){
if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator();
}else {
if (snapshot.hasError)
return Text('Error: ${snapshot.error}'); // return error text if something went wrong
else
return snapshot.data! ?
const Text("チェックイン") : // Widget to show if locationId exists
const Text("チェックアウト");
}
},
)
)
2022-07-09 22:51:34 +05:30
],
2023-02-16 19:36:39 +05:30
),
2022-07-09 22:51:34 +05:30
],
);
}
2023-06-09 15:55:59 +05:30
// Widget getCheckin(BuildContext context){
// //print("------ currentAction ----- ${indexController.currentAction}-----");
// return Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// indexController.currentAction[0][0]["checkin"] == false ?
// Column(
// children: [
// Row(
// mainAxisSize: MainAxisSize.max,
// children: [
// ElevatedButton(
// child: Text("Image"), onPressed: (){
// final ImagePicker _picker = ImagePicker();
// _picker.pickImage(source: ImageSource.camera).then((value){
// //print("----- image---- ${value!.path}");
// });
// },
// )
// ],
// ),
// ElevatedButton(
// onPressed: (){},
// //onPressed: (){
// // if(indexController.currentAction.isNotEmpty){
// // //print(indexController.currentAction[0]);
// // indexController.currentAction[0][0]["checkin"] = true;
// // Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
// // indexController.currentAction.clear();
// // //print("---temp---${temp}");
// // indexController.currentAction.add([temp]);
// // }
// // indexController.makeAction(context);
// // },
// child: Text("checkin".tr)
// )
// ],
// )
// :
// ElevatedButton(
// onPressed: (){},
// // onPressed: (){
// // if(indexController.currentAction.isNotEmpty){
// // //print(indexController.currentAction[0]);
// // indexController.currentAction[0][0]["checkin"] = false;
// // Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
// // indexController.currentAction.clear();
// // //print("---temp---${temp}");
// // indexController.currentAction.add([temp]);
// // }
// // indexController.makeAction(context);
// // },
2022-07-14 23:10:24 +05:30
2023-06-09 15:55:59 +05:30
// child: Icon(
// Icons.favorite, color: Colors.red)
2022-06-27 12:15:54 +05:30
2023-06-09 15:55:59 +05:30
// ,
// )
// ],
// )
// ],
// );
// }
2022-06-27 12:15:54 +05:30
2022-07-14 23:10:24 +05:30
2022-06-27 12:15:54 +05:30
2022-07-14 23:10:24 +05:30
Widget getDetails(BuildContext context, String label, String text, {bool isurl=false}){
2022-06-27 12:15:54 +05:30
return Row(
2022-07-14 23:10:24 +05:30
mainAxisAlignment: MainAxisAlignment.center,
2022-06-27 12:15:54 +05:30
children: [
2022-07-14 23:10:24 +05:30
Text(label),
2022-06-27 12:15:54 +05:30
SizedBox(width: 10.0,),
2022-07-15 21:50:14 +05:30
InkWell(
onTap: (){
if(isurl){
2023-06-09 15:55:59 +05:30
_launchURL(homeController.currentFeature[0].properties!.webcontents);
2022-07-15 21:50:14 +05:30
}
},
2022-10-12 21:46:17 +05:30
child: Container(
width: MediaQuery.of(context).size.width - 160,
2022-10-30 21:43:29 +05:30
child: Text(text,
style: TextStyle(
color: isurl ? Colors.blue : Colors.black,
2022-10-12 21:46:17 +05:30
),
2022-10-30 21:43:29 +05:30
),
2022-10-12 21:46:17 +05:30
),
2022-07-15 21:50:14 +05:30
),
2022-06-27 12:15:54 +05:30
],
);
}
}