Merge branch 'faiz_development_common' into 'master'
Added Ads Module See merge request mirza.shafique/car_common_app!8merge-requests/9/merge
@ -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 |
@ -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,57 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:mc_common_app/services/services.dart';
|
||||
import 'package:mc_common_app/utils/enums.dart';
|
||||
import 'package:mc_common_app/view_models/base_view_model.dart';
|
||||
|
||||
class AdVM extends BaseVM {
|
||||
final CommonServices commonServices;
|
||||
|
||||
AdVM({required this.commonServices});
|
||||
|
||||
AdCreationStepsEnum currentProgressStep = AdCreationStepsEnum.vehicleDetails;
|
||||
|
||||
void updateCurrentStep() {
|
||||
switch (currentProgressStep) {
|
||||
case AdCreationStepsEnum.vehicleDetails:
|
||||
currentProgressStep = AdCreationStepsEnum.damageParts;
|
||||
notifyListeners();
|
||||
break;
|
||||
case AdCreationStepsEnum.damageParts:
|
||||
currentProgressStep = AdCreationStepsEnum.adDuration;
|
||||
notifyListeners();
|
||||
break;
|
||||
case AdCreationStepsEnum.adDuration:
|
||||
currentProgressStep = AdCreationStepsEnum.reviewAd;
|
||||
notifyListeners();
|
||||
break;
|
||||
case AdCreationStepsEnum.reviewAd:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool financeAvailableStatus = false;
|
||||
|
||||
void updateFinanceAvailableStatus(bool status) {
|
||||
financeAvailableStatus = status;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
List<File> pickedImages = [];
|
||||
|
||||
void removeImageFromList(int index) {
|
||||
pickedImages.removeAt(index);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// sourceFlag for Camera = 0
|
||||
// sourceFlag for Gallery = 1
|
||||
void pickImageFromPhone(int sourceFlag) async {
|
||||
File? file = await commonServices.pickImageFromPhone(1);
|
||||
|
||||
if (file != null) {
|
||||
pickedImages.add(file);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,466 @@
|
||||
import 'package:flutter/cupertino.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/theme/colors.dart';
|
||||
import 'package:mc_common_app/utils/enums.dart';
|
||||
import 'package:mc_common_app/view_models/ad_view_model.dart';
|
||||
import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
|
||||
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||
import 'package:mc_common_app/widgets/txt_field.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:mc_common_app/widgets/common_widgets/dotted_rect.dart';
|
||||
|
||||
class AttachImageContainer extends StatelessWidget {
|
||||
final Function() onTap;
|
||||
|
||||
const AttachImageContainer({Key? key, required this.onTap}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
height: 46,
|
||||
width: double.infinity,
|
||||
color: MyColors.white,
|
||||
child: DashedRect(
|
||||
color: MyColors.lightIconColor,
|
||||
strokeWidth: 2.0,
|
||||
gap: 4.0,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
MyAssets.attachmentIcon.buildSvg(),
|
||||
"Attach Image".toText(
|
||||
fontSize: 15,
|
||||
isBold: true,
|
||||
color: MyColors.darkPrimaryColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BuildAdStepContainer extends StatelessWidget {
|
||||
final WidgetBuilder onVehicleDetails;
|
||||
final WidgetBuilder onDamageParts;
|
||||
final WidgetBuilder onAdDuration;
|
||||
final WidgetBuilder onReviewAd;
|
||||
final AdCreationStepsEnum adCreationStepsEnum;
|
||||
|
||||
const BuildAdStepContainer({
|
||||
Key? key,
|
||||
required this.onVehicleDetails,
|
||||
required this.onDamageParts,
|
||||
required this.onAdDuration,
|
||||
required this.onReviewAd,
|
||||
required this.adCreationStepsEnum,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
switch (adCreationStepsEnum) {
|
||||
case AdCreationStepsEnum.vehicleDetails:
|
||||
return onVehicleDetails(context);
|
||||
|
||||
case AdCreationStepsEnum.damageParts:
|
||||
return onDamageParts(context);
|
||||
|
||||
case AdCreationStepsEnum.adDuration:
|
||||
return onAdDuration(context);
|
||||
|
||||
case AdCreationStepsEnum.reviewAd:
|
||||
return onReviewAd(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleDetails extends StatelessWidget {
|
||||
const VehicleDetails({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<DropValue> dropList = [
|
||||
DropValue(0, "Maintenance", ""),
|
||||
DropValue(1, "Car Wash", ""),
|
||||
DropValue(2, "Monthly Checkup", ""),
|
||||
DropValue(3, "Friendly Visit", ""),
|
||||
DropValue(4, "Muftaa", ""),
|
||||
];
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
"Vehicle Detail".toText(fontSize: 18, isBold: true),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Vehicle Type",
|
||||
),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Vehicle Model",
|
||||
),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Vehicle Model Year",
|
||||
),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Vehicle Color",
|
||||
),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Vehicle Condition",
|
||||
),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Vehicle Category",
|
||||
),
|
||||
8.height,
|
||||
TxtField(
|
||||
hint: "Vehicle Mileage",
|
||||
// onChanged: (v) => email = v,
|
||||
),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Vehicle Transmission",
|
||||
),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Vehicle Seller Type",
|
||||
),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Vehicle Country",
|
||||
),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Vehicle City",
|
||||
),
|
||||
8.height,
|
||||
TxtField(
|
||||
hint: "Demand Amount",
|
||||
// onChanged: (v) => email = v,
|
||||
),
|
||||
8.height,
|
||||
TxtField(
|
||||
hint: "Vehicle VIN",
|
||||
// onChanged: (v) => email = v,
|
||||
),
|
||||
8.height,
|
||||
TxtField(
|
||||
hint: "Vehicle Title",
|
||||
// onChanged: (v) => email = v,
|
||||
),
|
||||
8.height,
|
||||
TxtField(
|
||||
hint: "Warranty Available (No. of Years)",
|
||||
// onChanged: (v) => email = v,
|
||||
),
|
||||
8.height,
|
||||
TxtField(
|
||||
hint: "Vehicle Description",
|
||||
maxLines: 5,
|
||||
// onChanged: (v) => email = v,
|
||||
),
|
||||
22.height,
|
||||
"Finance Available".toText(fontSize: 16),
|
||||
8.height,
|
||||
Consumer(builder: (BuildContext context, AdVM adVm, Widget? child) {
|
||||
return Container(
|
||||
width: 65,
|
||||
height: 37,
|
||||
decoration: BoxDecoration(
|
||||
color: adVm.financeAvailableStatus ? MyColors.darkPrimaryColor : MyColors.white,
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: MyColors.black, width: 1.5),
|
||||
),
|
||||
child: CupertinoSwitch(
|
||||
activeColor: MyColors.darkPrimaryColor,
|
||||
trackColor: MyColors.white,
|
||||
thumbColor: MyColors.grey98Color,
|
||||
value: adVm.financeAvailableStatus,
|
||||
onChanged: (value) {
|
||||
adVm.updateFinanceAvailableStatus(value);
|
||||
},
|
||||
),
|
||||
);
|
||||
}),
|
||||
28.height,
|
||||
"Vehicle Pictures".toText(fontSize: 18, isBold: true),
|
||||
8.height,
|
||||
AttachImageContainer(onTap: () {
|
||||
context.read<AdVM>().pickImageFromPhone(1);
|
||||
}),
|
||||
20.height,
|
||||
],
|
||||
).toWhiteContainer(width: double.infinity, allPading: 12, margin: EdgeInsets.symmetric(horizontal: 21, vertical: 10));
|
||||
}
|
||||
}
|
||||
|
||||
class DamageParts extends StatelessWidget {
|
||||
const DamageParts({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<DropValue> dropList = [
|
||||
DropValue(0, "Door Handles", ""),
|
||||
DropValue(1, "Wind Screen", ""),
|
||||
DropValue(2, "Rear Light", ""),
|
||||
DropValue(3, "Bumper", ""),
|
||||
DropValue(4, "Headlight", ""),
|
||||
];
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
"Vehicle Damage Pictures".toText(fontSize: 18, isBold: true),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Vehicle Part",
|
||||
),
|
||||
8.height,
|
||||
AttachImageContainer(onTap: () {
|
||||
context.read<AdVM>().pickImageFromPhone(1);
|
||||
}),
|
||||
20.height,
|
||||
],
|
||||
).toWhiteContainer(width: double.infinity, allPading: 12, margin: EdgeInsets.symmetric(horizontal: 21, vertical: 10));
|
||||
}
|
||||
}
|
||||
|
||||
class AdDuration extends StatelessWidget {
|
||||
const AdDuration({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<DropValue> dropList = [
|
||||
DropValue(0, "One Week", ""),
|
||||
DropValue(1, "Two Weeks", ""),
|
||||
DropValue(2, "Three Weeks", ""),
|
||||
DropValue(3, "One Month", ""),
|
||||
];
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
"Ad Duration".toText(fontSize: 18, isBold: true),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Select Duration",
|
||||
),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Start Date",
|
||||
),
|
||||
28.height,
|
||||
"Select Special Services".toText(fontSize: 18, isBold: true),
|
||||
8.height,
|
||||
DropdownField(
|
||||
(DropValue value) {},
|
||||
list: dropList,
|
||||
hint: "Ad Management",
|
||||
),
|
||||
20.height,
|
||||
],
|
||||
).toWhiteContainer(width: double.infinity, allPading: 12, margin: EdgeInsets.symmetric(horizontal: 21, vertical: 10));
|
||||
}
|
||||
}
|
||||
|
||||
class SingleDetailWidget extends StatelessWidget {
|
||||
final String title;
|
||||
final String subTitle;
|
||||
|
||||
const SingleDetailWidget({Key? key, required this.title, required this.subTitle}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
"$subTitle:".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
||||
title.toText(fontSize: 14, color: MyColors.black, isBold: true),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ReviewAd extends StatelessWidget {
|
||||
const ReviewAd({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
VehicleDetailsReview(),
|
||||
DamagePartsReview(),
|
||||
AdDurationReview(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleDetailsReview extends StatelessWidget {
|
||||
const VehicleDetailsReview({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
"Vehicle Details".toText(fontSize: 18, isBold: true),
|
||||
8.height,
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 5,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 5,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
SingleDetailWidget(title: "Vehicle Type", subTitle: "Car"),
|
||||
16.height,
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SingleDetailWidget(title: "Warranty Available", subTitle: "0 Years"),
|
||||
8.height,
|
||||
SingleDetailWidget(subTitle: "Description", title: "Some Two lines Description about the car and its unique features"),
|
||||
8.height,
|
||||
SingleDetailWidget(subTitle: "Finance Available", title: "No"),
|
||||
8.height,
|
||||
"Vehicle Pictures:".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
||||
],
|
||||
).toWhiteContainer(width: double.infinity, allPading: 12, margin: EdgeInsets.symmetric(horizontal: 21, vertical: 10));
|
||||
}
|
||||
}
|
||||
|
||||
class DamagePartsReview extends StatelessWidget {
|
||||
const DamagePartsReview({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
"Vehicle Damage Part".toText(fontSize: 18, isBold: true),
|
||||
8.height,
|
||||
Row(
|
||||
children: [
|
||||
SingleDetailWidget(subTitle: "Vehicle Part", title: "Bumper"),
|
||||
],
|
||||
),
|
||||
8.height,
|
||||
"Damage Part Pictures:".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
||||
],
|
||||
).toWhiteContainer(width: double.infinity, allPading: 12, margin: EdgeInsets.symmetric(horizontal: 21, vertical: 10));
|
||||
}
|
||||
}
|
||||
|
||||
class AdDurationReview extends StatelessWidget {
|
||||
const AdDurationReview({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
"Vehicle Damage Part".toText(fontSize: 18, isBold: true),
|
||||
8.height,
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 5,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SingleDetailWidget(subTitle: "Duration", title: "One Week"),
|
||||
8.height,
|
||||
SingleDetailWidget(subTitle: "Special Services", title: "Ad Management"),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 5,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SingleDetailWidget(subTitle: "Start Date", title: "5 February, 2023"),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
).toWhiteContainer(width: double.infinity, allPading: 12, margin: EdgeInsets.symmetric(horizontal: 21, vertical: 10));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,130 @@
|
||||
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/views/advertisement/ads_images_slider.dart';
|
||||
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
||||
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
||||
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||
|
||||
class AdsDetailView extends StatelessWidget {
|
||||
const AdsDetailView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: CustomAppBar(
|
||||
backgroundColor: MyColors.backgroundColor,
|
||||
title: "Ads",
|
||||
profileImageUrl: MyAssets.bnCar,
|
||||
isRemoveBackButton: false,
|
||||
isDrawerEnabled: false,
|
||||
),
|
||||
body: Container(
|
||||
padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21),
|
||||
child: Stack(
|
||||
children: [
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const CarouselWithIndicatorDemo(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
"Toyota Corolla | Silver".toText(fontSize: 18, isBold: true),
|
||||
"Jeddah".toText(fontSize: 10, isBold: true, color: MyColors.lightTextColor),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
"Model: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
||||
"2019".toText(
|
||||
fontSize: 14,
|
||||
isBold: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
"Saudi Arabia".toText(fontSize: 10, isBold: true, color: MyColors.lightTextColor),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
"Mileage: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
||||
"10928Km".toText(
|
||||
fontSize: 14,
|
||||
isBold: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
"5 Hours ago".toText(fontSize: 10, isBold: true, color: MyColors.lightTextColor),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
"Transmission: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
||||
"Automatic".toText(
|
||||
fontSize: 14,
|
||||
isBold: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
8.height,
|
||||
"Description: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
||||
"No Issue in the car. All parts are genuine with no major accident. ".toText(
|
||||
fontSize: 14,
|
||||
isBold: true,
|
||||
),
|
||||
],
|
||||
).toWhiteContainer(width: double.infinity, allPading: 12),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
height: 150,
|
||||
child: Column(
|
||||
children: [
|
||||
Divider(thickness: 1, height: 1),
|
||||
18.height,
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
"35,000".toText(fontSize: 30, isBold: true),
|
||||
"SAR".toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor),
|
||||
],
|
||||
),
|
||||
14.height,
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ShowFillButton(
|
||||
maxHeight: 55,
|
||||
title: "Reserve Ad",
|
||||
onPressed: () {},
|
||||
),
|
||||
),
|
||||
12.width,
|
||||
Container(
|
||||
height: 55,
|
||||
width: 55,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(border: Border.all(color: MyColors.black, width: 3)),
|
||||
child: Icon(Icons.phone, color: MyColors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:mc_common_app/classes/consts.dart';
|
||||
import 'package:mc_common_app/theme/colors.dart';
|
||||
|
||||
class CarouselWithIndicatorDemo extends StatefulWidget {
|
||||
const CarouselWithIndicatorDemo({super.key});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _CarouselWithIndicatorState();
|
||||
}
|
||||
|
||||
class _CarouselWithIndicatorState extends State<CarouselWithIndicatorDemo> {
|
||||
int _current = 0;
|
||||
final CarouselController _controller = CarouselController();
|
||||
|
||||
final imgList = [
|
||||
MyAssets.bnCar,
|
||||
MyAssets.bnCar,
|
||||
MyAssets.bnCar,
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(children: [
|
||||
CarouselSlider(
|
||||
items: imgList
|
||||
.map((item) => Container(
|
||||
margin: EdgeInsets.all(5.0),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5.0)),
|
||||
child: Image.asset(item, fit: BoxFit.cover),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
carouselController: _controller,
|
||||
options: CarouselOptions(
|
||||
autoPlay: false,
|
||||
enlargeCenterPage: false,
|
||||
aspectRatio: 1.8,
|
||||
onPageChanged: (index, reason) {
|
||||
setState(() {
|
||||
_current = index;
|
||||
});
|
||||
}),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: imgList.asMap().entries.map((entry) {
|
||||
return GestureDetector(
|
||||
onTap: () => _controller.animateToPage(entry.key),
|
||||
child: Container(
|
||||
width: 12.0,
|
||||
height: 12.0,
|
||||
margin: EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: _current == entry.key ? MyColors.darkPrimaryColor : MyColors.lightTextColor.withOpacity(0.5),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
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/utils/enums.dart';
|
||||
import 'package:mc_common_app/view_models/ad_view_model.dart';
|
||||
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class CreateAdProgressSteps extends StatelessWidget {
|
||||
const CreateAdProgressSteps({Key? key}) : super(key: key);
|
||||
|
||||
Widget buildStep(String icon, String title, bool isSelected) {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 50,
|
||||
width: 50,
|
||||
padding: const EdgeInsets.all(08),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: isSelected ? MyColors.darkPrimaryColor : MyColors.white,
|
||||
border: Border.all(
|
||||
color: isSelected ? MyColors.darkPrimaryColor : MyColors.lightIconColor,
|
||||
),
|
||||
),
|
||||
child: icon.buildSvg(color: isSelected ? MyColors.white : MyColors.lightIconColor,),
|
||||
),
|
||||
5.height,
|
||||
title.toText(
|
||||
textAlign: TextAlign.center,
|
||||
isBold: true,
|
||||
fontSize: 12,
|
||||
color: isSelected ? MyColors.black : MyColors.lightIconColor,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
AdVM adVM = context.watch<AdVM>();
|
||||
return Stack(
|
||||
// alignment: Alignment.center,
|
||||
children: [
|
||||
const Divider(thickness: 2).paddingOnly(left: 21, right: 21, top: 15),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
buildStep(MyAssets.carIcon, "Vehicle \n Details", adVM.currentProgressStep == AdCreationStepsEnum.vehicleDetails),
|
||||
buildStep(MyAssets.carHitIcon, "Damage \n Parts", adVM.currentProgressStep == AdCreationStepsEnum.damageParts),
|
||||
buildStep(MyAssets.clockIcon, "Ad \n Duration", adVM.currentProgressStep == AdCreationStepsEnum.adDuration),
|
||||
buildStep(MyAssets.reviewIcon, "Review \n Ad", adVM.currentProgressStep == AdCreationStepsEnum.reviewAd),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,185 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mc_common_app/extensions/int_extensions.dart';
|
||||
import 'package:mc_common_app/theme/colors.dart';
|
||||
import 'package:mc_common_app/utils/enums.dart';
|
||||
import 'package:mc_common_app/utils/navigator.dart';
|
||||
import 'package:mc_common_app/view_models/ad_view_model.dart';
|
||||
import 'package:mc_common_app/views/advertisement/ad_creation_steps_containers.dart';
|
||||
import 'package:mc_common_app/views/advertisement/create_ad_progress_steps.dart';
|
||||
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
||||
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
||||
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class CreateAdView extends StatelessWidget {
|
||||
const CreateAdView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: const CustomAppBar(title: "Create Ad", isRemoveBackButton: false, isDrawerEnabled: false),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const CreateAdProgressSteps(),
|
||||
22.height,
|
||||
Consumer(builder: (BuildContext context, AdVM adVm, Widget? child) {
|
||||
return BuildAdStepContainer(
|
||||
onVehicleDetails: (context) => const VehicleDetails(),
|
||||
onDamageParts: (context) => const DamageParts(),
|
||||
onAdDuration: (context) => const AdDuration(),
|
||||
onReviewAd: (context) => const ReviewAd(),
|
||||
adCreationStepsEnum: adVm.currentProgressStep,
|
||||
);
|
||||
}),
|
||||
10.height,
|
||||
const BuildFooterButton().horPaddingMain(),
|
||||
10.height,
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BuildFooterButton extends StatelessWidget {
|
||||
const BuildFooterButton({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer(
|
||||
builder: (BuildContext context, AdVM adVm, Widget? child) {
|
||||
switch (adVm.currentProgressStep) {
|
||||
case AdCreationStepsEnum.vehicleDetails:
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: ShowFillButton(
|
||||
title: "Next",
|
||||
onPressed: () {
|
||||
adVm.updateCurrentStep();
|
||||
},
|
||||
),
|
||||
);
|
||||
case AdCreationStepsEnum.damageParts:
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ShowFillButton(
|
||||
txtColor: MyColors.black,
|
||||
maxHeight: 55,
|
||||
title: "Cancel",
|
||||
onPressed: () {
|
||||
pop(context);
|
||||
},
|
||||
backgroundColor: MyColors.greyButtonColor,
|
||||
),
|
||||
),
|
||||
12.width,
|
||||
Expanded(
|
||||
child: ShowFillButton(
|
||||
maxHeight: 55,
|
||||
title: "Next",
|
||||
onPressed: () {
|
||||
adVm.updateCurrentStep();
|
||||
},
|
||||
backgroundColor: MyColors.darkPrimaryColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
case AdCreationStepsEnum.adDuration:
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ShowFillButton(
|
||||
txtColor: MyColors.black,
|
||||
maxHeight: 55,
|
||||
title: "Cancel",
|
||||
onPressed: () {
|
||||
pop(context);
|
||||
},
|
||||
backgroundColor: MyColors.greyButtonColor,
|
||||
),
|
||||
),
|
||||
12.width,
|
||||
Expanded(
|
||||
child: ShowFillButton(
|
||||
maxHeight: 55,
|
||||
title: "Next",
|
||||
onPressed: () {
|
||||
adVm.updateCurrentStep();
|
||||
},
|
||||
backgroundColor: MyColors.darkPrimaryColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
case AdCreationStepsEnum.reviewAd:
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ShowFillButton(
|
||||
txtColor: MyColors.black,
|
||||
maxHeight: 55,
|
||||
title: "Cancel",
|
||||
onPressed: () {
|
||||
pop(context);
|
||||
},
|
||||
backgroundColor: MyColors.greyButtonColor,
|
||||
),
|
||||
),
|
||||
12.width,
|
||||
Expanded(
|
||||
child: ShowFillButton(
|
||||
maxHeight: 55,
|
||||
title: "Submit Ad",
|
||||
onPressed: () {},
|
||||
backgroundColor: MyColors.darkPrimaryColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
default:
|
||||
const SizedBox();
|
||||
}
|
||||
return const SizedBox();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BuildAdStepContainer extends StatelessWidget {
|
||||
final WidgetBuilder onVehicleDetails;
|
||||
final WidgetBuilder onDamageParts;
|
||||
final WidgetBuilder onAdDuration;
|
||||
final WidgetBuilder onReviewAd;
|
||||
final AdCreationStepsEnum adCreationStepsEnum;
|
||||
|
||||
const BuildAdStepContainer({
|
||||
Key? key,
|
||||
required this.onVehicleDetails,
|
||||
required this.onDamageParts,
|
||||
required this.onAdDuration,
|
||||
required this.onReviewAd,
|
||||
required this.adCreationStepsEnum,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
switch (adCreationStepsEnum) {
|
||||
case AdCreationStepsEnum.vehicleDetails:
|
||||
return onVehicleDetails(context);
|
||||
|
||||
case AdCreationStepsEnum.damageParts:
|
||||
return onDamageParts(context);
|
||||
|
||||
case AdCreationStepsEnum.adDuration:
|
||||
return onAdDuration(context);
|
||||
|
||||
case AdCreationStepsEnum.reviewAd:
|
||||
return onReviewAd(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -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,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;
|
||||
}
|
||||
}
|
||||
@ -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));
|
||||
}
|
||||
}
|
||||