80 lines
2.7 KiB
Dart
80 lines
2.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:geojson/geojson.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:rogapp/pages/home/home_controller.dart';
|
|
|
|
class BottomSheetWidget extends StatelessWidget {
|
|
//const BottomSheetWidget({ Key? key }, GeoJsonFeature? pt) : super(key: key);
|
|
|
|
final HomeController homeController = Get.find<HomeController>();
|
|
|
|
Image getImage(GeoJsonFeature? gf){
|
|
if(gf!.properties!["photos"] == null || gf.properties!["photos"] == ""){
|
|
return Image(image: AssetImage('assets/images/empty_image.png'));
|
|
}
|
|
else{
|
|
return Image(image: NetworkImage(gf.properties!["photos"]));
|
|
}
|
|
}
|
|
|
|
@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,)
|
|
],
|
|
),
|
|
],
|
|
),
|
|
)
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |