Added Widgets

merge-requests/8/head
FaizHashmiCS22 3 years ago
parent 1099220841
commit 0b95222215

@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="18.557" height="19.744" viewBox="0 0 18.557 19.744">
<g id="Group" transform="translate(0 0)">
<g id="Group-2" data-name="Group">
<path id="Vector" d="M18.317,8.354,8.426,18.3A4.936,4.936,0,0,1,1.444,11.32L11.626,1.084A3.7,3.7,0,0,1,16.861,6.32L8.43,14.751l0,0a2.468,2.468,0,0,1-3.49-3.49L9.008,7.192a.823.823,0,1,1,1.164,1.163L6.1,12.428a.822.822,0,0,0,1.161,1.165l0,0L15.7,5.156a2.057,2.057,0,0,0-2.907-2.91L2.609,12.481a3.291,3.291,0,0,0,4.652,4.655l9.89-9.943a.823.823,0,0,1,1.167,1.16Z" transform="translate(0 0)" fill="#f47f20"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 618 B

@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" width="23.82" height="19.018" viewBox="0 0 23.82 19.018">
<g id="Layer_2_1_" transform="translate(-9.987 -18.087)">
<g id="Layer_2-2" transform="translate(9.987 18.087)">
<g id="_14.cur-crush" transform="translate(0)">
<path id="_Path_" d="M46.981,37.327l-.447,1.728a2.238,2.238,0,0,1-.655,1.072,3.166,3.166,0,0,1-.328.268l-.536,1.936a1.1,1.1,0,0,1-.209.417,1.18,1.18,0,0,1-1.251.417l-1.162-.3a1.2,1.2,0,0,1-.834-1.46l.3-1.162-9.2-2.472-.3,1.162a1.2,1.2,0,0,1-1.46.834l-1.162-.3a1.177,1.177,0,0,1-.864-.983,1.289,1.289,0,0,1,.03-.477l.506-1.936a2.068,2.068,0,0,1-.149-.387,2.664,2.664,0,0,1-.03-1.281l.447-1.728a2.344,2.344,0,0,1,1.37-1.579,2.576,2.576,0,0,1,.685-.179l.685-.894,1.191-1.608a3.188,3.188,0,0,1,.417-.477,3.771,3.771,0,0,1,.983-.715,3.228,3.228,0,0,1,.566-.238,4,4,0,0,1,1.191-.209,3.6,3.6,0,0,1,1.251.149l4.557,1.221a5.011,5.011,0,0,1,1.162.477,4.109,4.109,0,0,1,1.906,3.038l.238,2L46,34.795a2.194,2.194,0,0,1,.834,1.1,1.847,1.847,0,0,1,.149,1.43ZM32.773,32.888a1.122,1.122,0,0,0-1.43.715c0,.03-.03.089-.03.119a1.122,1.122,0,0,0,.715,1.43c.03,0,.089.03.119.03.685.179,1.7.566,1.877-.119A2.283,2.283,0,0,0,32.773,32.888Zm10.812,1.043-.238-2a2.516,2.516,0,0,0-.149-.506,1.673,1.673,0,0,0-1.162-.983l-4.587-1.221a1.806,1.806,0,0,0-1.906.655l-1.191,1.608,6.4,1.728Zm.685,2.025A2.283,2.283,0,0,0,42.1,37.207c-.179.685.894.864,1.579,1.043a1.159,1.159,0,0,0,1.519-.715,1.183,1.183,0,0,0-.715-1.519C44.419,35.986,44.33,35.986,44.271,35.956Z" transform="translate(-23.237 -24.187)" fill="#767676"/>
<path id="_Path_2" d="M15.323,26.282l-.477,1.728a3.115,3.115,0,0,0-.089,1.281l-1.311,1.072a.336.336,0,0,1-.477-.06.3.3,0,0,1-.06-.268l.566-2.86a.337.337,0,0,0-.268-.387h-.03l-2.889-.268a.33.33,0,0,1-.3-.357.3.3,0,0,1,.149-.238l2.413-1.608a.342.342,0,0,0,.089-.477.029.029,0,0,0-.03-.03l-1.847-2.234a.336.336,0,0,1,.06-.477.3.3,0,0,1,.268-.06l2.86.566a.337.337,0,0,0,.387-.268v-.03l.268-2.919a.33.33,0,0,1,.357-.3.3.3,0,0,1,.238.149l1.608,2.413a.332.332,0,0,0,.477.089.029.029,0,0,0,.03-.03l2.234-1.847a.336.336,0,0,1,.477.06.3.3,0,0,1,.06.268l-.417,2.085c-.089.119-.209.238-.3.357l-1.191,1.608-.387.536a3.552,3.552,0,0,0-2.472,2.5Z" transform="translate(-9.987 -18.087)" fill="#767676"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" width="22.503" height="10.716" viewBox="0 0 22.503 10.716">
<g id="_13-car" data-name="13-car" transform="translate(-5.367 -100.651)">
<g id="glyph" transform="translate(5.367 100.651)">
<path id="Path_4642" data-name="Path 4642" d="M70.322,236a2.322,2.322,0,1,0,2.322,2.322A2.322,2.322,0,0,0,70.322,236Zm0,3.393a1.072,1.072,0,1,1,1.072-1.072A1.072,1.072,0,0,1,70.322,239.393Z" transform="translate(-65.142 -229.928)" fill="#fff"/>
<path id="Path_4643" data-name="Path 4643" d="M358.322,236a2.322,2.322,0,1,0,2.322,2.322A2.322,2.322,0,0,0,358.322,236Zm0,3.393a1.072,1.072,0,1,1,1.072-1.072A1.072,1.072,0,0,1,358.322,239.393Z" transform="translate(-340.284 -229.928)" fill="#fff"/>
<path id="Path_4644" data-name="Path 4644" d="M25.137,104.154l-4.17-.761-3.55-2.946A1.969,1.969,0,0,0,16.168,100h-5.23a1.955,1.955,0,0,0-1.534.737l-2.268,2.656H5.607A1.609,1.609,0,0,0,4,105v1.965a1.967,1.967,0,0,0,1.965,1.965h.408a2.858,2.858,0,1,1,5.613,0h7.246a2.858,2.858,0,1,1,5.613,0H24.9a1.609,1.609,0,0,0,1.607-1.607v-1.579a1.6,1.6,0,0,0-1.366-1.589Zm-13.279-1.3a.536.536,0,0,1-.536.536H8.967a.268.268,0,0,1-.2-.442l1.559-1.826a.536.536,0,0,1,.407-.188h.593a.536.536,0,0,1,.536.536Zm2.679,2.5h-.714a.536.536,0,0,1,0-1.072h.714a.536.536,0,0,1,0,1.072Zm4.218-1.951-5.113-.012a.536.536,0,0,1-.535-.536v-1.385a.536.536,0,0,1,.536-.536h2.569a.536.536,0,0,1,.332.115l2.377,1.875a.268.268,0,0,1-.167.478Z" transform="translate(-4 -100)" fill="#fff"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="18.647" height="18.647" viewBox="0 0 18.647 18.647">
<path id="clock_9_" data-name="clock (9)" d="M9.324,0a9.324,9.324,0,1,0,9.324,9.324A9.334,9.334,0,0,0,9.324,0Zm4.434,14.146a.776.776,0,0,1-1.1,0L8.774,10.262a.773.773,0,0,1-.228-.549V4.662a.777.777,0,1,1,1.554,0V9.391l3.657,3.657A.776.776,0,0,1,13.758,14.146Zm0,0" fill="#767676"/>
</svg>

After

Width:  |  Height:  |  Size: 391 B

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" width="22.015" height="22.015" viewBox="0 0 22.015 22.015">
<g id="Button" transform="translate(-75.66 64.04) rotate(-45)">
<rect id="Rectangle_5860" data-name="Rectangle 5860" width="15.567" height="15.567" rx="7.783" transform="translate(91 16)" fill="#d85323"/>
<g id="plus_1" data-name="plus 1" transform="translate(95.001 20.001)">
<path id="Vector" d="M0,0V7.756" transform="translate(3.878)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.2"/>
<path id="Vector-2" data-name="Vector" d="M0,0H7.756" transform="translate(0 3.878)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.2"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 757 B

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="29.475" height="26.133" viewBox="0 0 29.475 26.133">
<g id="credit-card_3_" data-name="credit-card (3)" transform="translate(0 -29.027)">
<path id="Path_4634" data-name="Path 4634" d="M87.235,43.568l-2.229-12.64a2.3,2.3,0,0,0-2.262-1.9c-.133,0-19.517,3.406-19.517,3.406A2.3,2.3,0,0,0,61.361,35.1l.215,1.219H79.07A4.03,4.03,0,0,1,83.1,40.341v6.292l2.274-.4A2.3,2.3,0,0,0,87.235,43.568Z" transform="translate(-57.795)" fill="#28323a"/>
<path id="Path_4635" data-name="Path 4635" d="M23.576,351.509H0v5.268a2.3,2.3,0,0,0,2.3,2.3H21.276a2.3,2.3,0,0,0,2.3-2.3Zm-16.728,5.5H2.935a.863.863,0,0,1,0-1.725H6.848a.863.863,0,0,1,0,1.725Z" transform="translate(0 -303.917)" fill="#28323a"/>
<path id="Path_4636" data-name="Path 4636" d="M.049,187.793h23.57a2.3,2.3,0,0,0-2.3-2.188H2.346a2.3,2.3,0,0,0-2.3,2.188Z" transform="translate(-0.046 -147.564)" fill="#28323a"/>
<path id="Path_4637" data-name="Path 4637" d="M0,253.574H23.576v3.913H0Z" transform="translate(0 -211.62)" fill="#28323a"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="9.664" height="9.664" viewBox="0 0 9.664 9.664">
<path id="clock_7_" data-name="clock (7)" d="M4.832,0A4.832,4.832,0,1,0,9.664,4.832,4.837,4.837,0,0,0,4.832,0Zm2.3,7.331a.4.4,0,0,1-.569,0L4.547,5.318a.4.4,0,0,1-.118-.285V2.416a.4.4,0,1,1,.805,0V4.867l1.9,1.9A.4.4,0,0,1,7.13,7.331Zm0,0" fill="#434343"/>
</svg>

After

Width:  |  Height:  |  Size: 360 B

@ -0,0 +1,19 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16.535" height="18.373" viewBox="0 0 16.535 18.373">
<g id="cone" transform="translate(-16.002)">
<g id="Group_8127" data-name="Group 8127" transform="translate(20.213 6.43)">
<g id="Group_8126" data-name="Group 8126" transform="translate(0)">
<path id="Path_4638" data-name="Path 4638" d="M96.278,112h-5.83l-1.1,3.674h8.035Z" transform="translate(-89.346 -112)" fill="#f47f20"/>
</g>
</g>
<g id="Group_8129" data-name="Group 8129" transform="translate(22.142)">
<g id="Group_8128" data-name="Group 8128" transform="translate(0)">
<path id="Path_4639" data-name="Path 4639" d="M126.217.655a.919.919,0,0,0-.88-.655h-.6a.919.919,0,0,0-.88.655l-.906,3.02h4.177Z" transform="translate(-122.946)" fill="#f47f20"/>
</g>
</g>
<g id="Group_8131" data-name="Group 8131" transform="translate(16.002 12.861)">
<g id="Group_8130" data-name="Group 8130" transform="translate(0)">
<path id="Path_4640" data-name="Path 4640" d="M30.177,227.674,29.074,224H19.386l-1.1,3.674H16v1.837H32.537v-1.837Z" transform="translate(-16.002 -224)" fill="#f47f20"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" width="14.663" height="19.551" viewBox="0 0 14.663 19.551">
<g id="shopping-list_2_" data-name="shopping-list (2)" transform="translate(-64)">
<g id="Group_8165" data-name="Group 8165" transform="translate(67.666)">
<g id="Group_8164" data-name="Group 8164">
<path id="Path_4645" data-name="Path 4645" d="M166.721,1.222h-1.327a1.833,1.833,0,0,0-3.457,0h-1.326a.611.611,0,0,0-.611.611V4.277a.611.611,0,0,0,.611.611h6.11a.611.611,0,0,0,.611-.611V1.833A.611.611,0,0,0,166.721,1.222Z" transform="translate(-160)" fill="#767676"/>
</g>
</g>
<g id="Group_8167" data-name="Group 8167" transform="translate(64 2.444)">
<g id="Group_8166" data-name="Group 8166">
<path id="Path_4646" data-name="Path 4646" d="M77.441,64H76.219v1.833a1.835,1.835,0,0,1-1.833,1.833h-6.11a1.835,1.835,0,0,1-1.833-1.833V64H65.222A1.224,1.224,0,0,0,64,65.222V79.885a1.209,1.209,0,0,0,1.222,1.222H77.441a1.209,1.209,0,0,0,1.222-1.222V65.222A1.209,1.209,0,0,0,77.441,64ZM71.153,74.819l-2.444,2.444a.614.614,0,0,1-.865,0l-1.222-1.222a.611.611,0,0,1,.864-.864l.791.789,2.011-2.011a.611.611,0,0,1,.865.864Zm0-4.888-2.444,2.444a.614.614,0,0,1-.865,0l-1.222-1.222a.611.611,0,0,1,.864-.864l.791.789,2.011-2.011a.611.611,0,0,1,.865.864Zm4.455,6.288H73.165a.611.611,0,0,1,0-1.222h2.444a.611.611,0,0,1,0,1.222Zm0-4.888H73.165a.611.611,0,0,1,0-1.222h2.444a.611.611,0,0,1,0,1.222Z" transform="translate(-64 -64)" fill="#767676"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1,27 @@
<svg id="event" xmlns="http://www.w3.org/2000/svg" width="25.355" height="26.091" viewBox="0 0 25.355 26.091">
<g id="Group_8111" data-name="Group 8111" transform="translate(15.908 0)">
<g id="Group_8110" data-name="Group 8110">
<path id="Path_4629" data-name="Path 4629" d="M268.154,0h-.026a1.074,1.074,0,0,0-1.092,1.055c0,.011,0,.022,0,.033V3.6h2.194V1.088A1.083,1.083,0,0,0,268.154,0Z" transform="translate(-267.036 0)" fill="#28323a"/>
</g>
</g>
<g id="Group_8113" data-name="Group 8113" transform="translate(0 2.682)">
<g id="Group_8112" data-name="Group 8112">
<path id="Path_4630" data-name="Path 4630" d="M25.621,44h-.507v1.415a.465.465,0,0,1-.455.474H21.433a.456.456,0,0,1-.464-.448c0-.009,0-.017,0-.026V44H12.681v1.415a.489.489,0,0,1-.5.474H8.971a.483.483,0,0,1-.5-.471s0,0,0,0V44H8.021A1.994,1.994,0,0,0,6.037,46v2.091H27.614V46A2,2,0,0,0,25.621,44Z" transform="translate(-6.037 -44.003)" fill="#28323a"/>
</g>
</g>
<g id="Group_8115" data-name="Group 8115" transform="translate(3.413 0)">
<g id="Group_8114" data-name="Group 8114">
<path id="Path_4631" data-name="Path 4631" d="M63.161,0a1.1,1.1,0,0,0-1.124,1.088V3.6h2.255V1.091A1.107,1.107,0,0,0,63.161,0Z" transform="translate(-62.037 -0.003)" fill="#28323a"/>
</g>
</g>
<g id="Group_8117" data-name="Group 8117" transform="translate(0 7.741)">
<g id="Group_8116" data-name="Group 8116">
<path id="Path_4632" data-name="Path 4632" d="M6.037,127v13.343a2.015,2.015,0,0,0,1.984,2.017h9.035a8.359,8.359,0,0,1-1.178-4.264,8.25,8.25,0,0,1,11.736-7.49V127Z" transform="translate(-6.037 -127.003)" fill="#28323a"/>
</g>
</g>
<g id="Group_8119" data-name="Group 8119" transform="translate(10.813 11.549)">
<g id="Group_8118" data-name="Group 8118" transform="translate(0)">
<path id="Path_4633" data-name="Path 4633" d="M190.719,189.485a7.271,7.271,0,1,0,7.271,7.271A7.271,7.271,0,0,0,190.719,189.485Zm2.871,8.382h-3.268a.508.508,0,0,1-.5-.5v-4.276a.488.488,0,0,1,.975,0v3.8h2.792a.488.488,0,0,1,0,.975Z" transform="translate(-183.448 -189.485)" fill="#28323a"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -110,6 +110,16 @@ class MyAssets {
static String logo = "${assetPath}images/logo.svg";
static String splashLogo = "${assetPath}images/splash_logo.svg";
static String searchIcon = "${assetPath}icons/search_icon.svg";
static String miniClockDark = "${assetPath}icons/mini_clock_dark.svg";
static String scheduleAppointmentIcon = "${assetPath}icons/schedule_appointment_icon.svg";
static String creditCardIcon = "${assetPath}icons/credit_card_icon.svg";
static String reservedConeIcon = "${assetPath}icons/reserved_cone_icon.svg";
static String attachmentIcon = "${assetPath}icons/attachment_icon.svg";
static String carIcon = "${assetPath}icons/car_icon.svg";
static String clockIcon = "${assetPath}icons/clock_icon.svg";
static String closeWithOrangeBg = "${assetPath}icons/close_with_orange_bg.svg";
static String reviewIcon = "${assetPath}icons/review_icon.svg";
static String carHitIcon = "${assetPath}icons/car_hit_icon.svg";
//PNG

@ -21,5 +21,6 @@ class AppDependencies {
//repos
injector.registerSingleton<UserRepo>(() => UserRepoImp());
}
}

@ -53,6 +53,8 @@ class AppRoutes {
static const String dashboard = "/dashboard";
static const String bookProviderAppView = "/bookProviderAppView";
static const String appointmentDetailView = "/appointmentDetailView";
static const String adsDetailView = "/adsDetailView";
static const String createAdView = "/createAdView";

@ -26,6 +26,7 @@ class MyColors {
static const Color lightGreyEAColor = Color(0xffEAEAEA);
static const Color darkWhiteColor = Color(0xffE0E0E0);
static const Color redColor = Color(0xffD02127);
static const Color greenColor = Color(0xff1D934F);
static const Color yellowColor = Color(0xffF4E31C);
static const Color backgroundBlackColor = Color(0xff202529);
static const Color black = Color(0xff000000);

@ -5,6 +5,13 @@
// unverified,
// }
enum AdCreationStepsEnum {
vehicleDetails,
damageParts,
adDuration,
reviewAd,
}
enum AuthMethodTypes {
sms,
whatsApp,

@ -1,21 +1,25 @@
import 'package:flutter/material.dart';
import 'package:mc_common_app/extensions/string_extensions.dart';
import '../../theme/colors.dart';
import 'package:mc_common_app/theme/colors.dart';
class ShowFillButton extends StatelessWidget {
String title;
Color? backgroundColor;
VoidCallback onPressed;
Color txtColor;
double elevation, radius, maxWidth, maxHeight, fontSize, horizontalPadding, horizontalMargin, verticalMargin;
bool isFlatButton, isBold;
EdgeInsets? margin;
bool isFilled;
ShowFillButton({
super.key,
required this.title,
required this.onPressed,
this.txtColor = Colors.white,
this.backgroundColor = MyColors.darkPrimaryColor,
this.elevation = 0,
this.isFilled = true,
this.radius = 0,
this.maxWidth = 88,
this.maxHeight = 45,
@ -32,36 +36,38 @@ class ShowFillButton extends StatelessWidget {
Widget build(BuildContext context) {
return isFlatButton
? Container(
child: showButton(),
height: maxHeight,
padding: const EdgeInsets.only(
left: 20,
right: 20,
),
)
height: maxHeight,
padding: const EdgeInsets.only(
left: 20,
right: 20,
),
child: showButton(),
)
: Padding(
padding: margin ?? const EdgeInsets.all(0.0),
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: maxHeight,
minWidth: maxWidth,
maxHeight: maxHeight,
maxWidth: maxWidth,
),
child: showButton(),
),
);
padding: margin ?? const EdgeInsets.all(0.0),
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: maxHeight,
minWidth: maxWidth,
maxHeight: maxHeight,
maxWidth: maxWidth,
),
child: showButton(),
),
);
}
Widget showButton() {
return Container(
// decoration: isFlatButton ? null : MyColors.gradientButton,
color: isFlatButton ? null : MyColors.darkPrimaryColor,
color: isFlatButton ? null : isFilled ? backgroundColor : null,
margin: EdgeInsets.symmetric(horizontal: horizontalMargin, vertical: verticalMargin),
child: MaterialButton(
onPressed: onPressed,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(radius),
side: isFilled ? BorderSide.none: const BorderSide(width: 3, color: MyColors.darkPrimaryColor),
),
child: title.toText(
fontSize: fontSize,

@ -1,111 +0,0 @@
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/theme/colors.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
class AdWidget extends StatelessWidget {
final int count;
const AdWidget({Key? key, required this.count}) : super(key: key);
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: count,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.only(bottom: 15),
child: buildAdContainer(),
);
});
}
Widget buildAdContainer() {
return Row(
children: [
Image.asset(
MyAssets.bnCar,
width: 80,
height: 80,
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: [
"Toyota Crolla".toText(fontSize: 16, isBold: true),
Row(
children: [
"Model:".toText(
color: MyColors.lightTextColor,
),
2.width,
"2019".toText(),
],
),
Row(
children: [
"Mileage:".toText(
color: MyColors.lightTextColor,
),
2.width,
"73,000 km".toText(),
],
),
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.start,
children: [
"Riyadh".toText(
color: MyColors.lightTextColor,
),
"9 Hours Ago".toText(
color: MyColors.lightTextColor,
),
],
),
],
),
8.height,
Row(
children: [
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"30,000".toText(fontSize: 16, isBold: true),
2.width,
"SAR:".toText(
color: MyColors.lightTextColor,
),
],
),
),
const Icon(Icons.arrow_forward)
],
),
],
),
),
],
).toWhiteContainer(width: double.infinity, allPading: 12);
}
}

@ -0,0 +1,145 @@
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/theme/colors.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
class BuildAdsList extends StatelessWidget {
final int count;
final Function() onAdPressed;
final ScrollPhysics? scrollPhysics;
const BuildAdsList({Key? key, required this.count, this.scrollPhysics, required this.onAdPressed}) : super(key: key);
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: count,
shrinkWrap: true,
physics: scrollPhysics,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.only(bottom: 15),
child: AdCard(isReserved: index == 3),
).onPress(onAdPressed);
});
}
}
class AdCard extends StatelessWidget {
final bool isReserved;
const AdCard({Key? key, required this.isReserved}) : super(key: key);
@override
Widget build(BuildContext context) {
return Stack(
alignment: Alignment.center,
children: [
Row(
children: [
Image.asset(
MyAssets.bnCar,
width: 80,
height: 80,
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: [
"Toyota Crolla".toText(fontSize: 16, isBold: true),
Row(
children: [
"Model:".toText(
color: MyColors.lightTextColor,
),
2.width,
"2019".toText(),
],
),
Row(
children: [
"Mileage:".toText(
color: MyColors.lightTextColor,
),
2.width,
"73,000 km".toText(),
],
),
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.start,
children: [
"Riyadh".toText(
color: MyColors.lightTextColor,
),
"9 Hours Ago".toText(
color: MyColors.lightTextColor,
),
],
),
],
),
8.height,
Row(
children: [
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"30,000".toText(fontSize: 16, isBold: true),
2.width,
"SAR:".toText(
color: MyColors.lightTextColor,
),
],
),
),
const Icon(Icons.arrow_forward)
],
),
],
),
),
],
),
if (isReserved)
Container(
height: 100,
alignment: Alignment.center,
color: MyColors.white.withOpacity(0.9),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
MyAssets.reservedConeIcon.buildSvg(),
5.width,
"Reserved".toText(
color: MyColors.darkPrimaryColor,
fontSize: 17,
isBold: true,
)
],
),
)
else
const SizedBox(),
],
).toWhiteContainer(width: double.infinity, allPading: 12);
}
}

@ -95,7 +95,8 @@ class CustomAppBar extends StatelessWidget with PreferredSizeWidget {
return Column(
children: [
AppBar(
leadingWidth: leadingWidth??61,
automaticallyImplyLeading: false,
leadingWidth: leadingWidth ?? 61,
backgroundColor: backgroundColor ?? Colors.white,
elevation: elevation ?? 0,
centerTitle: isTitleCenter ?? true,
@ -126,7 +127,7 @@ class CustomAppBar extends StatelessWidget with PreferredSizeWidget {
color: Colors.black,
size: 16,
),
onPressed: () => onTap??Navigator.of(context).pop(),
onPressed: () => onTap ?? Navigator.of(context).pop(),
).toContainer(
paddingAll: 0,
borderRadius: 100,
@ -145,10 +146,9 @@ class CustomAppBar extends StatelessWidget with PreferredSizeWidget {
),
if (backgroundColor == null)
const Divider(
thickness: 1,
color: MyColors.lightGreyEFColor,
height: 1,
)
thickness: 1,
// color: MyColors.lightGreyEFColor,
height: 1)
],
);
}

@ -0,0 +1,38 @@
import 'package:flutter/material.dart';
import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
class CardButtonWithIcon extends StatelessWidget {
final Widget icon;
final Function() onCardTapped;
final String title;
const CardButtonWithIcon({
Key? key,
required this.onCardTapped,
required this.title,
required this.icon,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
height: 110,
width: 110,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
icon,
// 16.height,
title.toText(
fontSize: 11,
isBold: true,
textAlign: TextAlign.left,
)
],
).toWhiteContainer(allPading: 12, width: double.infinity).onPress(onCardTapped),
);
}
}

@ -26,32 +26,19 @@ class CustomerAppointmentSliderWidget extends StatelessWidget {
// },
),
itemCount: 10,
itemBuilder: (BuildContext context, int itemIndex, int pageViewIndex) => const BuildAppointmentContainerForCustomer(isForHome: true),
);
}
Widget showServices(String title) {
return Row(
children: [
const Icon(
Icons.ac_unit,
color: MyColors.primaryColor,
size: 18,
),
8.width,
title.toText(
fontSize: 14,
isBold: true,
),
],
itemBuilder: (BuildContext context, int itemIndex, int pageViewIndex) => BuildAppointmentContainerForCustomer(
isForHome: true,
onTapped: () {},
),
);
}
}
class BuildAppointmentContainerForCustomer extends StatelessWidget {
final bool? isForHome;
final Function() onTapped;
const BuildAppointmentContainerForCustomer({Key? key, this.isForHome = false}) : super(key: key);
const BuildAppointmentContainerForCustomer({Key? key, this.isForHome = false, required this.onTapped}) : super(key: key);
Widget showServices(String title, String icon) {
return Row(
@ -69,7 +56,11 @@ class BuildAppointmentContainerForCustomer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.only(bottom: 21, left: 21, right: 21, top: 7),
margin: const EdgeInsets.only(
bottom: 10,
left: 21,
right: 21,
),
child: Column(
children: [
Row(
@ -146,7 +137,7 @@ class BuildAppointmentContainerForCustomer extends StatelessWidget {
],
),
],
).toWhiteContainer(width: double.infinity, allPading: 12),
).onPress(onTapped).toWhiteContainer(width: double.infinity, allPading: 12),
);
}
}

@ -0,0 +1,109 @@
import 'package:flutter/material.dart';
import 'dart:math' as math;
class DashedRect extends StatelessWidget {
final Color color;
final double strokeWidth;
final double gap;
final Widget child;
const DashedRect({
super.key,
this.color = Colors.black,
this.strokeWidth = 1.0,
this.gap = 5.0,
required this.child,
});
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.all(strokeWidth / 2),
child: CustomPaint(
painter: DashRectPainter(color: color, strokeWidth: strokeWidth, gap: gap),
child: Center(child: child),
),
);
}
}
class DashRectPainter extends CustomPainter {
double strokeWidth;
Color color;
double gap;
DashRectPainter({this.strokeWidth = 5.0, this.color = Colors.red, this.gap = 5.0});
@override
void paint(Canvas canvas, Size size) {
Paint dashedPaint = Paint()
..color = color
..strokeWidth = strokeWidth
..style = PaintingStyle.stroke;
double x = size.width;
double y = size.height;
Path topPath = getDashedPath(
a: const math.Point(0, 0),
b: math.Point(x, 0),
gap: gap,
);
Path rightPath = getDashedPath(
a: math.Point(x, 0),
b: math.Point(x, y),
gap: gap,
);
Path bottomPath = getDashedPath(
a: math.Point(0, y),
b: math.Point(x, y),
gap: gap,
);
Path leftPath = getDashedPath(
a: const math.Point(0, 0),
b: math.Point(0.001, y),
gap: gap,
);
canvas.drawPath(topPath, dashedPaint);
canvas.drawPath(rightPath, dashedPaint);
canvas.drawPath(bottomPath, dashedPaint);
canvas.drawPath(leftPath, dashedPaint);
}
Path getDashedPath({
required math.Point<double> a,
required math.Point<double> b,
@required gap,
}) {
Size size = Size(b.x - a.x, b.y - a.y);
Path path = Path();
path.moveTo(a.x, a.y);
bool shouldDraw = true;
math.Point currentPoint = math.Point(a.x, a.y);
num radians = math.atan(size.height / size.width);
num dx = math.cos(radians) * gap < 0 ? math.cos(radians) * gap * -1 : math.cos(radians) * gap;
num dy = math.sin(radians) * gap < 0 ? math.sin(radians) * gap * -1 : math.sin(radians) * gap;
while (currentPoint.x <= b.x && currentPoint.y <= b.y) {
shouldDraw ? path.lineTo(currentPoint.x.toDouble(), currentPoint.y.toDouble()) : path.moveTo(currentPoint.x.toDouble(), currentPoint.y.toDouble());
shouldDraw = !shouldDraw;
currentPoint = math.Point(
currentPoint.x + dx,
currentPoint.y + dy,
);
}
return path;
}
@override
bool shouldRepaint(CustomPainter oldDelegate) {
return true;
}
}

@ -328,10 +328,11 @@ extension xDouble on int {
}
extension BuildSVG on String {
Widget buildSvg({double? height, double? width, BoxFit fit = BoxFit.contain}) {
Widget buildSvg({double? height, double? width, BoxFit fit = BoxFit.contain, Color? color}) {
return SvgPicture.asset(
this,
fit: fit,
color: color,
height: height,
width: width,
);

Loading…
Cancel
Save