Skip to content

Commit

Permalink
Merge pull request #38 from Modernism-in-Architecture/release-1.2.2
Browse files Browse the repository at this point in the history
Release 1.2.2
  • Loading branch information
normade authored Jan 5, 2024
2 parents e25efa5 + 2fd7340 commit 06bf468
Show file tree
Hide file tree
Showing 12 changed files with 243 additions and 82 deletions.
3 changes: 3 additions & 0 deletions lib/src/models/list_building_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ListBuildingModel {
required this.longitude,
required this.buildingType,
required this.feedImage,
required this.previewImage,
});

int id;
Expand All @@ -23,6 +24,7 @@ class ListBuildingModel {
double longitude;
String buildingType;
String feedImage;
String previewImage;


factory ListBuildingModel.fromJson(Map<String, dynamic> json) =>
Expand All @@ -35,5 +37,6 @@ class ListBuildingModel {
longitude: json["longitude"],
buildingType: convertToUTF8(json["buildingType"]),
feedImage: json["feedImage"],
previewImage: json["previewImage"],
);
}
9 changes: 6 additions & 3 deletions lib/src/views/architect_detail_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,26 @@ class ArchitectDetailViewState extends ConsumerState<ArchitectDetailView> {
snapshot.data!.firstName,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.normal
fontWeight: FontWeight.normal,
)
),
if (snapshot.data!.firstName != "") const Text(" "),
Text(
snapshot.data!.lastName,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.normal
fontWeight: FontWeight.normal,
)
),
]
),
backgroundColor: Colors.black,
foregroundColor: Colors.white,
actions: <Widget>[
IconButton(
icon: const Icon(CupertinoIcons.share_up),
icon: const Icon(
CupertinoIcons.share_up,
),
onPressed: () {
shareInformation(snapshot.data!.absoluteURL, snapshot.data!.lastName);
},
Expand Down
11 changes: 8 additions & 3 deletions lib/src/views/building_detail_view.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:html/parser.dart' show parse;

import 'package:mia/src/widgets/building_details/detail_map.dart';
import 'package:mia/src/widgets/building_details/gallery_grid.dart';
import 'package:mia/src/widgets/building_details/header_image.dart';
import 'package:mia/src/widgets/building_details/section_text_content.dart';
import 'package:mia/src/widgets/loading_screen.dart';

import '../helpers.dart';
import '../models/detail_building_model.dart';
import '../network/mia_api_client.dart';
import '../providers.dart';
import '../widgets/building_details/section_header.dart';
import 'package:html/parser.dart' show parse;

import 'architect_detail_view.dart';

Expand Down Expand Up @@ -54,7 +56,11 @@ class BuildingDetailViewState extends ConsumerState<BuildingDetailView> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SectionHeader(title: "LOCATION"),
DetailMap(latitude: snapshot.data!.latitude, longitude: snapshot.data!.longitude)
DetailMap(
latitude: snapshot.data!.latitude,
longitude: snapshot.data!.longitude,
previewImage: snapshot.data!.galleryImages[0],
)
]
);

Expand Down Expand Up @@ -201,7 +207,6 @@ class BuildingDetailViewState extends ConsumerState<BuildingDetailView> {
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.white
)
),
foregroundColor: Colors.white,
Expand Down
4 changes: 1 addition & 3 deletions lib/src/views/home_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,13 @@ class HomeViewState extends ConsumerState<HomeView> {
if (titleBarIcon.icon == CupertinoIcons.search) {
ref.read(appBarIcon.notifier).state = const Icon(
CupertinoIcons.xmark_circle,
color: Colors.white
);
ref.read(appBarType.notifier).state = const CustomSearchBar();
} else {
ref
.read(appBarIcon.notifier)
.state = const Icon(
CupertinoIcons.search,
color: Colors.white,
);
ref
.read(appBarType.notifier)
Expand All @@ -108,6 +106,7 @@ class HomeViewState extends ConsumerState<HomeView> {
) : Container(),
],
backgroundColor: Colors.black,
foregroundColor: Colors.white,
),
body: _views[viewIndex],
key: globalScaffold,
Expand All @@ -121,7 +120,6 @@ class HomeViewState extends ConsumerState<HomeView> {
ref.read(appBarType.notifier).state = const CustomTitleBar();
ref.read(appBarIcon.notifier).state = const Icon(
CupertinoIcons.search,
color: Colors.white,
);
final viewIndex = ref.watch(selectedViewIndex);
ref.read(appBarTitleProvider.notifier).state = titles[viewIndex];
Expand Down
6 changes: 5 additions & 1 deletion lib/src/views/map_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ class MapViewState extends ConsumerState<MapView> {
markers.add(
Marker(
point: LatLng(building.latitude, building.longitude),
child: MapMarker(buildingId: building.id),
child: MapMarker(
buildingId: building.id,
previewImage: building.previewImage,
name: building.name
),
)
);
}
Expand Down
45 changes: 39 additions & 6 deletions lib/src/widgets/building_details/detail_map.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:latlong2/latlong.dart';

import '../../providers.dart';
import '../loading_screen.dart';


class DetailMap extends ConsumerStatefulWidget {
const DetailMap({super.key, required this.latitude, required this.longitude});
const DetailMap({
super.key,
required this.latitude,
required this.longitude,
required this.previewImage,
});
final double latitude;
final double longitude;
final String previewImage;

@override
DetailMapState createState() => DetailMapState();
Expand All @@ -25,11 +33,6 @@ class DetailMapState extends ConsumerState<DetailMap> {
Marker(
point: LatLng(widget.latitude, widget.longitude),
child: GestureDetector(
child: const Icon(
Icons.location_on,
color: Colors.blue,
size: 35.0,
),
onTap: () {
ref.read(mapLocation.notifier).state = MapLocation(
latitude: widget.latitude, longitude: widget.longitude
Expand All @@ -38,6 +41,36 @@ class DetailMapState extends ConsumerState<DetailMap> {
ref.read(appBarTitleProvider.notifier).state = titles[1];
Navigator.popUntil(context, ModalRoute.withName("/"));
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Colors.blue[900]!.withOpacity(0.5),
spreadRadius: 1,
blurRadius: 3,
offset: const Offset(0, 3),
),
],
border: Border.all(
color: Colors.blue[900]!,
width: 1.5,
),
),
child: ClipOval(
child: CachedNetworkImage(
imageUrl: widget.previewImage,
fit: BoxFit.cover,
placeholder: (context, url) => const Center(child: LoadingScreen()),
errorWidget: (context, url, error) => Center(
child: Padding(
padding: const EdgeInsets.all(1.0),
child: Image.asset("lib/assets/images/mia-logo.png"),
),
),
),
)
),
),
)
];
Expand Down
29 changes: 10 additions & 19 deletions lib/src/widgets/building_details/gallery_grid.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:mia/src/widgets/building_details/gallery_carousel.dart';

Expand Down Expand Up @@ -39,26 +40,16 @@ class GalleryGrid extends StatelessWidget{
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Image.network(
galleryImages[index],
child: CachedNetworkImage(
imageUrl: galleryImages[index],
fit: BoxFit.cover,
loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) {
if (loadingProgress == null) {
return child;
}
return const Center(
child: LoadingScreen()
);
},
errorBuilder: (context, error, stackTrace) {
return Center(
child:
Padding(
padding: const EdgeInsets.all(40.0),
child: Image.asset("lib/assets/images/mia-logo.png")
)
);
},
placeholder: (context, url) => const Center(child: LoadingScreen()),
errorWidget: (context, url, error) => Center(
child: Padding(
padding: const EdgeInsets.all(1.0),
child: Image.asset("lib/assets/images/mia-logo.png"),
),
),
),
)
)
Expand Down
29 changes: 10 additions & 19 deletions lib/src/widgets/building_details/header_image.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';

import '../loading_screen.dart';
Expand All @@ -11,26 +12,16 @@ class HeaderImage extends StatelessWidget{
return SizedBox(
width: MediaQuery.of(context).size.width,
height: 300,
child: Image.network(
feedImage,
child: CachedNetworkImage(
imageUrl: feedImage,
fit: BoxFit.cover,
loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) {
if (loadingProgress == null) {
return child;
}
return const Center(
child: LoadingScreen()
);
},
errorBuilder: (context, error, stackTrace) {
return Center(
child:
Padding(
padding: const EdgeInsets.all(40.0),
child: Image.asset("lib/assets/images/mia-logo.png")
)
);
},
placeholder: (context, url) => const Center(child: LoadingScreen()),
errorWidget: (context, url, error) => Center(
child: Padding(
padding: const EdgeInsets.all(1.0),
child: Image.asset("lib/assets/images/mia-logo.png"),
),
),
),
);
}
Expand Down
31 changes: 11 additions & 20 deletions lib/src/widgets/building_list/building_list_card.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import '../../models/list_building_model.dart';
import '../../views/building_detail_view.dart';
Expand Down Expand Up @@ -36,26 +37,16 @@ class BuildingListCard extends StatelessWidget{
SizedBox(
width: MediaQuery.of(context).size.width,
height: 310,
child: Image.network(
listBuilding!.feedImage,
fit: BoxFit.fill,
loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) {
if (loadingProgress == null) {
return child;
}
return const Center(
child: LoadingScreen()
);
},
errorBuilder: (context, error, stackTrace) {
return Center(
child:
Padding(
padding: const EdgeInsets.all(40.0),
child: Image.asset("lib/assets/images/mia-logo.png")
)
);
},
child: CachedNetworkImage(
imageUrl: listBuilding!.feedImage,
fit: BoxFit.cover,
placeholder: (context, url) => const Center(child: LoadingScreen()),
errorWidget: (context, url, error) => Center(
child: Padding(
padding: const EdgeInsets.all(1.0),
child: Image.asset("lib/assets/images/mia-logo.png"),
),
),
),
),
Expanded(
Expand Down
Loading

0 comments on commit 06bf468

Please sign in to comment.