update
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
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:rogapp/index/index_controller.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class BottomSheetWidget extends StatelessWidget {
|
||||
//const BottomSheetWidget({ Key? key }, GeoJsonFeature? pt) : super(key: key);
|
||||
|
||||
final HomeController homeController = Get.find<HomeController>();
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
Image getImage(GeoJsonFeature? gf){
|
||||
if(gf!.properties!["photos"] == null || gf.properties!["photos"] == ""){
|
||||
@ -47,7 +47,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
children: [
|
||||
MaterialButton(
|
||||
onPressed: () {
|
||||
homeController.makePrevious(homeController.currentFeature[0]);
|
||||
indexController.makePrevious(indexController.currentFeature[0]);
|
||||
},
|
||||
color: Colors.blue,
|
||||
textColor: Colors.white,
|
||||
@ -62,7 +62,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
child: Obx(() =>
|
||||
Text(homeController.currentFeature[0].properties!["location_name"], style: TextStyle(
|
||||
Text(indexController.currentFeature[0].properties!["location_name"], style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@ -72,7 +72,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
),
|
||||
MaterialButton(
|
||||
onPressed: () {
|
||||
homeController.makeNext(homeController.currentFeature[0]);
|
||||
indexController.makeNext(indexController.currentFeature[0]);
|
||||
},
|
||||
color: Colors.blue,
|
||||
textColor: Colors.white,
|
||||
@ -90,7 +90,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
height: 360.0,
|
||||
child: Obx(() => getImage(homeController.currentFeature[0])),
|
||||
child: Obx(() => getImage(indexController.currentFeature[0])),
|
||||
)
|
||||
),
|
||||
],
|
||||
@ -102,7 +102,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||
child: Column(
|
||||
children: [
|
||||
homeController.currentFeature[0].properties!["address"] != null ?
|
||||
indexController.currentFeature[0].properties!["address"] != null ?
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -115,7 +115,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Container(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Obx(() => Text(homeController.currentFeature[0].properties!["address"] ?? '',
|
||||
child: Obx(() => Text(indexController.currentFeature[0].properties!["address"] ?? '',
|
||||
style: TextStyle(color: Colors.blue,),
|
||||
softWrap: true,
|
||||
overflow: TextOverflow.ellipsis,)
|
||||
@ -124,7 +124,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
): Container(width: 0.0, height: 0,),
|
||||
homeController.currentFeature[0].properties!["phone"] != null ?
|
||||
indexController.currentFeature[0].properties!["phone"] != null ?
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -135,7 +135,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Container(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Obx(() => Text(homeController.currentFeature[0].properties!["phone"] ?? '',
|
||||
child: Obx(() => Text(indexController.currentFeature[0].properties!["phone"] ?? '',
|
||||
style: TextStyle(color: Colors.blue,),
|
||||
overflow: TextOverflow.ellipsis,)
|
||||
),
|
||||
@ -143,7 +143,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
): Container(width: 0, height: 0,),
|
||||
homeController.currentFeature[0].properties!["email"] != null ?
|
||||
indexController.currentFeature[0].properties!["email"] != null ?
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -154,7 +154,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Container(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Obx(() => Text(homeController.currentFeature[0].properties!["email"] ?? '',
|
||||
child: Obx(() => Text(indexController.currentFeature[0].properties!["email"] ?? '',
|
||||
style: TextStyle(color: Colors.blue,),
|
||||
overflow: TextOverflow.ellipsis,)
|
||||
),
|
||||
@ -162,7 +162,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
): Container(width: 0, height: 0,),
|
||||
homeController.currentFeature[0].properties!["webcontents"] != null ?
|
||||
indexController.currentFeature[0].properties!["webcontents"] != null ?
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -176,9 +176,9 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
alignment: Alignment.topLeft,
|
||||
child: Obx(() => InkWell(
|
||||
onTap: (){
|
||||
_launchURL(homeController.currentFeature[0].properties!["webcontents"]);
|
||||
_launchURL(indexController.currentFeature[0].properties!["webcontents"]);
|
||||
},
|
||||
child: Text(homeController.currentFeature[0].properties!["webcontents"] ?? '',
|
||||
child: Text(indexController.currentFeature[0].properties!["webcontents"] ?? '',
|
||||
style: TextStyle(color: Colors.blue,),
|
||||
softWrap: false,
|
||||
overflow: TextOverflow.fade,),
|
||||
@ -187,7 +187,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
): Container(width: 0.0, height: 0.0,),
|
||||
homeController.currentFeature[0].properties!["videos"] != null ?
|
||||
indexController.currentFeature[0].properties!["videos"] != null ?
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -198,7 +198,7 @@ class BottomSheetWidget extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Container(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Obx(() => Text(homeController.currentFeature[0].properties!["videos"] ?? '',
|
||||
child: Obx(() => Text(indexController.currentFeature[0].properties!["videos"] ?? '',
|
||||
style: TextStyle(color: Colors.blue,),
|
||||
overflow: TextOverflow.ellipsis,)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user