Update profile link and business card Icons alignment
This commit is contained in:
@@ -186,7 +186,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
return Consumer2<MzansiProfileProvider, MzansiDirectoryProvider>(
|
return Consumer2<MzansiProfileProvider, MzansiDirectoryProvider>(
|
||||||
builder: (BuildContext context, MzansiProfileProvider profileProvider,
|
builder: (BuildContext context, MzansiProfileProvider profileProvider,
|
||||||
MzansiDirectoryProvider directoryProvider, Widget? child) {
|
MzansiDirectoryProvider directoryProvider, Widget? child) {
|
||||||
double iconSize = 33.0;
|
double iconSize = 50.0;
|
||||||
return Wrap(
|
return Wrap(
|
||||||
alignment: WrapAlignment.center,
|
alignment: WrapAlignment.center,
|
||||||
runSpacing: 10,
|
runSpacing: 10,
|
||||||
@@ -194,22 +194,19 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
children: [
|
children: [
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
MihButton(
|
||||||
width: 80,
|
width: 80,
|
||||||
height: 80,
|
height: 80,
|
||||||
child: MihButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
_makePhoneCall(widget.business.contact_no);
|
||||||
_makePhoneCall(widget.business.contact_no);
|
},
|
||||||
},
|
buttonColor: MihColors.getGreenColor(
|
||||||
buttonColor: MihColors.getGreenColor(
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
|
child: Icon(
|
||||||
|
Icons.phone,
|
||||||
|
color: MihColors.getPrimaryColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
child: Icon(
|
size: iconSize,
|
||||||
Icons.phone,
|
|
||||||
color: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
@@ -229,26 +226,23 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
MihButton(
|
||||||
width: 80,
|
width: 80,
|
||||||
height: 80,
|
height: 80,
|
||||||
child: MihButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
_launchEmail(
|
||||||
_launchEmail(
|
widget.business.bus_email,
|
||||||
widget.business.bus_email,
|
"Inquiery about ${widget.business.Name}",
|
||||||
"Inquiery about ${widget.business.Name}",
|
"Dear ${widget.business.Name},\n\nI would like to inquire about your services.\n\nBest regards,\n",
|
||||||
"Dear ${widget.business.Name},\n\nI would like to inquire about your services.\n\nBest regards,\n",
|
);
|
||||||
);
|
},
|
||||||
},
|
buttonColor: MihColors.getPinkColor(
|
||||||
buttonColor: MihColors.getPinkColor(
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
|
child: Icon(
|
||||||
|
Icons.email,
|
||||||
|
color: MihColors.getPrimaryColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
child: Icon(
|
size: iconSize,
|
||||||
Icons.email,
|
|
||||||
color: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
@@ -269,30 +263,27 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
if (isValidGps(widget.business.gps_location))
|
if (isValidGps(widget.business.gps_location))
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
MihButton(
|
||||||
width: 80,
|
width: 80,
|
||||||
height: 80,
|
height: 80,
|
||||||
child: MihButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
final latitude = double.parse(
|
||||||
final latitude = double.parse(
|
widget.business.gps_location.split(',')[0]);
|
||||||
widget.business.gps_location.split(',')[0]);
|
final longitude = double.parse(
|
||||||
final longitude = double.parse(
|
widget.business.gps_location.split(',')[1]);
|
||||||
widget.business.gps_location.split(',')[1]);
|
_launchGoogleMapsWithUrl(
|
||||||
_launchGoogleMapsWithUrl(
|
latitude: latitude,
|
||||||
latitude: latitude,
|
longitude: longitude,
|
||||||
longitude: longitude,
|
);
|
||||||
);
|
},
|
||||||
},
|
buttonColor: MihColors.getOrangeColor(
|
||||||
buttonColor: MihColors.getOrangeColor(
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
|
child: Icon(
|
||||||
|
Icons.location_on,
|
||||||
|
color: MihColors.getPrimaryColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
"Dark"),
|
"Dark"),
|
||||||
child: Icon(
|
size: iconSize,
|
||||||
Icons.location_on,
|
|
||||||
color: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
@@ -314,23 +305,20 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
widget.business.website != "")
|
widget.business.website != "")
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
MihButton(
|
||||||
width: 80,
|
width: 80,
|
||||||
height: 80,
|
height: 80,
|
||||||
child: MihButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
_launchWebsite(widget.business.website);
|
||||||
_launchWebsite(widget.business.website);
|
},
|
||||||
},
|
buttonColor: MihColors.getRedColor(
|
||||||
buttonColor: MihColors.getRedColor(
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
|
child: Icon(
|
||||||
|
Icons.language,
|
||||||
|
color: MihColors.getPrimaryColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
"Dark"),
|
"Dark"),
|
||||||
child: Icon(
|
size: iconSize,
|
||||||
Icons.language,
|
|
||||||
color: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
@@ -354,21 +342,19 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
if (asyncSnapshot.connectionState == ConnectionState.waiting) {
|
if (asyncSnapshot.connectionState == ConnectionState.waiting) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
MihButton(
|
||||||
width: 80,
|
width: 80,
|
||||||
height: 80,
|
height: 80,
|
||||||
child: MihButton(
|
onPressed: () {},
|
||||||
onPressed: () {},
|
buttonColor: MihColors.getGreyColor(
|
||||||
buttonColor: MihColors.getGreyColor(
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
|
"Dark"),
|
||||||
|
child: Icon(
|
||||||
|
Icons.star_rate_rounded,
|
||||||
|
color: MihColors.getPrimaryColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
"Dark"),
|
"Dark"),
|
||||||
child: Icon(
|
size: iconSize,
|
||||||
Icons.star_rate_rounded,
|
|
||||||
color: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
).redacted(context: context, redact: true),
|
).redacted(context: context, redact: true),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
@@ -396,24 +382,22 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
}
|
}
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
MihButton(
|
||||||
width: 80,
|
width: 80,
|
||||||
height: 80,
|
height: 80,
|
||||||
child: MihButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
businessReviewRatingWindow(directoryProvider,
|
||||||
businessReviewRatingWindow(directoryProvider,
|
businessReview, true, widget.width);
|
||||||
businessReview, true, widget.width);
|
},
|
||||||
},
|
buttonColor: MihColors.getYellowColor(
|
||||||
buttonColor: MihColors.getYellowColor(
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
|
"Dark"),
|
||||||
|
child: Icon(
|
||||||
|
Icons.star_rate_rounded,
|
||||||
|
color: MihColors.getPrimaryColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
"Dark"),
|
"Dark"),
|
||||||
child: Icon(
|
size: iconSize,
|
||||||
Icons.star_rate_rounded,
|
|
||||||
color: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
@@ -440,21 +424,19 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
if (asyncSnapshot.connectionState == ConnectionState.waiting) {
|
if (asyncSnapshot.connectionState == ConnectionState.waiting) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
MihButton(
|
||||||
width: 80,
|
width: 80,
|
||||||
height: 80,
|
height: 80,
|
||||||
child: MihButton(
|
onPressed: () {},
|
||||||
onPressed: () {},
|
buttonColor: MihColors.getGreyColor(
|
||||||
buttonColor: MihColors.getGreyColor(
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
|
"Dark"),
|
||||||
|
child: Icon(
|
||||||
|
Icons.bookmark_add_rounded,
|
||||||
|
color: MihColors.getPrimaryColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
"Dark"),
|
"Dark"),
|
||||||
child: Icon(
|
size: iconSize,
|
||||||
Icons.bookmark_add_rounded,
|
|
||||||
color: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
).redacted(context: context, redact: true),
|
).redacted(context: context, redact: true),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
@@ -482,29 +464,27 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
}
|
}
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
MihButton(
|
||||||
width: 80,
|
width: 80,
|
||||||
height: 80,
|
height: 80,
|
||||||
child: MihButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
if (bookmarkBusiness == null) {
|
||||||
if (bookmarkBusiness == null) {
|
showAddBookmarkAlert();
|
||||||
showAddBookmarkAlert();
|
} else {
|
||||||
} else {
|
showDeleteBookmarkAlert(bookmarkBusiness);
|
||||||
showDeleteBookmarkAlert(bookmarkBusiness);
|
}
|
||||||
}
|
},
|
||||||
},
|
buttonColor: MihColors.getBluishPurpleColor(
|
||||||
buttonColor: MihColors.getBluishPurpleColor(
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
|
"Dark"),
|
||||||
|
child: Icon(
|
||||||
|
bookmarkBusiness == null
|
||||||
|
? Icons.bookmark_add_rounded
|
||||||
|
: Icons.bookmark_remove_rounded,
|
||||||
|
color: MihColors.getPrimaryColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
"Dark"),
|
"Dark"),
|
||||||
child: Icon(
|
size: iconSize,
|
||||||
bookmarkBusiness == null
|
|
||||||
? Icons.bookmark_add_rounded
|
|
||||||
: Icons.bookmark_remove_rounded,
|
|
||||||
color: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
|
|||||||
@@ -10,12 +10,10 @@ import 'package:url_launcher/url_launcher.dart';
|
|||||||
|
|
||||||
class MihProfileLinks extends StatefulWidget {
|
class MihProfileLinks extends StatefulWidget {
|
||||||
final List<ProfileLink> links;
|
final List<ProfileLink> links;
|
||||||
final double? buttonSize;
|
|
||||||
final bool? paddingOn;
|
final bool? paddingOn;
|
||||||
const MihProfileLinks({
|
const MihProfileLinks({
|
||||||
super.key,
|
super.key,
|
||||||
required this.links,
|
required this.links,
|
||||||
this.buttonSize,
|
|
||||||
this.paddingOn,
|
this.paddingOn,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -83,6 +81,8 @@ class _MihProfileLinksState extends State<MihProfileLinks> {
|
|||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||||
}
|
}
|
||||||
return MihButton(
|
return MihButton(
|
||||||
|
width: 80,
|
||||||
|
height: 80,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
launchSocialUrl(Uri.parse(link.web_link));
|
launchSocialUrl(Uri.parse(link.web_link));
|
||||||
},
|
},
|
||||||
@@ -90,7 +90,7 @@ class _MihProfileLinksState extends State<MihProfileLinks> {
|
|||||||
child: FaIcon(
|
child: FaIcon(
|
||||||
iconData,
|
iconData,
|
||||||
color: iconColor,
|
color: iconColor,
|
||||||
size: 33,
|
size: 40,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
// return MihPackageTile(
|
// return MihPackageTile(
|
||||||
@@ -148,11 +148,7 @@ class _MihProfileLinksState extends State<MihProfileLinks> {
|
|||||||
spacing: 10,
|
spacing: 10,
|
||||||
children: widget.links.map(
|
children: widget.links.map(
|
||||||
(link) {
|
(link) {
|
||||||
return SizedBox(
|
return displayLinkButton(link);
|
||||||
width: widget.buttonSize ?? 80,
|
|
||||||
height: widget.buttonSize ?? 80,
|
|
||||||
child: displayLinkButton(link),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
).toList(),
|
).toList(),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user