Added Widgets
parent
fe337f2091
commit
37a73a01ff
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18.393" height="18.39" viewBox="0 0 18.393 18.39">
|
||||
<path id="Path_4628" data-name="Path 4628" d="M7.4,14.833a7.385,7.385,0,0,0,4.538-1.559l4.893,4.893a.92.92,0,0,0,1.3-1.3l-4.893-4.893A7.4,7.4,0,1,0,7.4,14.833ZM3.471,3.5a5.56,5.56,0,1,1,0,7.863h0a5.54,5.54,0,0,1-.029-7.835L3.471,3.5Z" transform="translate(0 -0.035)" fill="#28323a"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 391 B |
@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||
import 'package:mc_common_app/theme/colors.dart';
|
||||
|
||||
|
||||
class CategoriesList extends StatelessWidget {
|
||||
// We will pass a list here!
|
||||
final String name;
|
||||
final Function() onTapped;
|
||||
const CategoriesList({Key? key, required this.name, required this.onTapped}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: 37,
|
||||
width: double.infinity,
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
itemCount: 20,
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: onTapped,
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: index < 1 ? MyColors.darkIconColor : null,
|
||||
border: Border.all(
|
||||
color: index < 1 ? MyColors.darkIconColor : MyColors.primaryColor,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
child: name.toText(
|
||||
fontSize: 12,
|
||||
color: index < 1 ? MyColors.white : null,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||
import 'package:mc_common_app/theme/colors.dart';
|
||||
|
||||
class CustomButton extends StatelessWidget {
|
||||
final Function() onTapped;
|
||||
final Color? backgroundColor;
|
||||
final String buttonText;
|
||||
final double? textFontSize;
|
||||
|
||||
final Color textColor;
|
||||
final bool? isIcon;
|
||||
final double? buttonHeight;
|
||||
|
||||
const CustomButton({
|
||||
Key? key,
|
||||
required this.onTapped,
|
||||
required this.buttonText,
|
||||
this.isIcon = false,
|
||||
this.backgroundColor = MyColors.primaryColor,
|
||||
this.textColor = MyColors.white,
|
||||
this.buttonHeight = 55,
|
||||
this.textFontSize = 15,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: buttonHeight,
|
||||
color: backgroundColor,
|
||||
alignment: Alignment.center,
|
||||
child: InkWell(
|
||||
onTap: onTapped,
|
||||
child: buttonText.toText(fontSize: textFontSize, color: textColor),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,118 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mc_common_app/classes/consts.dart';
|
||||
import 'package:mc_common_app/extensions/int_extensions.dart';
|
||||
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||
import 'package:mc_common_app/generated/locale_keys.g.dart';
|
||||
import 'package:mc_common_app/theme/colors.dart';
|
||||
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||
|
||||
class ProviderDetailsCard extends StatelessWidget {
|
||||
final String providerImageUrl;
|
||||
final String providerName;
|
||||
final String providerLocation;
|
||||
final String providerRatings;
|
||||
final Function() onCardTapped;
|
||||
|
||||
const ProviderDetailsCard({
|
||||
Key? key,
|
||||
required this.providerImageUrl,
|
||||
required this.providerName,
|
||||
required this.providerRatings,
|
||||
required this.providerLocation,
|
||||
required this.onCardTapped,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 10,
|
||||
left: 21,
|
||||
right: 21,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
providerImageUrl,
|
||||
width: 80,
|
||||
height: 85,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
12.width,
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
providerName.toText(fontSize: 16, isBold: true),
|
||||
Row(
|
||||
children: [
|
||||
LocaleKeys.location.tr().toText(color: MyColors.lightTextColor, fontSize: 12),
|
||||
2.width,
|
||||
":$providerLocation".toText(fontSize: 12),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
providerRatings.toText(
|
||||
isUnderLine: true,
|
||||
isBold: true,
|
||||
fontSize: 12,
|
||||
),
|
||||
2.width,
|
||||
MyAssets.starIcon.buildSvg(width: 12),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
8.height,
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
MyAssets.maintenanceIcon.buildSvg(),
|
||||
8.width,
|
||||
LocaleKeys.maintenance.tr().toText(
|
||||
fontSize: 14,
|
||||
isBold: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
MyAssets.modificationsIcon.buildSvg(),
|
||||
8.width,
|
||||
LocaleKeys.accessories_modifications.tr().toText(
|
||||
fontSize: 14,
|
||||
isBold: true,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
).onPress(onCardTapped).toWhiteContainer(width: double.infinity, allPading: 12));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue