Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Create the widgets and ui directories - Move maps to widgets and create infoPoi - Move poi_view and poi_list_view to ui and create settings - Change list structure to show two columns in landscape - Change styles and gallery structure in poi_view
- Loading branch information
Showing
7 changed files
with
246 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:mobile_mission_tic_flutter/models/poi.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:mobile_mission_tic_flutter/widgets/info_poi.dart'; | ||
|
||
import '../widgets/maps.dart'; | ||
|
||
class POIView extends StatelessWidget { | ||
POIView({Key? key}) : super(key: key); | ||
|
||
final POI currentPOI = Get.arguments; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
Widget galleryPOIs = Container( | ||
margin: const EdgeInsets.only(bottom: 16), | ||
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ | ||
_imageGallery('lib/assets/versailles_0.jpg', context), | ||
_imageGallery('lib/assets/versailles_1.jpg', context), | ||
_imageGallery('lib/assets/versailles_2.jpg', context), | ||
_imageGallery('lib/assets/versailles_3.jpg', context), | ||
]), | ||
); | ||
|
||
Widget descriptionPOI(POI currentPOI) { | ||
return Container( | ||
margin: const EdgeInsets.symmetric(vertical: 16), | ||
child: Text(currentPOI.detail), | ||
); | ||
} | ||
|
||
return Scaffold( | ||
appBar: AppBar(title: Text(currentPOI.name)), | ||
body: ListView( | ||
children: [ | ||
Image.asset('lib/assets/test/' + currentPOI.img + ".jpg", | ||
width: double.infinity, height: 200, fit: BoxFit.cover), | ||
Container( | ||
margin: const EdgeInsets.all(16), | ||
child: Wrap( | ||
runSpacing: 10, | ||
children: [ | ||
galleryPOIs, | ||
InfoPOI( | ||
name: currentPOI.name, | ||
location: currentPOI.location, | ||
rating: currentPOI.rating), | ||
descriptionPOI(currentPOI), | ||
SizedBox( | ||
height: MediaQuery.of(context).size.width / 2, | ||
width: MediaQuery.of(context).size.width, | ||
child: Maps(data: { | ||
"lat": currentPOI.lat, | ||
"lng": currentPOI.long, | ||
"markerId": currentPOI.name | ||
}), | ||
) | ||
], | ||
), | ||
), | ||
], | ||
)); | ||
} | ||
} | ||
|
||
Flexible _imageGallery(String urlImg, context) { | ||
bool isLandscape = | ||
MediaQuery.of(context).orientation == Orientation.landscape; | ||
|
||
return Flexible( | ||
flex: 1, | ||
child: Container( | ||
height: isLandscape ? 100 : 50, | ||
margin: const EdgeInsets.only(right: 5.0), | ||
decoration: BoxDecoration( | ||
image: DecorationImage( | ||
image: AssetImage(urlImg), | ||
fit: BoxFit.fill, | ||
), | ||
borderRadius: const BorderRadius.all(Radius.circular(5))), | ||
)); | ||
} | ||
|
||
/*Widget galleryPOI(context){ | ||
bool isLandscape = MediaQuery.of(context).orientation == Orientation.landscape; | ||
return Container( | ||
height: isLandscape ? 100 : 60, | ||
margin: const EdgeInsets.only(bottom: 16), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
Flexible( | ||
flex: 1, | ||
child: Container( | ||
height: 50, | ||
margin: const EdgeInsets.only(right: 5.0), | ||
decoration: const BoxDecoration( | ||
image: DecorationImage( | ||
image: AssetImage('lib/assets/versailles_1.jpg'), | ||
fit: BoxFit.fitHeight, | ||
), | ||
borderRadius: BorderRadius.all(Radius.circular(5))), | ||
) | ||
), | ||
Expanded( | ||
child: Image.asset('lib/assets/versailles_1.jpg', fit: BoxFit.fill), | ||
), | ||
Expanded( | ||
child: Image.asset('lib/assets/versailles_2.jpg', fit: BoxFit.fill), | ||
), | ||
Expanded( | ||
child: Image.asset('lib/assets/versailles_3.jpg', fit: BoxFit.fill), | ||
), | ||
] | ||
), | ||
); | ||
}*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.