Compare commits

..

1 Commits

Author SHA1 Message Date
8d1677d78b cleaner ci
Some checks failed
Build and push docker image / Build (pull_request) Has been cancelled
Build and release APK / Build APK (pull_request) Successful in 6m51s
Build web / Build Web (pull_request) Successful in 1m31s
2024-06-06 22:53:23 +02:00
3 changed files with 69 additions and 42 deletions

View File

@ -21,47 +21,47 @@ class _LandmarkCardState extends State<LandmarkCard> {
), ),
child: Row( child: Row(
children: [ children: [
Container( // Container(
width: 160, // width: 160,
height: 160, // height: 160,
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.only( // borderRadius: BorderRadius.only(
topLeft: Radius.circular(15.0), // topLeft: Radius.circular(15.0),
bottomLeft: Radius.circular(15.0), // bottomLeft: Radius.circular(15.0),
), // ),
image: DecorationImage( // image: DecorationImage(
image: NetworkImage('https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg/1037px-Tour_Eiffel_Wikimedia_Commons.jpg'), // image: NetworkImage(widget.landmark.imageURL),
fit: BoxFit.cover, // fit: BoxFit.cover,
), // ),
), // ),
), // ),
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
widget.landmark.name, widget.landmark.name,
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
),
), ),
], ),
), ],
SizedBox(height: 5), ),
Text( SizedBox(height: 5),
"${widget.landmark.name} (${widget.landmark.type.name})", Text(
style: TextStyle(fontSize: 14), "${widget.landmark.name} (${widget.landmark.type.name})",
), style: TextStyle(fontSize: 14),
], ),
), ],
), ),
), ),
// Align( // Align(
// alignment: Alignment.topRight, // alignment: Alignment.topRight,
// child: Icon(Icons.push_pin, color: theme.primaryColor), // child: Icon(Icons.push_pin, color: theme.primaryColor),

View File

@ -2,6 +2,7 @@ class Landmark {
final String name; final String name;
final List location; final List location;
final LandmarkType type; final LandmarkType type;
final String imageURL;
// final String description; // final String description;
// final Duration duration; // final Duration duration;
// final bool visited; // final bool visited;
@ -10,6 +11,7 @@ class Landmark {
required this.name, required this.name,
required this.location, required this.location,
required this.type, required this.type,
this.imageURL = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg/1037px-Tour_Eiffel_Wikimedia_Commons.jpg',
// required this.description, // required this.description,
// required this.duration, // required this.duration,
// required this.visited, // required this.visited,

View File

@ -10,14 +10,39 @@ Future<List<Landmark>> fetchLandmarks() async {
// If the server did return a 200 OK response, // If the server did return a 200 OK response,
// then parse the JSON. // then parse the JSON.
List<Landmark> landmarks = [ List<Landmark> landmarks = [
Landmark(name: "Landmark 1", location: [48.85, 2.35], type: LandmarkType(name: "Type 1")), // 48°5129.6N 2°1740.2E
Landmark(name: "Landmark 2", location: [48.86, 2.36], type: LandmarkType(name: "Type 2")), Landmark(
Landmark(name: "Landmark 3", location: [48.75, 2.3], type: LandmarkType(name: "Type 3")), name: "Eiffel Tower",
Landmark(name: "Landmark 4", location: [48.9, 2.4], type: LandmarkType(name: "Type 4")), location: [48.51296, 2.17402],
Landmark(name: "Landmark 5", location: [48.91, 2.45], type: LandmarkType(name: "Type 5")), type: LandmarkType(name: "Tower"),
imageURL: "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg/1037px-Tour_Eiffel_Wikimedia_Commons.jpg"
),
Landmark(
name: "Notre Dame Cathedral",
location: [48.8530, 2.3498],
type: LandmarkType(name: "Monument"),
imageURL: "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Notre-Dame_de_Paris%2C_4_October_2017.jpg/440px-Notre-Dame_de_Paris%2C_4_October_2017.jpg"
),
Landmark(
name: "Louvre palace",
location: [48.8606, 2.3376],
type: LandmarkType(name: "Museum"),
imageURL: "https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/Louvre_Museum_Wikimedia_Commons.jpg/540px-Louvre_Museum_Wikimedia_Commons.jpg"
),
Landmark(
name: "Pont-des-arts",
location: [48.5130, 2.2015],
type: LandmarkType(name: "Bridge"),
imageURL: "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d1/Pont_des_Arts%2C_6e_Arrondissement%2C_Paris_%28HDR%29_20140320_1.jpg/560px-Pont_des_Arts%2C_6e_Arrondissement%2C_Paris_%28HDR%29_20140320_1.jpg"),
Landmark(
name: "Panthéon",
location: [48.5046, 2.2046],
type: LandmarkType(name: "Monument"),
imageURL: "https://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Pantheon_of_Paris_007.JPG/1280px-Pantheon_of_Paris_007.JPG"
),
]; ];
// sleep 10 seconds // sleep 10 seconds
await Future.delayed(Duration(seconds: 10)); await Future.delayed(Duration(seconds: 5));
return landmarks; return landmarks;
// } else { // } else {
// // If the server did not return a 200 OK response, // // If the server did not return a 200 OK response,