update
This commit is contained in:
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/home/home_controller.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class BottomSheetWidget extends StatelessWidget {
|
||||
//const BottomSheetWidget({ Key? key }, GeoJsonFeature? pt) : super(key: key);
|
||||
@ -17,63 +18,163 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
void _launchURL(url) async {
|
||||
if (!await launch(url)) throw 'Could not launch $url';
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).viewInsets.bottom,
|
||||
),
|
||||
child: Container(
|
||||
alignment: Alignment.topLeft,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 35.0,
|
||||
alignment: Alignment.center,
|
||||
color: Colors.black12,
|
||||
child: Obx(() =>
|
||||
Text(homeController.currentFeature[0].properties!["location_name"], style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed:(){
|
||||
print("next");
|
||||
homeController.makeNext(homeController.currentFeature[0]);
|
||||
},
|
||||
icon: Icon(Icons.delete_outlined)
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Obx(() => getImage(homeController.currentFeature[0])),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 66.0,)
|
||||
],
|
||||
),
|
||||
],
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 8.0,),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
MaterialButton(
|
||||
onPressed: () {
|
||||
homeController.makePrevious(homeController.currentFeature[0]);
|
||||
},
|
||||
color: Colors.blue,
|
||||
textColor: Colors.white,
|
||||
child: Icon(
|
||||
Icons.arrow_back_ios,
|
||||
size: 10,
|
||||
),
|
||||
padding: EdgeInsets.all(16),
|
||||
shape: CircleBorder(),
|
||||
),
|
||||
)
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
child: Obx(() =>
|
||||
Text(homeController.currentFeature[0].properties!["location_name"], style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
MaterialButton(
|
||||
onPressed: () {
|
||||
homeController.makeNext(homeController.currentFeature[0]);
|
||||
},
|
||||
color: Colors.blue,
|
||||
textColor: Colors.white,
|
||||
child: Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 10,
|
||||
),
|
||||
padding: EdgeInsets.all(16),
|
||||
shape: CircleBorder(),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
height: 360.0,
|
||||
child: Obx(() => getImage(homeController.currentFeature[0])),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
homeController.currentFeature[0].properties!["address"] != null ?
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("address".tr, style: TextStyle(fontWeight: FontWeight.bold),),
|
||||
SizedBox(width: 12.0,),
|
||||
Obx(() => Text(homeController.currentFeature[0].properties!["address"],
|
||||
style: TextStyle(color: Colors.blue,),
|
||||
))
|
||||
],
|
||||
): Container(width: 0.0, height: 0,),
|
||||
homeController.currentFeature[0].properties!["phone"] != null ?
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("telephone".tr, style: TextStyle(fontWeight: FontWeight.bold),),
|
||||
SizedBox(width: 12.0,),
|
||||
Obx(() => Text(homeController.currentFeature[0].properties!["phone"],
|
||||
style: TextStyle(color: Colors.blue,),
|
||||
))
|
||||
],
|
||||
): Container(width: 0, height: 0,),
|
||||
homeController.currentFeature[0].properties!["email"] != null ?
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("email".tr, style: TextStyle(fontWeight: FontWeight.bold),),
|
||||
SizedBox(width: 12.0,),
|
||||
Obx(() => Text(homeController.currentFeature[0].properties!["email"],
|
||||
style: TextStyle(color: Colors.blue,),
|
||||
))
|
||||
],
|
||||
): Container(width: 0, height: 0,),
|
||||
homeController.currentFeature[0].properties!["webcontents"] != null ?
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("web".tr, style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
SizedBox(width: 12.0,),
|
||||
Obx(() => InkWell(
|
||||
onTap: (){
|
||||
_launchURL(homeController.currentFeature[0].properties!["webcontents"]);
|
||||
},
|
||||
child: Text(homeController.currentFeature[0].properties!["webcontents"],
|
||||
style: TextStyle(color: Colors.blue,),
|
||||
),
|
||||
))
|
||||
],
|
||||
): Container(width: 0.0, height: 0.0,),
|
||||
homeController.currentFeature[0].properties!["videos"] != null ?
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("video".tr, style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
SizedBox(width: 12.0,),
|
||||
Obx(() => Text(homeController.currentFeature[0].properties!["videos"],
|
||||
style: TextStyle(color: Colors.blue,),
|
||||
))
|
||||
],
|
||||
): Container(width: 0.0, height: 0.0,),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 20.0,),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: (){},
|
||||
child: Text("schedule_point".tr)
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: (){},
|
||||
child: Text("schedule_point".tr)
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: (){},
|
||||
child: Text("schedule_point".tr)
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(height: 60.0,),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user