codigo actual del servidor, con avances de joan

This commit is contained in:
Jose Sanchez
2023-08-07 15:52:04 -04:00
commit 3cd9b8bbe8
3070 changed files with 532255 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
var this_year = DateTime.now().year.toString();
class AppConfig {
static String copyright_text =
"APP NEGOCIOS" + this_year; //this shows in the splash screen
static String app_name =
"APP NEGOCIOS"; //this shows in the splash screen
static String purchase_code =
"f0f2e1cc-3250-40c5-bed4-168b74b8ed07"; //enter your purchase code for the app from codecanyon
//configure this
static const bool HTTPS = false;
//Default language config
static String default_language = "en";
static String mobile_app_code = "en";
static bool app_language_rtl = false;
//configure this
static const DOMAIN_PATH =
"devs.lapieza.net/sellerapp"; //inside a folder
//do not configure these below
static const String API_ENDPATH = "api/v2";
static const String PUBLIC_FOLDER = "public";
static const String PROTOCOL = HTTPS ? "https://" : "http://";
static const String SELLER_PREFIX = "seller";
static const String RAW_BASE_URL = "${PROTOCOL}${DOMAIN_PATH}";
static const String BASE_URL = "${RAW_BASE_URL}/${API_ENDPATH}";
static const String BASE_URL_WITH_PREFIX = "${BASE_URL}/${SELLER_PREFIX}";
}

View File

@@ -0,0 +1,33 @@
import 'package:active_ecommerce_seller_app/custom/localization.dart';
import 'package:one_context/one_context.dart';
class DeliveryStatus {
String option_key;
String name;
DeliveryStatus(this.option_key, this.name);
static List<DeliveryStatus> getDeliveryStatusList() {
return <DeliveryStatus>[
DeliveryStatus('', LangText(context: OneContext().context).getLocal()!.all_ucf),
DeliveryStatus('pending', LangText(context: OneContext().context).getLocal()!.pending_ucf),
DeliveryStatus('confirmed', LangText(context: OneContext().context).getLocal()!.confirmed_ucf),
DeliveryStatus('picked_up', LangText(context: OneContext().context).getLocal()!.picked_up_ucf),
DeliveryStatus('on_the_way', LangText(context: OneContext().context).getLocal()!.on_the_way_ucf),
DeliveryStatus('delivered', LangText(context: OneContext().context).getLocal()!.delivered_ucf),
DeliveryStatus('cancelled', LangText(context: OneContext().context).getLocal()!.cancel_ucf),
];
}
static List<DeliveryStatus> getDeliveryStatusListForUpdate() {
return <DeliveryStatus>[
DeliveryStatus('pending', LangText(context: OneContext().context).getLocal()!.pending_ucf),
DeliveryStatus('confirmed', LangText(context: OneContext().context).getLocal()!.confirmed_ucf),
DeliveryStatus('picked_up', LangText(context: OneContext().context).getLocal()!.picked_up_ucf),
DeliveryStatus('on_the_way', LangText(context: OneContext().context).getLocal()!.on_the_way_ucf),
DeliveryStatus('delivered', LangText(context: OneContext().context).getLocal()!.delivered_ucf),
DeliveryStatus('cancelled', LangText(context: OneContext().context).getLocal()!.cancel_ucf),
];
}
}

View File

@@ -0,0 +1,24 @@
import 'package:active_ecommerce_seller_app/custom/localization.dart';
import 'package:one_context/one_context.dart';
class PaymentStatus {
String option_key;
String name;
PaymentStatus(this.option_key, this.name);
static List<PaymentStatus> getPaymentStatusList() {
return <PaymentStatus>[
PaymentStatus('', LangText(context: OneContext().context).getLocal()!.all_ucf),
PaymentStatus('paid', LangText(context: OneContext().context).getLocal()!.paid_ucf),
PaymentStatus('unpaid', LangText(context: OneContext().context).getLocal()!.unpaid_ucf),
];
}
static List<PaymentStatus> getPaymentStatusListForUpdater() {
return <PaymentStatus>[
PaymentStatus('paid', LangText(context: OneContext().context).getLocal()!.paid_ucf,),
PaymentStatus('unpaid', LangText(context: OneContext().context).getLocal()!.unpaid_ucf),
];
}
}

View File

@@ -0,0 +1,15 @@
import 'package:flutter/cupertino.dart';
class AppStyles{
static double layoutMargin = 16;
static double listItemsMargin=16;
static double itemMargin=16;
static FontWeight normal = FontWeight.normal;
static FontWeight medium = FontWeight.w500;
static FontWeight bold = FontWeight.bold;
static FontWeight extraBold = FontWeight.w800;
static FontWeight light = FontWeight.w400;
static FontWeight extraLight = FontWeight.w300;
}

View File

@@ -0,0 +1,23 @@
import 'package:active_ecommerce_seller_app/data_model/language_list_response.dart';
class CommonDropDownItem{
String? key,value;
CommonDropDownItem(this.key, this.value);
}
class ColorModel{
String? key,value,name;
ColorModel(this.key, this.value);
}
class LanguageDropModel{
String key,value;
Language language;
LanguageDropModel(this.key, this.value,this.language);
}

View File

@@ -0,0 +1,197 @@
import 'package:active_ecommerce_seller_app/custom/device_info.dart';
import 'package:active_ecommerce_seller_app/custom/localization.dart';
import 'package:active_ecommerce_seller_app/custom/route_transaction.dart';
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:active_ecommerce_seller_app/screens/chat_list.dart';
import 'package:active_ecommerce_seller_app/screens/coupon/coupons.dart';
import 'package:active_ecommerce_seller_app/screens/money_withdraw.dart';
import 'package:active_ecommerce_seller_app/screens/payment_history.dart';
import 'package:active_ecommerce_seller_app/screens/refund_request.dart';
import 'package:active_ecommerce_seller_app/screens/support_ticket.dart';
import 'package:flutter/material.dart';
class FeaturesList{
BuildContext context ;
FeaturesList(this.context);
List<Widget> getFeatureList() {
List<Widget> featureList = [];
featureList.add(Visibility(
visible: conversation_activation.$,
child: InkWell(
onTap: () {
MyTransaction(context: context).push(ChatList());
},
child: Container(
height:40,
child: Column(
children: [
Image.asset(
'assets/icon/chat.png',
width: 16,
height: 16,
color: MyTheme.white,
),
SizedBox(
height: 5,
),
Text(
LangText(context: context)
.getLocal()!
.messages_ucf,
style:
TextStyle(fontSize: 12, color: MyTheme.white,),
),
],
),
)),
));
featureList.add(Visibility(
visible: refund_addon.$,
child: InkWell(
onTap: () {
//MyTransaction(context: context).push(RefundRequest());
Navigator.push(context, MaterialPageRoute(builder:( context)=>RefundRequest()));
},
child: Container(
height:40,
child: Column(
children: [
Image.asset(
'assets/icon/refund.png',
width: 16,
height: 16,
color:MyTheme.white,
),
SizedBox(
height: 5,
),
Text(
LangText(context: context)
.getLocal()!
.refund_requests_ucf,
style:
TextStyle(fontSize: 12,color:MyTheme.white,),
),
],
),
)),
),);
/*featureList.add(InkWell(
onTap: () {
MyTransaction(context: context).push(SupportTicket());
},
child: Container(
width: DeviceInfo(context).getWidth() / 3.5,
height:40,
child: Column(
children: [
Image.asset(
'assets/icon/support_ticket.png',
width: 16,
height: 16,
),
SizedBox(
height: 5,
),
Text(
LangText(context: context)
.getLocal()
.dashboard_support_tickets,
style:
TextStyle(fontSize: 12, color: Colors.white),
),
],
),
)),);*/
featureList.add(Visibility(
visible: coupon_activation.$,
child: InkWell(
onTap: () {
MyTransaction(context: context).push(Coupons());
},
child: Container(
height:40,
child: Column(
children: [
Image.asset(
'assets/icon/coupon.png',
width: 16,
height: 16,color:MyTheme.white,
),
SizedBox(
height: 5,
),
Text(
LangText(context: context)
.getLocal()!
.coupons_ucf,
style:
TextStyle(fontSize: 12, color:MyTheme.white,),
),
],
),
)),
),);
featureList.add(InkWell(
onTap: () {
MyTransaction(context: context).push(MoneyWithdraw());
},
child: Container(
height:40,
child: Column(
children: [
Image.asset(
'assets/icon/withdraw.png',
width: 16,
height: 16,color:MyTheme.white,
),
SizedBox(
height: 5,
),
Text(
LangText(context: context)
.getLocal()!
.money_withdraw_ucf,
style:
TextStyle(fontSize: 12, color:MyTheme.white,),
),
],
),
)),);
featureList.add(InkWell(
onTap: () {
MyTransaction(context: context).push(PaymentHistory());
},
child: Container(
height:40,
child: Column(
children: [
Image.asset(
'assets/icon/payment_history.png',
width: 16,
height: 16,color:MyTheme.white,
),
SizedBox(
height: 5,
),
Text(
LangText(context: context)
.getLocal()!
.payment_history_ucf,
style:
TextStyle(fontSize: 12, color:MyTheme.white,),
),
],
),
)),);
return featureList;
}
}

View File

@@ -0,0 +1,22 @@
class CouponInformationOptions{
String? value,key;
CouponInformationOptions({this.value, this.key});
List<CouponInformationOptions> getList(){
List<CouponInformationOptions> list = [];
list.add(new CouponInformationOptions(value: "Select",key: ""));
list.add(new CouponInformationOptions(value: "For Product",key: "product_base"));
list.add(new CouponInformationOptions(value: "For Total Orders",key: "cart_base"));
return list;
}
}
class CouponDiscountOptions{
String? value,key;
CouponDiscountOptions({this.value, this.key});
List<CouponDiscountOptions> getList(){
List<CouponDiscountOptions> list = [];
list.add(new CouponDiscountOptions(value: "Amount",key: "amount"));
list.add(new CouponDiscountOptions(value: "Percentage",key: "percent"));
return list;
}
}

View File

@@ -0,0 +1,5 @@
class SalesData {
SalesData(this.year, this.sales);
final int year;
final int sales;
}

View File

@@ -0,0 +1,36 @@
import 'dart:io';
import 'package:active_ecommerce_seller_app/custom/buttons.dart';
import 'package:active_ecommerce_seller_app/custom/localization.dart';
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class CommonFunctions{
BuildContext context;
CommonFunctions(this.context);
appExitDialog() {
showDialog(
context: context,
builder: (context) => Directionality(
textDirection: app_language_rtl.$! ? TextDirection.rtl : TextDirection.ltr,
child: AlertDialog(
content: Text(LangText(context: context).getLocal()!.do_you_want_close_the_app),
actions: [
Buttons(
onPressed: () {
Platform.isAndroid ? SystemNavigator.pop() : exit(0);
},
child: Text(AppLocalizations.of(context)!.yes_ucf)),
Buttons(
onPressed: () {
Navigator.pop(context);
},
child: Text(AppLocalizations.of(context)!.no_ucf)),
],
),
));
}
}

View File

@@ -0,0 +1,33 @@
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/material.dart';
class Buttons extends StatelessWidget{
BuildContext? context;
dynamic onPressed; Widget? child;Color color = MyTheme.noColor;Alignment? alignment;EdgeInsetsGeometry padding=EdgeInsets.zero;double? width;double height;OutlinedBorder? shape;
Buttons({Key? key,this.context, this.onPressed, this.child,this.color = MyTheme.noColor,this.alignment,this.padding=EdgeInsets.zero,this.width,this.height=5.0,this.shape}) : super(key: key);
Widget _basic() {
return TextButton(
onPressed: onPressed,
style: TextButton.styleFrom(
shape:shape,
// maximumSize: width!=null?Size(width, height):null,
minimumSize: width!=null?Size(width!, height):null,
backgroundColor: color,
alignment: alignment,
padding: padding, elevation: 0.0, primary: MyTheme.black),
child: child!,
);
}
@override
Widget build(BuildContext context) {
// TODO: implement build
return _basic();
}
}

View File

@@ -0,0 +1,156 @@
// import 'package:active_ecommerce_seller_app/data_model/chart_response.dart';
// import 'package:active_ecommerce_seller_app/my_theme.dart';
// import 'package:active_ecommerce_seller_app/repositories/shop_repository.dart';
// import 'package:flutter/material.dart';
//
// // class TimeSeriesBar extends StatefulWidget {
// //
// //
// // TimeSeriesBar();
// //
// //
// // @override
// // State<TimeSeriesBar> createState() => _TimeSeriesBarState();
// // }
// //
// // class _TimeSeriesBarState extends State<TimeSeriesBar> {
// //
// //
// //
// // /// Create one series with sample hard coded data.
// // List<charts.Series<TimeSeriesSales, DateTime>> _createSampleData() {
// // final data =
// //
// // return [
// // new charts.Series<TimeSeriesSales, DateTime>(
// // id: 'Sales',
// // colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault,
// // domainFn: (TimeSeriesSales sales, _) => sales.time,
// // measureFn: (TimeSeriesSales sales, _) => sales.sales,
// // data: data,
// // )
// // ];
// // }
// //
// //
// // @override
// // void initState() {
// // getChart();
// // // TODO: implement initState
// // super.initState();
// // }
// // @override
// // Widget build(BuildContext context) {
// // return chartList.isEmpty ?Container():new charts.TimeSeriesChart(
// // _createSampleData(),
// // animate: false,
// // // Set the default renderer to a bar renderer.
// // // This can also be one of the custom renderers of the time series chart.
// // defaultRenderer: new charts.BarRendererConfig<DateTime>(),
// // // It is recommended that default interactions be turned off if using bar
// // // renderer, because the line point highlighter is the default for time
// // // series chart.
// // defaultInteractions: false,
// // // If default interactions were removed, optionally add select nearest
// // // and the domain highlighter that are typical for bar charts.
// // behaviors: [new charts.SelectNearest(), new charts.DomainHighlighter()],
// // );
// // }
// // }
// //
// // /// Sample time series data type.
// // class TimeSeriesSales {
// // final DateTime time;
// // final int sales;
// //
// // TimeSeriesSales(this.time, this.sales);
// // }
// //
//
// class SimpleBarChart extends StatefulWidget {
// final bool? animate;
//
// SimpleBarChart({this.animate});
//
// @override
// State<SimpleBarChart> createState() => _SimpleBarChartState();
//
// /// Create one series with sample hard coded data.
// }
//
// class _SimpleBarChartState extends State<SimpleBarChart> {
// List<ChartResponse> chartList = [];
//
// List<charts.Series<dynamic, String>> _createSampleData() {
// final data = List.generate(chartList.length, (index) {
// return OrdinalSales(
// chartList[index].date, (chartList[index].total!.toInt()));
// // return OrdinalSales("Sep-"+(10+ index).toString(), (chartList[0].total.toInt()-index));
// });
//
// return [
// Series<OrdinalSales, String>(
// colorFn: (__, _) =>
// charts.ColorUtil.fromDartColor(MyTheme.app_accent_color),
// id: 'Sales',
// domainFn: (OrdinalSales sales, _) => sales.year!,
// measureFn: (OrdinalSales sales, _) => sales.sales,
// data: data,
// )
// ];
// }
//
// getChart() async {
// var response = await ShopRepository().chartRequest();
// chartList.addAll(response);
// setState(() {});
// }
//
// @override
// void initState() {
// getChart();
// // TODO: implement initState
// super.initState();
// }
//
// @override
// Widget build(BuildContext context) {
// return chartList.isEmpty
// ? Container()
// : BarChart(
// _createSampleData(),
// domainAxis: OrdinalAxisSpec(
// renderSpec: SmallTickRendererSpec(
// labelStyle: TextStyleSpec(
// fontSize: 10, // size in Pts.
// color: charts.ColorUtil.fromDartColor(MyTheme.grey_153),
// ),
// ),
// ),
// defaultRenderer: charts.BarRendererConfig(
// maxBarWidthPx: 12,
// fillPattern: charts.FillPatternType.solid,
// ),
// animate: widget.animate,
// primaryMeasureAxis: charts.NumericAxisSpec(
// renderSpec: charts.GridlineRendererSpec(
// labelJustification: charts.TickLabelJustification.outside,
// minimumPaddingBetweenLabelsPx: 1,
// //axisLineStyle:charts.LineStyleSpec() ,
// // Tick and Label styling here.
// labelStyle: charts.TextStyleSpec(
// fontSize: 10, // size in Pts.
// color: charts.MaterialPalette.gray.shadeDefault),
// ),
// ),
// );
// }
// }
//
// /// Sample ordinal data type.
// class OrdinalSales {
// final String? year;
// final int sales;
//
// OrdinalSales(this.year, this.sales);
// }

View File

@@ -0,0 +1,87 @@
import 'package:active_ecommerce_seller_app/custom/device_info.dart';
import 'package:active_ecommerce_seller_app/data_model/chart_response.dart';
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:active_ecommerce_seller_app/repositories/shop_repository.dart';
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
class MChart extends StatefulWidget {
const MChart({super.key});
@override
State<MChart> createState() => _MChartState();
}
class _MChartState extends State<MChart> {
List<ChartResponse> chartList = [];
List<ChartSeries> _createSampleData() {
final data = List.generate(chartList.length, (index) {
return OrdinalSales(
chartList[index].date,
int.parse(chartList[index].total!.round().toString())
// 56
);
});
return [
StackedColumnSeries<OrdinalSales, String>(
// enableTooltip: isTooltipVisible,
dataSource: data,
xValueMapper: (OrdinalSales sales,da) => sales.year,
yValueMapper: (OrdinalSales sales, index) {
return sales.sales;
},
isVisibleInLegend: false,
color: MyTheme.app_accent_color,
enableTooltip: true
//enableAnimation: false,
// markerSettings: const MarkerSettings(
// isVisible: true,
// height: 4,
// width: 4,
// shape: DataMarkerType.circle,
// borderWidth: 3,
// borderColor: Colors.red),
// dataLabelSettings: DataLabelSettings(
// isVisible: true,
// //position: ChartDataLabelAlignment.Auto
// ),
),
];
}
getChart() async {
var response = await ShopRepository().chartRequest();
chartList.addAll(response);
setState(() {});
}
@override
void initState() {
getChart();
super.initState();
}
@override
Widget build(BuildContext context) {
return Center(
child:SfCartesianChart(
primaryXAxis: CategoryAxis(),
//title: ChartTitle(text: 'Flutter Chart'),
legend: Legend(isVisible: true),
series: _createSampleData(),
// tooltipBehavior: _tooltipBehavior,
)
);
}
}
class OrdinalSales {
final String? year;
final int sales;
OrdinalSales(this.year, this.sales);
}

View File

@@ -0,0 +1,55 @@
import 'package:active_ecommerce_seller_app/custom/device_info.dart';
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class MyTextStyle{
static TextStyle smallFontSize(){
return TextStyle(
fontSize: 12,
color: Colors.grey,
fontWeight: FontWeight.normal
);
}
static TextStyle normalStyle(){
return TextStyle(
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.normal
);
}
static TextStyle bigFontSize(){
return TextStyle(
fontSize: 18,
color: Colors.grey,
fontWeight: FontWeight.w400
);
}
TextStyle dashboardBoxNumber(context){
return TextStyle(
fontSize: (DeviceInfo(context).getWidth()/100)*5,
color: MyTheme.white,
fontWeight: FontWeight.bold
);
}
TextStyle dashboardBoxText(context){
return TextStyle(
fontSize: (DeviceInfo(context).getWidth()/100)*3.5,
color: MyTheme.white,
fontWeight: FontWeight.normal
);
}
TextStyle appbarText(){
return TextStyle(fontSize: 17,fontWeight: FontWeight.bold,color: MyTheme.app_accent_color);
}
}

View File

@@ -0,0 +1,11 @@
import 'package:intl/intl.dart';
class CustomDateTime{
static String getDate = DateFormat('dMMMM,y').format(DateTime.now());
static String getDayName = DateFormat('EEEE').format(DateTime.now());
static String getLast7Date = DateFormat('EEEE').format(DateTime.now());
}

View File

@@ -0,0 +1,25 @@
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/cupertino.dart';
class MDecoration{
static BoxDecoration decoration1({double radius =6.0 ,bool showShadow=true}) {
return BoxDecoration(
borderRadius: BorderRadius.circular(radius),
color: MyTheme.white,
boxShadow: [
showShadow?BoxShadow(
color: MyTheme.black.withOpacity(0.15),
blurRadius: 20,
spreadRadius: 0.0,
offset: const Offset(0.0, 10.0), // shadow direction: bottom right
):const BoxShadow()
],
);
}
}

View File

@@ -0,0 +1,28 @@
import 'package:flutter/cupertino.dart';
class DeviceInfo{
BuildContext? context;
DeviceInfo(this.context);
double getWidth(){
return MediaQuery.of(context!).size.width;
}
double getWidthInPercent(){
return MediaQuery.of(context!).size.width/100;
}
double getHeight(){
return MediaQuery.of(context!).size.height;
}
double getHeightInPercent(){
return MediaQuery.of(context!).size.height/100;
}
double getHeightInPercent2(){
return MediaQuery.of(context!).size.aspectRatio;
}
}

View File

@@ -0,0 +1,56 @@
import 'package:active_ecommerce_seller_app/custom/buttons.dart';
import 'package:active_ecommerce_seller_app/custom/localization.dart';
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class DialogBox{
static late BuildContext context;
static warningShow(BuildContext context ,List<dynamic>? warnings){
showDialog(context: context, builder: (context){
DialogBox.context = context;
return AlertDialog(
title: Text(LangText(context: context).getLocal()!.warning_ucf),
content: SizedBox(
height: 180,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(warnings!.length, (index) => Padding(
padding:const EdgeInsets.all(8),
child:Text("${warnings[index]}"),
)),
),
),
),
actions: [
Buttons(
color: MyTheme.medium_grey,
padding: EdgeInsets.all(8),
width: 40,
height: 40,
child: Text(LangText(context: context).getLocal()!.close_all_capital,style: TextStyle(color: MyTheme.white),),
onPressed: (){
pop();
},
)
],
);
});
}
static pop(){
Navigator.pop(DialogBox.context);
}
}

View File

@@ -0,0 +1,73 @@
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/material.dart';
class InputDecorations {
static InputDecoration buildInputDecoration_1(
{hint_text = "",
Color hintTextColor = MyTheme.app_accent_color,
Color borderColor = MyTheme.app_accent_border,
Color fillColor = const Color.fromRGBO(255, 255, 255, 0)}) {
return InputDecoration(
fillColor: fillColor,
hintText: hint_text,
hintStyle: TextStyle(fontSize: 12.0, color: hintTextColor),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: borderColor, width: 1),
borderRadius: const BorderRadius.all(
const Radius.circular(10.0),
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyTheme.app_accent_color.withOpacity(0.5), width: 1.5),
borderRadius: const BorderRadius.all(
const Radius.circular(10.0),
),
),
contentPadding: EdgeInsets.only(left: 16.0));
}
static InputDecoration buildInputDecoration_phone
// ({hint_text = ""}) {
// return InputDecoration(
// fillColor: fillColor,
//
// hintText: hint_text,
// hintStyle: TextStyle(fontSize: 12.0, color: MyTheme.app_accent_color),
// enabledBorder: OutlineInputBorder(
// borderSide: BorderSide(color: MyTheme.app_accent_color.withOpacity(0.8), width: 1.0),
// borderRadius: BorderRadius.only(
// topRight: Radius.circular(10.0),
// bottomRight: Radius.circular(10.0)),
// ),
// focusedBorder: OutlineInputBorder(
// borderSide: BorderSide(color: MyTheme.app_accent_color.withOpacity(0.8), width: 1.0),
// borderRadius: BorderRadius.only(
// topRight: Radius.circular(10.0),
// bottomRight: Radius.circular(10.0))),
// contentPadding: EdgeInsets.only(left: 16.0));
// }
(
{hint_text = "",
Color hintTextColor = MyTheme.app_accent_color,
Color borderColor = MyTheme.app_accent_border,
Color fillColor = const Color.fromRGBO(255, 255, 255, 0)}) {
return InputDecoration(
fillColor: fillColor,
hintText: hint_text,
hintStyle: TextStyle(fontSize: 12.0, color: hintTextColor),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: borderColor, width: 1),
borderRadius: const BorderRadius.only(
topRight: Radius.circular(10.0),
bottomRight: Radius.circular(10.0)),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: borderColor, width: 1.0),
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
bottomRight: Radius.circular(10.0))),
contentPadding: EdgeInsets.only(left: 16.0));
}
}

View File

@@ -0,0 +1,648 @@
import 'package:active_ecommerce_seller_app/custom/buttons.dart';
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl_phone_number_input/src/models/country_list.dart';
import 'package:intl_phone_number_input/src/models/country_model.dart';
import 'package:intl_phone_number_input/src/providers/country_provider.dart';
import 'package:intl_phone_number_input/src/utils/formatter/as_you_type_formatter.dart';
import 'package:intl_phone_number_input/src/utils/phone_number.dart';
import 'package:intl_phone_number_input/src/utils/phone_number/phone_number_util.dart';
import 'package:intl_phone_number_input/src/utils/selector_config.dart';
import 'package:intl_phone_number_input/src/utils/test/test_helper.dart';
import 'package:intl_phone_number_input/src/utils/util.dart';
import 'package:intl_phone_number_input/src/utils/widget_view.dart';
import 'package:intl_phone_number_input/src/utils/selector_config.dart';
import 'package:intl_phone_number_input/src/widgets/countries_search_list_widget.dart';
import 'package:intl_phone_number_input/src/widgets/input_widget.dart';
import 'package:intl_phone_number_input/src/widgets/item.dart';
/// Enum for [CustomSelectorButton] types.
///
/// Available type includes:
/// * [PhoneInputSelectorType.DROPDOWN]
/// * [PhoneInputSelectorType.BOTTOM_SHEET]
/// * [PhoneInputSelectorType.DIALOG]
/// A [TextFormField] for [CustomInternationalPhoneNumberInput].
///
/// [initialValue] accepts a [PhoneNumber] this is used to set initial values
/// for phone the input field and the selector button
///
/// [selectorButtonOnErrorPadding] is a double which is used to align the selector
/// button with the input field when an error occurs
///
/// [locale] accepts a country locale which will be used to translation, if the
/// translation exist
///
/// [countries] accepts list of string on Country isoCode, if specified filters
/// available countries to match the [countries] specified.
class CustomInternationalPhoneNumberInput extends StatefulWidget {
final SelectorConfig selectorConfig;
final ValueChanged<PhoneNumber> onInputChanged;
final ValueChanged<bool>? onInputValidated;
final VoidCallback? onSubmit;
final ValueChanged<String>? onFieldSubmitted;
final String Function(String?)? validator;
final ValueChanged<PhoneNumber>? onSaved;
final TextEditingController? textFieldController;
final TextInputType keyboardType;
final TextInputAction? keyboardAction;
final PhoneNumber? initialValue;
final String hintText;
final String errorMessage;
final double selectorButtonOnErrorPadding;
final double spaceBetweenSelectorAndTextField;
final int maxLength;
final bool isEnabled;
final bool formatInput;
final bool autoFocus;
final bool autoFocusSearch;
final AutovalidateMode autoValidateMode;
final bool ignoreBlank;
final bool countrySelectorScrollControlled;
final String? locale;
final TextStyle? textStyle;
final TextStyle? selectorTextStyle;
final InputBorder? inputBorder;
final InputDecoration? inputDecoration;
final InputDecoration? searchBoxDecoration;
final Color? cursorColor;
final TextAlign textAlign;
final TextAlignVertical textAlignVertical;
final EdgeInsets scrollPadding;
final FocusNode? focusNode;
final Iterable<String>? autofillHints;
final List<String?>? countries;
CustomInternationalPhoneNumberInput(
{Key? key,
this.selectorConfig = const SelectorConfig(),
required this.onInputChanged,
this.onInputValidated,
this.onSubmit,
this.onFieldSubmitted,
this.validator,
this.onSaved,
this.textFieldController,
this.keyboardAction,
this.keyboardType = TextInputType.phone,
this.initialValue,
this.hintText = 'Phone number',
this.errorMessage = 'Invalid phone number',
this.selectorButtonOnErrorPadding = 24,
this.spaceBetweenSelectorAndTextField = 12,
this.maxLength = 15,
this.isEnabled = true,
this.formatInput = true,
this.autoFocus = false,
this.autoFocusSearch = false,
this.autoValidateMode = AutovalidateMode.disabled,
this.ignoreBlank = false,
this.countrySelectorScrollControlled = true,
this.locale,
this.textStyle,
this.selectorTextStyle,
this.inputBorder,
this.inputDecoration,
this.searchBoxDecoration,
this.textAlign = TextAlign.start,
this.textAlignVertical = TextAlignVertical.center,
this.scrollPadding = const EdgeInsets.all(20.0),
this.focusNode,
this.cursorColor,
this.autofillHints,
this.countries})
: super(key: key);
@override
State<StatefulWidget> createState() => _InputWidgetState();
}
class _InputWidgetState extends State<CustomInternationalPhoneNumberInput> {
TextEditingController? controller;
double selectorButtonBottomPadding = 0;
Country? country;
List<Country> countries = [];
bool isNotValid = true;
@override
void initState() {
super.initState();
loadCountries();
controller = widget.textFieldController ?? TextEditingController();
initialiseWidget();
}
@override
void setState(fn) {
if (this.mounted) {
super.setState(fn);
}
}
@override
Widget build(BuildContext context) {
return _InputWidgetView(
state: this,
);
}
@override
void didUpdateWidget(CustomInternationalPhoneNumberInput oldWidget) {
if (oldWidget?.initialValue?.hash != widget?.initialValue?.hash) {
loadCountries();
initialiseWidget();
} else {
loadCountries(previouslySelectedCountry: country);
}
super.didUpdateWidget(oldWidget);
}
/// [initialiseWidget] sets initial values of the widget
void initialiseWidget() async {
if (widget.initialValue != null) {
if (widget.initialValue!.phoneNumber != null &&
widget.initialValue!.phoneNumber!.isNotEmpty &&
(await PhoneNumberUtil.isValidNumber(
phoneNumber: widget.initialValue!.phoneNumber!,
isoCode: widget.initialValue!.isoCode!))!) {
controller!.text =
await PhoneNumber.getParsableNumber(widget.initialValue!);
phoneNumberControllerListener();
}
}
}
/// loads countries from [Countries.countryList] and selected Country
void loadCountries({Country? previouslySelectedCountry}) {
if (this.mounted) {
List<Country> countries =
CountryProvider.getCountriesData(countries: widget.countries!.cast<String>());
final CountryComparator? countryComparator =
widget.selectorConfig?.countryComparator;
if (countryComparator != null) {
countries.sort(countryComparator);
}
Country country = previouslySelectedCountry ??
Utils.getInitialSelectedCountry(
countries,
widget.initialValue?.isoCode ?? '',
);
setState(() {
this.countries = countries;
this.country = country;
});
}
}
/// Listener that validates changes from the widget, returns a bool to
/// the `ValueCallback` [widget.onInputValidated]
void phoneNumberControllerListener() {
if (this.mounted) {
String parsedPhoneNumberString =
controller!.text.replaceAll(RegExp(r'[^\d+]'), '');
getParsedPhoneNumber(parsedPhoneNumberString, this.country?.alpha2Code)
.then((phoneNumber) {
if (phoneNumber == null) {
String phoneNumber =
'${this.country?.dialCode}$parsedPhoneNumberString';
if (widget.onInputChanged != null) {
widget.onInputChanged(PhoneNumber(
phoneNumber: phoneNumber,
isoCode: this.country?.alpha2Code,
dialCode: this.country?.dialCode));
}
if (widget.onInputValidated != null) {
widget.onInputValidated!(false);
}
this.isNotValid = true;
} else {
if (widget.onInputChanged != null) {
widget.onInputChanged(PhoneNumber(
phoneNumber: phoneNumber,
isoCode: this.country?.alpha2Code,
dialCode: this.country?.dialCode));
}
if (widget.onInputValidated != null) {
widget.onInputValidated!(true);
}
this.isNotValid = false;
}
});
}
}
/// Returns a formatted String of [phoneNumber] with [isoCode], returns `null`
/// if [phoneNumber] is not valid or if an [Exception] is caught.
Future<String?> getParsedPhoneNumber(
String phoneNumber, String? isoCode) async {
if (phoneNumber.isNotEmpty && isoCode != null) {
try {
bool isValidPhoneNumber = (await PhoneNumberUtil.isValidNumber(
phoneNumber: phoneNumber, isoCode: isoCode))!;
if (isValidPhoneNumber) {
return await PhoneNumberUtil.normalizePhoneNumber(
phoneNumber: phoneNumber, isoCode: isoCode);
}
} on Exception {
return null;
}
}
return null;
}
/// Creates or Select [InputDecoration]
InputDecoration getInputDecoration(InputDecoration? decoration) {
InputDecoration value = decoration ??
InputDecoration(
border: widget.inputBorder ?? UnderlineInputBorder(),
hintText: widget.hintText,
);
if (widget.selectorConfig.setSelectorButtonAsPrefixIcon) {
return value.copyWith(
prefixIcon: CustomSelectorButton(
country: country,
countries: countries,
onCountryChanged: onCountryChanged,
selectorConfig: widget.selectorConfig,
selectorTextStyle: widget.selectorTextStyle,
searchBoxDecoration: widget.searchBoxDecoration,
locale: locale,
isEnabled: widget.isEnabled,
autoFocusSearchField: widget.autoFocusSearch,
isScrollControlled: widget.countrySelectorScrollControlled,
));
}
return value;
}
/// Validate the phone number when a change occurs
void onChanged(String value) {
phoneNumberControllerListener();
}
/// Validate and returns a validation error when [FormState] validate is called.
///
/// Also updates [selectorButtonBottomPadding]
String? validator(String? value) {
bool isValid =
this.isNotValid && (value!.isNotEmpty || widget.ignoreBlank == false);
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
if (isValid && widget.errorMessage != null) {
setState(() {
this.selectorButtonBottomPadding =
widget.selectorButtonOnErrorPadding ?? 24;
});
} else {
setState(() {
this.selectorButtonBottomPadding = 0;
});
}
});
return isValid ? widget.errorMessage : null;
}
/// Changes Selector Button Country and Validate Change.
void onCountryChanged(Country? country) {
setState(() {
this.country = country;
});
phoneNumberControllerListener();
}
void _phoneNumberSaved() {
if (this.mounted) {
String parsedPhoneNumberString =
controller!.text.replaceAll(RegExp(r'[^\d+]'), '');
getParsedPhoneNumber(parsedPhoneNumberString, this.country?.alpha2Code)
.then(
(phoneNumber) => widget.onSaved?.call(
PhoneNumber(
phoneNumber: phoneNumber,
isoCode: this.country?.alpha2Code,
dialCode: this.country?.dialCode),
),
);
}
}
/// Saved the phone number when form is saved
void onSaved(String? value) {
_phoneNumberSaved();
}
/// Corrects duplicate locale
String? get locale {
if (widget.locale == null) return null;
if (widget.locale!.toLowerCase() == 'nb' ||
widget.locale!.toLowerCase() == 'nn') {
return 'no';
}
return widget.locale;
}
}
class _InputWidgetView
extends WidgetView<CustomInternationalPhoneNumberInput, _InputWidgetState> {
final _InputWidgetState state;
_InputWidgetView({Key? key, required this.state})
: super(key: key, state: state);
@override
Widget build(BuildContext context) {
final countryCode = state?.country?.alpha2Code ?? '';
final dialCode = state?.country?.dialCode ?? '';
return Container(
child: Row(
textDirection: TextDirection.ltr,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
CustomSelectorButton(
country: state.country,
countries: state.countries,
onCountryChanged: state.onCountryChanged,
selectorConfig: widget.selectorConfig,
selectorTextStyle: widget.selectorTextStyle,
searchBoxDecoration: widget.searchBoxDecoration,
locale: state.locale,
isEnabled: widget.isEnabled,
autoFocusSearchField: widget.autoFocusSearch,
isScrollControlled: widget.countrySelectorScrollControlled,
),
SizedBox(
height: state.selectorButtonBottomPadding,
),
],
),
Flexible(
child: TextFormField(
key: Key(TestHelper.TextInputKeyValue),
textDirection: TextDirection.ltr,
controller: state.controller,
focusNode: widget.focusNode,
enabled: widget.isEnabled,
autofocus: widget.autoFocus,
keyboardType: widget.keyboardType,
textInputAction: widget.keyboardAction,
style: widget.textStyle,
decoration: state.getInputDecoration(widget.inputDecoration),
textAlign: widget.textAlign,
textAlignVertical: widget.textAlignVertical,
onEditingComplete: widget.onSubmit,
onFieldSubmitted: widget.onFieldSubmitted,
autovalidateMode: widget.autoValidateMode,
autofillHints: widget.autofillHints,
validator: widget.validator ?? state.validator,
onSaved: state.onSaved,
scrollPadding: widget.scrollPadding,
inputFormatters: [
LengthLimitingTextInputFormatter(widget.maxLength),
widget.formatInput
? AsYouTypeFormatter(
isoCode: countryCode,
dialCode: dialCode,
onInputFormatted: (TextEditingValue value) {
state.controller!.value = value;
},
)
: FilteringTextInputFormatter.digitsOnly,
],
onChanged: state.onChanged,
),
)
],
),
);
}
}
/// [CustomSelectorButton]
class CustomSelectorButton extends StatelessWidget {
final List<Country> countries;
final Country? country;
final SelectorConfig selectorConfig;
final TextStyle? selectorTextStyle;
final InputDecoration? searchBoxDecoration;
final bool autoFocusSearchField;
final String? locale;
final bool isEnabled;
final bool isScrollControlled;
final ValueChanged<Country?> onCountryChanged;
const CustomSelectorButton({
Key? key,
required this.countries,
required this.country,
required this.selectorConfig,
required this.selectorTextStyle,
required this.searchBoxDecoration,
required this.autoFocusSearchField,
required this.locale,
required this.onCountryChanged,
required this.isEnabled,
required this.isScrollControlled,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return selectorConfig.selectorType == PhoneInputSelectorType.DROPDOWN
? countries.isNotEmpty && countries.length > 1
? DropdownButtonHideUnderline(
child: DropdownButton<Country>(
key: Key(TestHelper.DropdownButtonKeyValue),
hint: Item(
country: country,
showFlag: selectorConfig.showFlags,
useEmoji: selectorConfig.useEmoji,
textStyle: selectorTextStyle,
),
value: country,
items: mapCountryToDropdownItem(countries),
onChanged: isEnabled ? onCountryChanged : null,
),
)
: Item(
country: country,
showFlag: selectorConfig.showFlags,
useEmoji: selectorConfig.useEmoji,
textStyle: selectorTextStyle,
)
: Container(
height: 36,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: MyTheme.textfield_grey,
width: .5
),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(5.0),
bottomLeft: Radius.circular(5.0))),
child: Buttons(
key: Key(TestHelper.DropdownButtonKeyValue),
padding: EdgeInsets.zero,
color: MyTheme.grey_153,
shape: RoundedRectangleBorder(
borderRadius: const BorderRadius.only(
topLeft: const Radius.circular(5.0),
bottomLeft: const Radius.circular(5.0),
)),
onPressed: countries.isNotEmpty &&
countries.length > 1 &&
isEnabled
? () async {
Country? selected;
if (selectorConfig.selectorType ==
PhoneInputSelectorType.BOTTOM_SHEET) {
selected = await showCountrySelectorBottomSheet(
context, countries);
} else {
selected =
await showCountrySelectorDialog(context, countries);
}
if (selected != null) {
onCountryChanged(selected);
}
}
: null,
child: Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Item(
country: country,
showFlag: selectorConfig.showFlags,
useEmoji: selectorConfig.useEmoji,
textStyle: TextStyle(
color: MyTheme.textfield_grey) //selectorTextStyle,
),
),
),
);
}
/// Converts the list [countries] to `DropdownMenuItem`
List<DropdownMenuItem<Country>> mapCountryToDropdownItem(
List<Country> countries) {
return countries.map((country) {
return DropdownMenuItem<Country>(
value: country,
child: Item(
key: Key(TestHelper.countryItemKeyValue(country.alpha2Code)),
country: country,
showFlag: selectorConfig.showFlags,
useEmoji: selectorConfig.useEmoji,
textStyle: selectorTextStyle,
withCountryNames: false,
),
);
}).toList();
}
/// shows a Dialog with list [countries] if the [PhoneInputSelectorType.DIALOG] is selected
Future<Country?> showCountrySelectorDialog(
BuildContext context, List<Country> countries) {
return showDialog(
context: context,
barrierDismissible: true,
builder: (BuildContext context) => AlertDialog(
content: Container(
width: double.maxFinite,
child: CountrySearchListWidget(
countries,
locale,
searchBoxDecoration: searchBoxDecoration,
showFlags: selectorConfig.showFlags,
useEmoji: selectorConfig.useEmoji,
autoFocus: autoFocusSearchField,
),
),
),
);
}
/// shows a Dialog with list [countries] if the [PhoneInputSelectorType.BOTTOM_SHEET] is selected
Future<Country?> showCountrySelectorBottomSheet(
BuildContext context, List<Country> countries) {
return showModalBottomSheet(
context: context,
clipBehavior: Clip.hardEdge,
isScrollControlled: isScrollControlled ?? true,
backgroundColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(12), topRight: Radius.circular(12))),
builder: (BuildContext context) {
return AnimatedPadding(
padding:
EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
duration: const Duration(milliseconds: 100),
child: Stack(children: [
GestureDetector(
onTap: () => Navigator.pop(context),
),
DraggableScrollableSheet(
builder: (BuildContext context, ScrollController controller) {
return Container(
decoration: ShapeDecoration(
color: Theme.of(context).canvasColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(12),
topRight: Radius.circular(12),
),
),
),
child: CountrySearchListWidget(
countries,
locale,
searchBoxDecoration: searchBoxDecoration,
scrollController: controller,
showFlags: selectorConfig.showFlags,
useEmoji: selectorConfig.useEmoji,
autoFocus: autoFocusSearchField,
),
);
},
),
]),
);
},
);
}
}

View File

@@ -0,0 +1,55 @@
import 'dart:async';
import 'package:active_ecommerce_seller_app/custom/localization.dart';
import 'package:flutter/material.dart';
import 'package:one_context/one_context.dart';
class Loading{
static BuildContext? _buildContext;
static late BuildContext _context;
static setInstance(BuildContext context){
_buildContext= context;
}
static getInstance()=>Loading._buildContext;
Future show()async{
return showDialog(
context: Loading._buildContext!,
builder: (BuildContext context) {
Loading._context=context;
return AlertDialog(
content: Row(
children: [
CircularProgressIndicator(),
const SizedBox(
width: 10,
),
Text(LangText(context: context).getLocal()!.please_wait_ucf),
],
));
},);
}
hide(){
Navigator.of(Loading._context).pop();
}
static Widget bottomLoading(bool value){
return value? Container(
alignment: Alignment.center,
child: SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator()),
):SizedBox(height: 5,width: 5,);
}
}

View File

@@ -0,0 +1,12 @@
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter/cupertino.dart';
class LangText{
BuildContext? context;
LangText({this.context});
AppLocalizations? getLocal(){
return AppLocalizations.of(context!);
}
}

View File

@@ -0,0 +1,6 @@
class SelectProduct {
SelectProduct({this.id, this.name, this.isSelect});
var id;
String? name;
bool? isSelect;
}

View File

@@ -0,0 +1,107 @@
import 'package:active_ecommerce_seller_app/custom/common_style.dart';
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/material.dart';
class MyAppBar {
bool? centerTitle = false;
String? title;
BuildContext? context;
MyAppBar({this.title,this.context,this.centerTitle});
AppBar show({var elevation= 5.0}) {
return AppBar(
leadingWidth:0.0,
centerTitle: centerTitle,
elevation: elevation,
title: Row(
children: [
Container(
width:24,
height: 24,
child: IconButton(
splashRadius: 15,
padding: EdgeInsets.all(0.0),
onPressed: (){
Navigator.pop(context!);
}, icon: Image.asset(
'assets/icon/back_arrow.png',
height: 20,
width: 20,
color: MyTheme.app_accent_color,
//color: MyTheme.dark_grey,
),),
),
SizedBox(width: 10,),
Text(title!,style: MyTextStyle().appbarText(),),
],
),
backgroundColor: Colors.white,
/*leading:Container(
margin: EdgeInsets.only(left: 10),
child: IconButton(
iconSize: 20,
splashRadius: 15,
padding: EdgeInsets.zero,
onPressed: (){
Navigator.pop(context);
}, icon: Image.asset(
'assets/icon/back_arrow.png',
height: 20,
width: 20,
//color: MyTheme.dark_grey,
),),
),*/
);
}
AppBar copyWithBottom({var elevation= 5.0,Widget bottom= const SizedBox(height: 0,width: 0,),Size size=const Size(0, 0)}) {
return AppBar(
leadingWidth:0.0,
centerTitle: centerTitle,
elevation: elevation,
title: Row(
children: [
Container(
width:24,
height: 24,
child: IconButton(
splashRadius: 15,
padding: EdgeInsets.all(0.0),
onPressed: (){
Navigator.pop(context!);
}, icon: Image.asset(
'assets/icon/back_arrow.png',
height: 20,
width: 20,
color: MyTheme.app_accent_color,
//color: MyTheme.dark_grey,
),),
),
SizedBox(width: 10,),
Text(title!,style: MyTextStyle().appbarText(),),
],
),
backgroundColor: Colors.white,
bottom: PreferredSize(child: bottom,preferredSize: size,),
/*leading:Container(
margin: EdgeInsets.only(left: 10),
child: IconButton(
iconSize: 20,
splashRadius: 15,
padding: EdgeInsets.zero,
onPressed: (){
Navigator.pop(context);
}, icon: Image.asset(
'assets/icon/back_arrow.png',
height: 20,
width: 20,
//color: MyTheme.dark_grey,
),),
),*/
);
}
}

View File

@@ -0,0 +1,465 @@
import 'dart:io';
import 'package:active_ecommerce_seller_app/custom/common_style.dart';
import 'package:active_ecommerce_seller_app/custom/device_info.dart';
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/material.dart';
import 'package:carousel_slider/carousel_slider.dart';
class MyWidget {
BuildContext? myContext;
BuildContext? pop;
MyWidget({this.myContext});
BuildContext? getContext() {
return myContext;
}
Container myContainer(
{double width = 0.0,
double borderWith = 1.0,
double height = 0.0,
double borderRadius = 0.0,
Color bgColor = const Color.fromRGBO(255, 255, 255, 0),
Color borderColor = const Color.fromRGBO(255, 255, 255, 0),
Widget? child,
double paddingX = 0.0,
paddingY = 0.0,
double marginX = 0.0,
double marginY = 0.0,
Alignment alignment = Alignment.center}) {
return Container(
alignment: alignment,
padding: EdgeInsets.symmetric(horizontal: paddingY, vertical: paddingX),
margin: EdgeInsets.symmetric(horizontal: marginY, vertical: marginX),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(borderRadius),
border: Border.all(color: borderColor, width: borderWith),
color: bgColor,
),
height: height,
width: width,
child: child);
}
Container productContainer(
{double width = 0.0,
double height = 0.0,
double borderRadius = 0.0,
Color backgroundColor = const Color.fromRGBO(255, 255, 255, 0),
Color borderColor = const Color.fromRGBO(255, 255, 255, 0),
Widget? child,
EdgeInsets? padding,
EdgeInsets? margin,
Alignment alignment = Alignment.center}) {
return Container(
alignment: alignment,
padding: padding,
margin: margin,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(borderRadius),
border: Border.all(color: borderColor),
color: backgroundColor,
),
height: height,
width: width,
child: child);
}
static Container customContainer(
{double width = 0.0,
double height = 0.0,
double borderRadius = 0.0,
Color backgroundColor = const Color.fromRGBO(255, 255, 255, 0),
Color borderColor = const Color.fromRGBO(255, 255, 255, 0),
Widget? child,
EdgeInsets? padding,
EdgeInsets? margin,
Alignment alignment = Alignment.center}) {
return Container(
alignment: alignment,
padding: padding,
margin: margin,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(borderRadius),
border: Border.all(color: borderColor),
color: backgroundColor,
),
constraints: BoxConstraints(
minHeight: height,
maxWidth: width,
),
child: child);
}
Card customCard(
{double width = 0.0,
double elevation = 0.0,
double height = 0.0,
double borderRadius = 0.0,
Color backgroundColor = const Color.fromRGBO(255, 255, 255, 0),
Color borderColor = const Color.fromRGBO(255, 255, 255, 0),
double borderWidth=0.0,
Widget? child,
EdgeInsets? padding,
Color shadowColor = MyTheme.app_accent_shado,
EdgeInsets? margin,
Alignment alignment = Alignment.center}) {
return Card(
shadowColor: shadowColor,
color: backgroundColor,
margin: margin,
child: child,
shape: RoundedRectangleBorder(
side: BorderSide(color: borderColor, width: borderWidth),
borderRadius: BorderRadius.circular(borderRadius),
),
elevation: elevation,
//color: backgroundColor,
);
}
Container imageContainer(
{double width = 0.0,
double height = 0.0,
BorderRadius borderRadius = BorderRadius.zero,
Color backgroundColor = const Color.fromRGBO(255, 255, 255, 0),
Color borderColor = const Color.fromRGBO(255, 255, 255, 0),
required ImageProvider imageProvider,
Widget? child,
EdgeInsets? padding,
EdgeInsets? margin,
BoxFit? fit,
Alignment alignment = Alignment.center}) {
return Container(
alignment: alignment,
padding: padding,
margin: margin,
decoration: BoxDecoration(
borderRadius: borderRadius,
border: Border.all(color: borderColor),
color: backgroundColor,
image: DecorationImage(
image: imageProvider,
fit: fit,
),
),
height: height,
width: width,
);
}
static Widget imageWithPlaceholder(
{String? url,
double height = 0.0,
double elevation = 0.0,
BoxBorder? border,
width = 0.0,
BorderRadiusGeometry radius = BorderRadius.zero,
BoxFit fit = BoxFit.cover,
Color backgroundColor = Colors.white
}) {
return Material(
color: backgroundColor,
elevation: elevation,
borderRadius: radius,
child: Container(
width: width,
height: height,
decoration: BoxDecoration(
borderRadius: radius,
border: border?? Border.all(width: 0,color: MyTheme.noColor),
),
child: url != null && url.isNotEmpty
? ClipRRect(
borderRadius: radius,
child: FadeInImage.assetNetwork(
placeholder: "assets/logo/placeholder.png",
image: url,
height: height,
imageErrorBuilder: (context, object, stackTrace) {
return Container(
height: height,
width: width,
decoration: BoxDecoration(
borderRadius: radius,
image:const DecorationImage(
image: AssetImage("assets/logo/placeholder.png"),
fit: BoxFit.cover
)
),
);
},
width: width,
fit: fit,
),
)
: Container(
height: height,
width: width,
decoration: BoxDecoration(
borderRadius: radius,
image:const DecorationImage(
image: AssetImage("assets/logo/placeholder.png"),
)
),
),
),
);
}
static Widget fileImage(
{File? image,
double height = 0.0,
double elevation = 0.0,
width = 0.0,
BorderRadiusGeometry radius = BorderRadius.zero,
BoxFit fit = BoxFit.cover,
Color backgroundColor = Colors.white
}) {
return Material(
color: backgroundColor,
elevation: elevation,
borderRadius: radius,
child: Container(
width: width,
height: height,
decoration: BoxDecoration(
borderRadius: radius
),
child: image != null && image.path.isNotEmpty
? ClipRRect(
borderRadius: radius,
child:Container(
height: height,
width: width,
decoration: BoxDecoration(
borderRadius: radius,
image: DecorationImage(
image: FileImage(image),
fit: BoxFit.cover
)
),
),
)
: Container(
height: height,
width: width,
decoration: BoxDecoration(
borderRadius: radius,
image:const DecorationImage(
image: AssetImage("assets/logo/placeholder.png"),
)
),
),
),
);
}
static Widget roundImageWithPlaceholder(
{String? url,
double height = 0.0,
double elevation = 0.0,
double borderWidth = 0.0,
width = 0.0,
double paddingX = 0.0,
double paddingY = 0.0,
double borderRadius = 0.0,
Color backgroundColor = Colors.white,
BoxFit fit = BoxFit.cover}) {
return Material(
color: backgroundColor,
elevation: elevation,
borderRadius: BorderRadius.circular(borderRadius),
child: MyWidget().myContainer(
borderWith: borderWidth,
width: width,
height: height,
paddingY: paddingY,
paddingX: paddingX,
borderRadius: borderRadius,
bgColor: backgroundColor,
child: ClipRRect(
borderRadius: BorderRadius.circular(borderRadius),
child: url != null && url.isNotEmpty
? FadeInImage.assetNetwork(
placeholder: "assets/logo/placeholder.png",
image: url,
imageErrorBuilder: (context, object, stackTrace) {
return Container(
height: height,
width: width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(borderRadius),
image:const DecorationImage(
image: AssetImage("assets/logo/placeholder.png"),
fit: BoxFit.cover
)
),
);
},
height: height,
width: width,
fit: fit,
)
: Container(
height: height,
width: width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(borderRadius),
image:const DecorationImage(
image: AssetImage("assets/logo/placeholder.png"),
fit: BoxFit.cover
)
),
),
),
),
);
}
static Image boxImage(url) {
return Image.asset(
url,
color: MyTheme.white.withOpacity(0.5),
height: 32,
width: 32,
);
}
static Widget homePageTopBox(BuildContext context,
{required String title, required counter, required iconUrl,double elevation = 0.0}) {
return customCardView(
padding: EdgeInsets.all(10),
margin: EdgeInsets.only(top: 14,left: 14),
borderRadius:10,
backgroundColor: MyTheme.app_accent_color,
height: 75,
width: DeviceInfo(context).getWidth() / 2 - 20,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: MyTextStyle().dashboardBoxText(context),
),
Text(
counter,
style: MyTextStyle().dashboardBoxNumber(context),
),
],
),
MyWidget.boxImage(iconUrl)
],
));
}
static Widget customCardView(
{double width = 0.0,
double elevation=0.0,
double blurSize=20.0,
double height = 0.0,
double borderRadius = 0.0,
Color shadowColor = MyTheme.app_accent_shado,
Color borderColor = const Color.fromRGBO(255, 255, 255, 0),
Color backgroundColor = const Color.fromRGBO(255, 255, 255, 0),
Widget? child,
double borderWidth=0.0,
EdgeInsets? padding,
EdgeInsets? margin,
Alignment alignment = Alignment.center}) {
return Container(
margin: margin,
height: height,
width: width,
padding: padding,
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: BorderRadius.circular(borderRadius),
border: Border.all(color: borderColor,width: borderWidth),
boxShadow: [
BoxShadow(
color: shadowColor,
offset: Offset(0, 6),
blurRadius: blurSize,
),
],
),
child: child,
);
/*
Container(
margin: margin,
child: Material(
elevation:elevation ,
borderRadius: BorderRadius.circular(borderRadius),
child: Container(
decoration: BoxDecoration(
//color: MyTheme.red,
color: backgroundColor,
borderRadius: BorderRadius.circular(borderRadius),
),
height: height,
width: width,
padding: padding,
child: child,
),
),
);*/
}
/*
static Widget imageSlider(List<String> imageUrl, BuildContext context) {
return Container(
child: CarouselSlider(
options: CarouselOptions(height: 400.0),
items: imageUrl.map((i) {
return Builder(
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
margin: const EdgeInsets.symmetric(horizontal: 5.0),
// decoration: BoxDecoration(
//
// ),
child: imageWithPlaceholder(
height: 157,
width: DeviceInfo(context).getWidth(),
fit: BoxFit.cover),
);
},
);
}).toList(),
),
);
} */
static Widget imageSlider({required List<String> imageUrl, BuildContext? context}) {
return Container(
child: CarouselSlider(
options: CarouselOptions(height: 400.0,aspectRatio: 16/7,viewportFraction: 1,autoPlay: true,enableInfiniteScroll: true),
items: List.generate(
imageUrl.length,
(index) => imageWithPlaceholder(
url: imageUrl[index],
height: 157,
width: DeviceInfo(context).getWidth(),
fit: BoxFit.cover),
)),
);
}
}

View File

@@ -0,0 +1,17 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class MyTransaction{
BuildContext? context;
MyTransaction({this.context});
Future<bool> push(Widget route)async{
var value= await Navigator.push(
context!,
MaterialPageRoute(builder: (context) {
return route;
}),
);
return true;
}
}

View File

@@ -0,0 +1,14 @@
class PaymentType{
String key,value;
PaymentType(this.key, this.value);
}
class PaymentOption{
static List<PaymentType> getList(){
List<PaymentType> list = [];
list.add(PaymentType("select", "Select"));
list.add(PaymentType("offline", "Offline"));
list.add(PaymentType("online", "Online"));
return list;
}
}

View File

@@ -0,0 +1,30 @@
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class SubmitBtn{
static Widget show({EdgeInsetsGeometry padding= EdgeInsets.zero,Color borderColor=const Color.fromRGBO(255, 255, 255, 0.0) ,double elevation=0.0,Alignment alignment = Alignment.centerLeft,Color backgroundColor=MyTheme.app_accent_color,Function? onTap ,double height=0.0,double width=0.0,double radius=0.0,Widget child= const Text("")}){
return ElevatedButton(
style: ElevatedButton.styleFrom(
elevation: elevation,
backgroundColor: backgroundColor,
padding: padding,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(radius),
side: BorderSide(color: borderColor)
),
),
onPressed: onTap as void Function()?,
child: Container(
height: height,
width: width,
alignment: alignment,
child: child),
);
}
}

View File

@@ -0,0 +1,28 @@
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:one_context/one_context.dart';
import 'package:toast/toast.dart';
import 'package:flutter/material.dart';
class ToastComponent {
static showDialog(String msg, {duration = 0, gravity = 0,textStyle = const TextStyle(color: MyTheme.font_grey),Color bgColor =const Color.fromRGBO(239, 239, 239, .9)}) {
ToastContext().init(OneContext().context!);
Toast.show(
msg,
duration: duration != 0 ? duration : Toast.lengthLong,
gravity: gravity != 0 ? gravity : Toast.bottom,
backgroundColor:bgColor,
textStyle:textStyle,
border: Border(
top: BorderSide(
color: Color.fromRGBO(203, 209, 209, 1),
),bottom:BorderSide(
color: Color.fromRGBO(203, 209, 209, 1),
),right: BorderSide(
color: Color.fromRGBO(203, 209, 209, 1),
),left: BorderSide(
color: Color.fromRGBO(203, 209, 209, 1),
)),
backgroundRadius: 6
);
}
}

View File

@@ -0,0 +1,194 @@
// To parse this JSON data, do
//
// final refundOrderResponse = refundOrderResponseFromJson(jsonString);
import 'dart:convert';
RefundOrderResponse refundOrderResponseFromJson(String str) => RefundOrderResponse.fromJson(json.decode(str));
String refundOrderResponseToJson(RefundOrderResponse data) => json.encode(data.toJson());
class RefundOrderResponse {
RefundOrderResponse({
this.data,
this.links,
this.meta,
this.success,
this.status,
});
List<Datum>? data;
Links? links;
Meta? meta;
bool? success;
var status;
factory RefundOrderResponse.fromJson(Map<String, dynamic> json) => RefundOrderResponse(
data: List<Datum>.from(json["data"].map((x) => Datum.fromJson(x))),
links: Links.fromJson(json["links"]),
meta: Meta.fromJson(json["meta"]),
success: json["success"],
status: json["status"],
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
"links": links!.toJson(),
"meta": meta!.toJson(),
"success": success,
"status": status,
};
}
class Datum {
Datum({
this.id,
this.userId,
this.orderCode,
this.productName,
this.productPrice,
this.refundStatus,
this.refundLabel,
this.seller_approval,
this.refundReson,
this.rejectReson,
this.date,
});
int? id;
int? userId;
String? orderCode;
String? productName;
String? productPrice;
var refundStatus;
var seller_approval;
String? refundLabel;
String? rejectReson;
String? refundReson;
String? date;
factory Datum.fromJson(Map<String, dynamic> json) => Datum(
id: json["id"],
userId: json["user_id"],
orderCode: json["order_code"],
productName: json["product_name"],
productPrice: json["product_price"],
refundStatus: json["refund_status"],
refundLabel: json["refund_label"],
seller_approval: json["seller_approval"],
refundReson: json["reason"],
rejectReson: json["reject_reason"],
date: json["date"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"order_code": orderCode,
"product_name": productName,
"product_price": productPrice,
"refund_status": refundStatus,
"refund_label": refundLabel,
"seller_approval": seller_approval,
"reason": refundReson,
"reject_reason": rejectReson,
"date": date,
};
}
class Links {
Links({
this.first,
this.last,
this.prev,
this.next,
});
String? first;
String? last;
dynamic prev;
dynamic next;
factory Links.fromJson(Map<String, dynamic> json) => Links(
first: json["first"],
last: json["last"],
prev: json["prev"],
next: json["next"],
);
Map<String, dynamic> toJson() => {
"first": first,
"last": last,
"prev": prev,
"next": next,
};
}
class Meta {
Meta({
this.currentPage,
this.from,
this.lastPage,
this.links,
this.path,
this.perPage,
this.to,
this.total,
});
int? currentPage;
int? from;
int? lastPage;
List<Link>? links;
String? path;
int? perPage;
int? to;
int? total;
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
currentPage: json["current_page"],
from: json["from"],
lastPage: json["last_page"],
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
path: json["path"],
perPage: json["per_page"],
to: json["to"],
total: json["total"],
);
Map<String, dynamic> toJson() => {
"current_page": currentPage,
"from": from,
"last_page": lastPage,
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
"path": path,
"per_page": perPage,
"to": to,
"total": total,
};
}
class Link {
Link({
this.url,
this.label,
this.active,
});
String? url;
String? label;
bool? active;
factory Link.fromJson(Map<String, dynamic> json) => Link(
url: json["url"] == null ? null : json["url"],
label: json["label"],
active: json["active"],
);
Map<String, dynamic> toJson() => {
"url": url == null ? null : url,
"label": label,
"active": active,
};
}

View File

@@ -0,0 +1,57 @@
// To parse this JSON data, do
//
// final addonResponse = addonResponseFromJson(jsonString);
import 'dart:convert';
List<AddonResponse> addonResponseFromJson(String str) => List<AddonResponse>.from(json.decode(str).map((x) => AddonResponse.fromJson(x)).toList());
String addonResponseToJson(List<AddonResponse> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class AddonResponse {
AddonResponse({
this.id,
this.name,
this.uniqueIdentifier,
this.version,
this.activated,
this.image,
this.purchaseCode,
this.createdAt,
this.updatedAt,
});
int? id;
String? name;
String? uniqueIdentifier;
String? version;
var activated;
String? image;
String? purchaseCode;
DateTime? createdAt;
DateTime? updatedAt;
factory AddonResponse.fromJson(Map<String, dynamic> json) => AddonResponse(
id: json["id"],
name: json["name"],
uniqueIdentifier: json["unique_identifier"],
version: json["version"],
activated: json["activated"],
image: json["image"],
purchaseCode: json["purchase_code"],
createdAt: DateTime.parse(json["created_at"]),
updatedAt: DateTime.parse(json["updated_at"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"name": name,
"unique_identifier": uniqueIdentifier,
"version": version,
"activated": activated,
"image": image,
"purchase_code": purchaseCode,
"created_at": createdAt!.toIso8601String(),
"updated_at": updatedAt!.toIso8601String(),
};
}

View File

@@ -0,0 +1,37 @@
// To parse this JSON data, do
//
// final businessSettingListResponse = businessSettingListResponseFromJson(jsonString);
import 'dart:convert';
List<BusinessSettingListResponse> businessSettingListResponseFromJson(String str) => List<BusinessSettingListResponse>.from(json.decode(str).map((x) => BusinessSettingListResponse.fromJson(x)));
String businessSettingListResponseToJson(List<BusinessSettingListResponse> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class BusinessSettingListResponse {
BusinessSettingListResponse({
this.id,
this.type,
this.value,
this.lang,
});
int? id;
String? type;
var value;
dynamic lang;
factory BusinessSettingListResponse.fromJson(Map<String, dynamic> json) => BusinessSettingListResponse(
id: json["id"],
type: json["type"],
value: json["value"],
lang: json["lang"],
);
Map<String, dynamic> toJson() => {
"id": id,
"type": type,
"value": value,
"lang": lang,
};
}

View File

@@ -0,0 +1,89 @@
// To parse this JSON data, do
//
// final categoryResponse = categoryResponseFromJson(jsonString);
//https://app.quicktype.io/
import 'dart:convert';
CategoryResponse categoryResponseFromJson(String str) => CategoryResponse.fromJson(json.decode(str));
String categoryResponseToJson(CategoryResponse data) => json.encode(data.toJson());
class CategoryResponse {
CategoryResponse({
this.categories,
this.success,
this.status,
});
List<Category>? categories;
bool? success;
var status;
factory CategoryResponse.fromJson(Map<String, dynamic> json) => CategoryResponse(
categories: List<Category>.from(json["data"].map((x) => Category.fromJson(x))),
success: json["success"],
status: json["status"],
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(categories!.map((x) => x.toJson())),
"success": success,
"status": status,
};
}
class Category {
Category({
this.id,
this.name,
this.banner,
this.icon,
this.number_of_children,
this.links,
});
int? id;
String? name;
String? banner;
String? icon;
int? number_of_children;
Links? links;
factory Category.fromJson(Map<String, dynamic> json) => Category(
id: json["id"],
name: json["name"],
banner: json["banner"],
icon: json["icon"],
number_of_children: json["number_of_children"],
links: Links.fromJson(json["links"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"name": name,
"banner": banner,
"icon": icon,
"number_of_children": number_of_children,
"links": links!.toJson(),
};
}
class Links {
Links({
this.products,
this.subCategories,
});
String? products;
String? subCategories;
factory Links.fromJson(Map<String, dynamic> json) => Links(
products: json["products"],
subCategories: json["sub_categories"],
);
Map<String, dynamic> toJson() => {
"products": products,
"sub_categories": subCategories,
};
}

View File

@@ -0,0 +1,33 @@
// To parse this JSON data, do
//
// final CategoryWiseProductResponse = CategoryWiseProductResponseFromJson(jsonString);
import 'dart:convert';
List<CategoryWiseProductResponse> categoryWiseProductResponseFromJson(String str) => List<CategoryWiseProductResponse>.from(json.decode(str).map((x) => CategoryWiseProductResponse.fromJson(x)));
String categoryWiseProductResponseToJson(List<CategoryWiseProductResponse> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class CategoryWiseProductResponse {
CategoryWiseProductResponse({
this.name,
this.cntProduct,
this.banner,
});
String? name;
int? cntProduct;
String? banner;
factory CategoryWiseProductResponse.fromJson(Map<String, dynamic> json) => CategoryWiseProductResponse(
name: json["name"],
cntProduct: json["cnt_product"],
banner: json["banner"],
);
Map<String, dynamic> toJson() => {
"name": name,
"cnt_product": cntProduct,
"banner": banner,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final chartResponse = chartResponseFromJson(jsonString);
import 'dart:convert';
List<ChartResponse> chartResponseFromJson(String str) => List<ChartResponse>.from(json.decode(str).map((x) => ChartResponse.fromJson(x)));
String chartResponseToJson(List<ChartResponse> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class ChartResponse {
ChartResponse({
this.total,
this.date,
});
double? total;
String? date;
factory ChartResponse.fromJson(Map<String, dynamic> json) => ChartResponse(
total: json["total"].toDouble(),
date: json["date"],
);
Map<String, dynamic> toJson() => {
"total": total,
"date": date,
};
}

View File

@@ -0,0 +1,53 @@
// To parse this JSON data, do
//
// final ChatListResponse = ChatListResponseFromJson(jsonString);
import 'dart:convert';
ChatListResponse chatListResponseFromJson(String str) => ChatListResponse.fromJson(json.decode(str));
String chatListResponseToJson(ChatListResponse data) => json.encode(data.toJson());
class ChatListResponse {
ChatListResponse({
this.data,
});
List<Chat>? data;
factory ChatListResponse.fromJson(Map<String, dynamic> json) => ChatListResponse(
data: List<Chat>.from(json["data"].map((x) => Chat.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class Chat {
Chat({
this.id,
this.image,
this.name,
this.title,
});
int? id;
String? image;
String? name;
String? title;
factory Chat.fromJson(Map<String, dynamic> json) => Chat(
id: json["id"],
image: json["image"],
name: json["name"],
title: json["title"],
);
Map<String, dynamic> toJson() => {
"id": id,
"image": image,
"name": name,
"title": title,
};
}

View File

@@ -0,0 +1,161 @@
// To parse this JSON data, do
//
// final CommissionHistoryResponse = CommissionHistoryResponseFromJson(jsonString);
import 'dart:convert';
CommissionHistoryResponse commissionHistoryResponseFromJson(String str) => CommissionHistoryResponse.fromJson(json.decode(str));
String commissionHistoryResponseToJson(CommissionHistoryResponse data) => json.encode(data.toJson());
class CommissionHistoryResponse {
CommissionHistoryResponse({
this.data,
this.links,
this.meta,
});
List<Commission>? data;
Links? links;
Meta? meta;
factory CommissionHistoryResponse.fromJson(Map<String, dynamic> json) => CommissionHistoryResponse(
data: List<Commission>.from(json["data"].map((x) => Commission.fromJson(x))),
links: Links.fromJson(json["links"]),
meta: Meta.fromJson(json["meta"]),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
"links": links!.toJson(),
"meta": meta!.toJson(),
};
}
class Commission {
Commission({
this.id,
this.orderCode,
this.adminCommission,
this.sellerEarning,
this.createdAt,
});
int? id;
String? orderCode;
var adminCommission;
String? sellerEarning;
String? createdAt;
factory Commission.fromJson(Map<String, dynamic> json) => Commission(
id: json["id"],
orderCode: json["order_code"],
adminCommission: json["admin_commission"],
sellerEarning: json["seller_earning"],
createdAt: json["created_at"],
);
Map<String, dynamic> toJson() => {
"id": id,
"order_code": orderCode,
"admin_commission": adminCommission,
"seller_earning": sellerEarning,
"created_at": createdAt,
};
}
class Links {
Links({
this.first,
this.last,
this.prev,
this.next,
});
String? first;
String? last;
dynamic prev;
dynamic next;
factory Links.fromJson(Map<String, dynamic> json) => Links(
first: json["first"],
last: json["last"],
prev: json["prev"],
next: json["next"],
);
Map<String, dynamic> toJson() => {
"first": first,
"last": last,
"prev": prev,
"next": next,
};
}
class Meta {
Meta({
this.currentPage,
this.from,
this.lastPage,
this.links,
this.path,
this.perPage,
this.to,
this.total,
});
int? currentPage;
int? from;
int? lastPage;
List<Link>? links;
String? path;
int? perPage;
int? to;
int? total;
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
currentPage: json["current_page"],
from: json["from"],
lastPage: json["last_page"],
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
path: json["path"],
perPage: json["per_page"],
to: json["to"],
total: json["total"],
);
Map<String, dynamic> toJson() => {
"current_page": currentPage,
"from": from,
"last_page": lastPage,
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
"path": path,
"per_page": perPage,
"to": to,
"total": total,
};
}
class Link {
Link({
this.url,
this.label,
this.active,
});
String? url;
String? label;
bool? active;
factory Link.fromJson(Map<String, dynamic> json) => Link(
url: json["url"] == null ? null : json["url"],
label: json["label"],
active: json["active"],
);
Map<String, dynamic> toJson() => {
"url": url == null ? null : url,
"label": label,
"active": active,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final CommonResponse = CommonResponseFromJson(jsonString);
import 'dart:convert';
CommonResponse commonResponseFromJson(String str) => CommonResponse.fromJson(json.decode(str));
String commonResponseToJson(CommonResponse data) => json.encode(data.toJson());
class CommonResponse {
CommonResponse({
this.result,
this.message,
});
bool? result;
dynamic message;
factory CommonResponse.fromJson(Map<String, dynamic> json) => CommonResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,63 @@
// To parse this JSON data, do
//
// final countryResponse = countryResponseFromJson(jsonString);
import 'dart:convert';
CountryResponse countryResponseFromJson(String str) => CountryResponse.fromJson(json.decode(str));
String countryResponseToJson(CountryResponse data) => json.encode(data.toJson());
class CountryResponse {
CountryResponse({
this.countries,
this.success,
this.status,
});
List<Country>? countries;
bool? success;
int? status;
factory CountryResponse.fromJson(Map<String, dynamic> json) => CountryResponse(
countries: List<Country>.from(json["data"].map((x) => Country.fromJson(x))),
success: json["success"],
status: json["status"],
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(countries!.map((x) => x.toJson())),
"success": success,
"status": status,
};
}
class Country {
Country({
this.id,
this.code,
this.name,
this.status,
});
@override toString() => '$name';
int? id;
String? code;
String? name;
int? status;
factory Country.fromJson(Map<String, dynamic> json) => Country(
id: json["id"],
code: json["code"],
name: json["name"],
status: json["status"],
);
Map<String, dynamic> toJson() => {
"id": id,
"code": code,
"name": name,
"status": status,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final couponCreateResponse = couponCreateResponseFromJson(jsonString);
import 'dart:convert';
CouponCreateResponse couponCreateResponseFromJson(String str) => CouponCreateResponse.fromJson(json.decode(str));
String couponCreateResponseToJson(CouponCreateResponse data) => json.encode(data.toJson());
class CouponCreateResponse {
CouponCreateResponse({
this.result,
this.message,
});
bool? result;
var message;
factory CouponCreateResponse.fromJson(Map<String, dynamic> json) => CouponCreateResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,65 @@
// To parse this JSON data, do
//
// final couponListResponse = couponListResponseFromJson(jsonString);
import 'dart:convert';
CouponListResponse couponListResponseFromJson(String str) => CouponListResponse.fromJson(json.decode(str));
String couponListResponseToJson(CouponListResponse data) => json.encode(data.toJson());
class CouponListResponse {
CouponListResponse({
this.data,
});
List<Coupon>? data;
factory CouponListResponse.fromJson(Map<String, dynamic> json) => CouponListResponse(
data: List<Coupon>.from(json["data"].map((x) => Coupon.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class Coupon {
Coupon({
this.id,
this.type,
this.code,
this.discount,
this.discountType,
this.startDate,
this.endDate,
});
int? id;
String? type;
String? code;
var discount;
String? discountType;
String? startDate;
String? endDate;
factory Coupon.fromJson(Map<String, dynamic> json) => Coupon(
id: json["id"],
type: json["type"],
code: json["code"],
discount: json["discount"],
discountType: json["discount_type"],
startDate: json["start_date"],
endDate: json["end_date"],
);
Map<String, dynamic> toJson() => {
"id": id,
"type": type,
"code": code,
"discount": discount,
"discount_type": discountType,
"start_date": startDate,
"end_date": endDate,
};
}

View File

@@ -0,0 +1,69 @@
// To parse this JSON data, do
//
// final editCouponResponse = editCouponResponseFromJson(jsonString);
import 'dart:convert';
EditCouponResponse editCouponResponseFromJson(String str) => EditCouponResponse.fromJson(json.decode(str));
String editCouponResponseToJson(EditCouponResponse data) => json.encode(data.toJson());
class EditCouponResponse {
EditCouponResponse({
this.data,
});
Data? data;
factory EditCouponResponse.fromJson(Map<String, dynamic> json) => EditCouponResponse(
data: Data.fromJson(json["data"]),
);
Map<String, dynamic> toJson() => {
"data": data!.toJson(),
};
}
class Data {
Data({
this.id,
this.type,
this.code,
this.details,
this.discount,
this.discountType,
this.startDate,
this.endDate,
});
int? id;
String? type;
String? code;
String? details;
var discount;
String? discountType;
String? startDate;
String? endDate;
factory Data.fromJson(Map<String, dynamic> json) => Data(
id: json["id"],
type: json["type"],
code: json["code"],
details: json["details"],
discount: json["discount"],
discountType: json["discount_type"],
startDate: json["start_date"],
endDate: json["end_date"],
);
Map<String, dynamic> toJson() => {
"id": id,
"type": type,
"code": code,
"details": details,
"discount": discount,
"discount_type": discountType,
"start_date": startDate,
"end_date": endDate,
};
}

View File

@@ -0,0 +1,165 @@
// To parse this JSON data, do
//
// final googleLocationDetailsResponse = googleLocationDetailsResponseFromJson(jsonString);
import 'dart:convert';
GoogleLocationDetailsResponse googleLocationDetailsResponseFromJson(String str) => GoogleLocationDetailsResponse.fromJson(json.decode(str));
String googleLocationDetailsResponseToJson(GoogleLocationDetailsResponse data) => json.encode(data.toJson());
class GoogleLocationDetailsResponse {
GoogleLocationDetailsResponse({
this.htmlAttributions,
this.result,
this.status,
});
List<dynamic>? htmlAttributions;
Result? result;
String? status;
factory GoogleLocationDetailsResponse.fromJson(Map<String, dynamic> json) => GoogleLocationDetailsResponse(
htmlAttributions: List<dynamic>.from(json["html_attributions"].map((x) => x)),
result: Result.fromJson(json["result"]),
status: json["status"],
);
Map<String, dynamic> toJson() => {
"html_attributions": List<dynamic>.from(htmlAttributions!.map((x) => x)),
"result": result!.toJson(),
"status": status,
};
}
class Result {
Result({
this.addressComponents,
this.formattedAddress,
this.geometry,
this.placeId,
this.reference,
this.types,
this.url,
this.utcOffset,
this.vicinity,
});
List<AddressComponent>? addressComponents;
String? formattedAddress;
Geometry? geometry;
String? placeId;
String? reference;
List<String>? types;
String? url;
int? utcOffset;
String? vicinity;
factory Result.fromJson(Map<String, dynamic> json) => Result(
addressComponents: List<AddressComponent>.from(json["address_components"].map((x) => AddressComponent.fromJson(x))),
formattedAddress: json["formatted_address"],
geometry: Geometry.fromJson(json["geometry"]),
placeId: json["place_id"],
reference: json["reference"],
types: List<String>.from(json["types"].map((x) => x)),
url: json["url"],
utcOffset: json["utc_offset"],
vicinity: json["vicinity"],
);
Map<String, dynamic> toJson() => {
"address_components": List<dynamic>.from(addressComponents!.map((x) => x.toJson())),
"formatted_address": formattedAddress,
"geometry": geometry!.toJson(),
"place_id": placeId,
"reference": reference,
"types": List<dynamic>.from(types!.map((x) => x)),
"url": url,
"utc_offset": utcOffset,
"vicinity": vicinity,
};
}
class AddressComponent {
AddressComponent({
this.longName,
this.shortName,
this.types,
});
String? longName;
String? shortName;
List<String>? types;
factory AddressComponent.fromJson(Map<String, dynamic> json) => AddressComponent(
longName: json["long_name"],
shortName: json["short_name"],
types: List<String>.from(json["types"].map((x) => x)),
);
Map<String, dynamic> toJson() => {
"long_name": longName,
"short_name": shortName,
"types": List<dynamic>.from(types!.map((x) => x)),
};
}
class Geometry {
Geometry({
this.location,
this.viewport,
});
Location? location;
Viewport? viewport;
factory Geometry.fromJson(Map<String, dynamic> json) => Geometry(
location: Location.fromJson(json["location"]),
viewport: Viewport.fromJson(json["viewport"]),
);
Map<String, dynamic> toJson() => {
"location": location!.toJson(),
"viewport": viewport!.toJson(),
};
}
class Location {
Location({
this.lat,
this.lng,
});
double? lat;
double? lng;
factory Location.fromJson(Map<String, dynamic> json) => Location(
lat: json["lat"].toDouble(),
lng: json["lng"].toDouble(),
);
Map<String, dynamic> toJson() => {
"lat": lat,
"lng": lng,
};
}
class Viewport {
Viewport({
this.northeast,
this.southwest,
});
Location? northeast;
Location? southwest;
factory Viewport.fromJson(Map<String, dynamic> json) => Viewport(
northeast: Location.fromJson(json["northeast"]),
southwest: Location.fromJson(json["southwest"]),
);
Map<String, dynamic> toJson() => {
"northeast": northeast!.toJson(),
"southwest": southwest!.toJson(),
};
}

View File

@@ -0,0 +1,73 @@
// To parse this JSON data, do
//
// final languageListResponse = languageListResponseFromJson(jsonString);
import 'dart:convert';
LanguageListResponse languageListResponseFromJson(String str) => LanguageListResponse.fromJson(json.decode(str));
String languageListResponseToJson(LanguageListResponse data) => json.encode(data.toJson());
class LanguageListResponse {
LanguageListResponse({
this.languages,
this.success,
this.status,
});
List<Language>? languages;
bool? success;
int? status;
factory LanguageListResponse.fromJson(Map<String, dynamic> json) => LanguageListResponse(
languages: List<Language>.from(json["data"].map((x) => Language.fromJson(x))),
success: json["success"],
status: json["status"],
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(languages!.map((x) => x.toJson())),
"success": success,
"status": status,
};
}
class Language {
Language({
this.id,
this.name,
this.image,
this.code,
this.mobile_app_code,
this.rtl,
this.is_default,
});
int? id;
String? name;
String? image;
String? code;
String? mobile_app_code;
bool? rtl;
bool? is_default;
factory Language.fromJson(Map<String, dynamic> json) => Language(
id: json["id"],
name: json["name"],
image: json["image"],
code: json["code"],
mobile_app_code: json["mobile_app_code"],
rtl: json["rtl"],
is_default: json["is_default"],
);
Map<String, dynamic> toJson() => {
"id": id,
"name": name,
"image": image,
"code": code,
"mobile_app_code": mobile_app_code,
"rtl": rtl,
"is_default": is_default,
};
}

View File

@@ -0,0 +1,133 @@
// To parse this JSON data, do
//
// final googleLocationAutoCompleteResponse = googleLocationAutoCompleteResponseFromJson(jsonString);
import 'dart:convert';
GoogleLocationAutoCompleteResponse googleLocationAutoCompleteResponseFromJson(String str) => GoogleLocationAutoCompleteResponse.fromJson(json.decode(str));
String googleLocationAutoCompleteResponseToJson(GoogleLocationAutoCompleteResponse data) => json.encode(data.toJson());
class GoogleLocationAutoCompleteResponse {
GoogleLocationAutoCompleteResponse({
this.predictions,
this.status,
});
List<Prediction>? predictions;
String? status;
factory GoogleLocationAutoCompleteResponse.fromJson(Map<String, dynamic> json) => GoogleLocationAutoCompleteResponse(
predictions: List<Prediction>.from(json["predictions"].map((x) => Prediction.fromJson(x))),
status: json["status"],
);
Map<String, dynamic> toJson() => {
"predictions": List<dynamic>.from(predictions!.map((x) => x.toJson())),
"status": status,
};
}
class Prediction {
Prediction({
this.description,
this.matchedSubstrings,
this.placeId,
this.reference,
this.structuredFormatting,
this.terms,
this.types,
});
String? description;
List<MatchedSubstring>? matchedSubstrings;
String? placeId;
String? reference;
StructuredFormatting? structuredFormatting;
List<Term>? terms;
List<String>? types;
factory Prediction.fromJson(Map<String, dynamic> json) => Prediction(
description: json["description"],
matchedSubstrings: List<MatchedSubstring>.from(json["matched_substrings"].map((x) => MatchedSubstring.fromJson(x))),
placeId: json["place_id"],
reference: json["reference"],
structuredFormatting: StructuredFormatting.fromJson(json["structured_formatting"]),
terms: List<Term>.from(json["terms"].map((x) => Term.fromJson(x))),
types: List<String>.from(json["types"].map((x) => x)),
);
Map<String, dynamic> toJson() => {
"description": description,
"matched_substrings": List<dynamic>.from(matchedSubstrings!.map((x) => x.toJson())),
"place_id": placeId,
"reference": reference,
"structured_formatting": structuredFormatting!.toJson(),
"terms": List<dynamic>.from(terms!.map((x) => x.toJson())),
"types": List<dynamic>.from(types!.map((x) => x)),
};
}
class MatchedSubstring {
MatchedSubstring({
this.length,
this.offset,
});
int? length;
int? offset;
factory MatchedSubstring.fromJson(Map<String, dynamic> json) => MatchedSubstring(
length: json["length"],
offset: json["offset"],
);
Map<String, dynamic> toJson() => {
"length": length,
"offset": offset,
};
}
class StructuredFormatting {
StructuredFormatting({
this.mainText,
this.mainTextMatchedSubstrings,
this.secondaryText,
});
String? mainText;
List<MatchedSubstring>? mainTextMatchedSubstrings;
String? secondaryText;
factory StructuredFormatting.fromJson(Map<String, dynamic> json) => StructuredFormatting(
mainText: json["main_text"],
mainTextMatchedSubstrings: List<MatchedSubstring>.from(json["main_text_matched_substrings"].map((x) => MatchedSubstring.fromJson(x))),
secondaryText: json["secondary_text"],
);
Map<String, dynamic> toJson() => {
"main_text": mainText,
"main_text_matched_substrings": List<dynamic>.from(mainTextMatchedSubstrings!.map((x) => x.toJson())),
"secondary_text": secondaryText,
};
}
class Term {
Term({
this.offset,
this.value,
});
int? offset;
String? value;
factory Term.fromJson(Map<String, dynamic> json) => Term(
offset: json["offset"],
value: json["value"],
);
Map<String, dynamic> toJson() => {
"offset": offset,
"value": value,
};
}

View File

@@ -0,0 +1,85 @@
// To parse this JSON data, do
//
// final loginResponse = loginResponseFromJson(jsonString);
import 'dart:convert';
LoginResponse loginResponseFromJson(String str) => LoginResponse.fromJson(json.decode(str));
String loginResponseToJson(LoginResponse data) => json.encode(data.toJson());
class LoginResponse {
LoginResponse({
this.result,
this.message,
this.access_token,
this.token_type,
this.expires_at,
this.user,
});
bool? result;
String? message;
String? access_token;
String? token_type;
DateTime? expires_at;
User? user;
factory LoginResponse.fromJson(Map<String, dynamic> json) => LoginResponse(
result: json["result"],
message: json["message"],
access_token: json["access_token"] == null ? null : json["access_token"],
token_type: json["token_type"] == null ? null : json["token_type"],
expires_at: json["expires_at"] == null ? null : DateTime.parse(json["expires_at"]),
user: json["user"] == null ? null : User.fromJson(json["user"]),
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
"access_token": access_token == null ? null : access_token,
"token_type": token_type == null ? null : token_type,
"expires_at": expires_at == null ? null : expires_at!.toIso8601String(),
"user": user == null ? null : user!.toJson(),
};
}
class User {
User({
this.id,
this.type,
this.name,
this.email,
this.avatar,
this.avatar_original,
this.phone,
});
int? id;
String? type;
String? name;
String? email;
String? avatar;
String? avatar_original;
String? phone;
factory User.fromJson(Map<String, dynamic> json) => User(
id: json["id"],
type: json["type"],
name: json["name"],
email: json["email"],
avatar: json["avatar"],
avatar_original: json["avatar_original"],
phone: json["phone"],
);
Map<String, dynamic> toJson() => {
"id": id,
"type": type,
"name": name,
"email": email,
"avatar": avatar,
"avatar_original": avatar_original,
"phone": phone,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final logoutResponse = logoutResponseFromJson(jsonString);
import 'dart:convert';
LogoutResponse logoutResponseFromJson(String str) => LogoutResponse.fromJson(json.decode(str));
String logoutResponseToJson(LogoutResponse data) => json.encode(data.toJson());
class LogoutResponse {
LogoutResponse({
this.result,
this.message,
});
bool? result;
String? message;
factory LogoutResponse.fromJson(Map<String, dynamic> json) => LogoutResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,82 @@
// To parse this JSON data, do
//
// final messageResponse = messageResponseFromJson(jsonString);
import 'dart:convert';
MessageResponse messageResponseFromJson(String str) => MessageResponse.fromJson(json.decode(str));
String messageResponseToJson(MessageResponse data) => json.encode(data.toJson());
class MessageResponse {
MessageResponse({
this.data,
this.success,
this.status,
});
List<Message>? data;
bool? success;
int? status;
static final message = [84, 104, 101, 32, 97, 112, 112, 32, 105, 115, 32, 105, 110, 97, 99, 116, 105, 118, 97, 116, 101, 100];
factory MessageResponse.fromJson(Map<String, dynamic> json) => MessageResponse(
data: List<Message>.from(json["data"].map((x) => Message.fromJson(x))),
success: json["success"],
status: json["status"],
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
"success": success,
"status": status,
};
}
class Message {
Message({
this.id,
this.userId,
this.sendType,
this.message,
this.year,
this.month,
this.dayOfMonth,
this.date,
this.time,
});
int? id;
int? userId;
String? sendType;
String? message;
String? year;
String? month;
String? dayOfMonth;
String? date;
String? time;
factory Message.fromJson(Map<String, dynamic> json) => Message(
id: json["id"],
userId: json["user_id"],
sendType: json["send_type"],
message: json["message"],
year: json["year"],
month: json["month"],
dayOfMonth: json["day_of_month"],
date: json["date"],
time: json["time"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"send_type": sendType,
"message": message,
"year": year,
"month": month,
"day_of_month": dayOfMonth,
"date": date,
"time": time,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final offlineWalletRechargeResponse = offlineWalletRechargeResponseFromJson(jsonString);
import 'dart:convert';
OfflinePaymentResponse offlinePaymentResponseFromJson(String str) => OfflinePaymentResponse.fromJson(json.decode(str));
String offlinePaymentResponseToJson(OfflinePaymentResponse data) => json.encode(data.toJson());
class OfflinePaymentResponse {
OfflinePaymentResponse({
this.result,
this.message,
});
bool? result;
String? message;
factory OfflinePaymentResponse.fromJson(Map<String, dynamic> json) => OfflinePaymentResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,165 @@
// To parse this JSON data, do
//
// final orderDetailResponse = orderDetailResponseFromJson(jsonString);
import 'dart:convert';
OrderDetailResponse orderDetailResponseFromJson(String str) => OrderDetailResponse.fromJson(json.decode(str));
String orderDetailResponseToJson(OrderDetailResponse data) => json.encode(data.toJson());
class OrderDetailResponse {
OrderDetailResponse({
this.data,
});
List<DetailedOrder>? data;
factory OrderDetailResponse.fromJson(Map<String, dynamic> json) => OrderDetailResponse(
data: List<DetailedOrder>.from(json["data"].map((x) => DetailedOrder.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class DetailedOrder {
DetailedOrder({
this.orderCode,
this.total,
this.orderDate,
this.paymentStatus,
this.paymentType,
this.deliveryStatus,
this.shippingType,
this.paymentMethod,
this.shippingAddress,
this.shippingCost,
this.subtotal,
this.couponDiscount,
this.tax,
this.orderItems,
});
String? orderCode;
String? total;
String? orderDate;
String? paymentStatus;
String? paymentType;
String? deliveryStatus;
String? shippingType;
String? paymentMethod;
ShippingAddress? shippingAddress;
String? shippingCost;
String? subtotal;
String? couponDiscount;
String? tax;
List<OrderItem>? orderItems;
factory DetailedOrder.fromJson(Map<String, dynamic> json) => DetailedOrder(
orderCode: json["order_code"],
total: json["total"],
orderDate: json["order_date"],
paymentStatus: json["payment_status"],
paymentType: json["payment_type"],
deliveryStatus: json["delivery_status"],
shippingType: json["shipping_type"],
paymentMethod: json["payment_method"],
shippingAddress: ShippingAddress.fromJson(json["shipping_address"]),
shippingCost: json["shipping_cost"],
subtotal: json["subtotal"],
couponDiscount: json["coupon_discount"],
tax: json["tax"],
orderItems: List<OrderItem>.from(json["order_items"].map((x) => OrderItem.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"order_code": orderCode,
"total": total,
"order_date": orderDate,
"payment_status": paymentStatus,
"payment_type": paymentType,
"delivery_status": deliveryStatus,
"shipping_type": shippingType,
"payment_method": paymentMethod,
"shipping_address": shippingAddress!.toJson(),
"shipping_cost": shippingCost,
"subtotal": subtotal,
"coupon_discount": couponDiscount,
"tax": tax,
"order_items": List<dynamic>.from(orderItems!.map((x) => x.toJson())),
};
}
class OrderItem {
OrderItem({
this.name,
this.description,
this.price,
this.deliveryStatus
});
var name;
var description;
String? price;
String? deliveryStatus;
factory OrderItem.fromJson(Map<String, dynamic> json) => OrderItem(
name: json["name"]??"",
description: json["description"],
price: json["price"],
deliveryStatus: json["delivery_status"]
);
Map<String, dynamic> toJson() => {
"name": name??"",
"description": description,
"price": price,
"delivery_status": deliveryStatus,
};
}
class ShippingAddress {
ShippingAddress({
this.name,
this.email,
this.address,
this.country,
this.state,
this.city,
this.postalCode,
this.phone,
});
String? name;
dynamic email;
String? address;
String? country;
String? state;
String? city;
String? postalCode;
String? phone;
factory ShippingAddress.fromJson(Map<String, dynamic> json) => ShippingAddress(
name: json["name"],
email: json["email"],
address: json["address"],
country: json["country"],
state: json["state"],
city: json["city"],
postalCode: json["postal_code"],
phone: json["phone"],
);
Map<String, dynamic> toJson() => {
"name": name,
"email": email,
"address": address,
"country": country,
"state": state,
"city": city,
"postal_code": postalCode,
"phone": phone,
};
}

View File

@@ -0,0 +1,165 @@
// To parse this JSON data, do
//
// final orderListResponse = orderListResponseFromJson(jsonString);
import 'dart:convert';
OrderListResponse orderListResponseFromJson(String str) => OrderListResponse.fromJson(json.decode(str));
String orderListResponseToJson(OrderListResponse data) => json.encode(data.toJson());
class OrderListResponse {
OrderListResponse({
this.data,
this.links,
this.meta,
});
List<Order>? data;
Links? links;
Meta? meta;
factory OrderListResponse.fromJson(Map<String, dynamic> json) => OrderListResponse(
data: List<Order>.from(json["data"].map((x) => Order.fromJson(x))),
links: Links.fromJson(json["links"]),
meta: Meta.fromJson(json["meta"]),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
"links": links!.toJson(),
"meta": meta!.toJson(),
};
}
class Order {
Order({
this.id,
this.orderCode,
this.total,
this.orderDate,
this.paymentStatus,
this.deliveryStatus,
});
int? id;
String? orderCode;
String? total;
String? orderDate;
String? paymentStatus;
String? deliveryStatus;
factory Order.fromJson(Map<String, dynamic> json) => Order(
id: json["id"],
orderCode: json["order_code"],
total: json["total"],
orderDate: json["order_date"],
paymentStatus: json["payment_status"],
deliveryStatus: json["delivery_status"],
);
Map<String, dynamic> toJson() => {
"id": id,
"order_code": orderCode,
"total": total,
"order_date": orderDate,
"payment_status": paymentStatus,
"delivery_status": deliveryStatus,
};
}
class Links {
Links({
this.first,
this.last,
this.prev,
this.next,
});
String? first;
String? last;
dynamic prev;
String? next;
factory Links.fromJson(Map<String, dynamic> json) => Links(
first: json["first"],
last: json["last"],
prev: json["prev"],
next: json["next"],
);
Map<String, dynamic> toJson() => {
"first": first,
"last": last,
"prev": prev,
"next": next,
};
}
class Meta {
Meta({
this.currentPage,
this.from,
this.lastPage,
this.links,
this.path,
this.perPage,
this.to,
this.total,
});
int? currentPage;
int? from;
int? lastPage;
List<Link>? links;
String? path;
int? perPage;
int? to;
int? total;
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
currentPage: json["current_page"],
from: json["from"],
lastPage: json["last_page"],
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
path: json["path"],
perPage: json["per_page"],
to: json["to"],
total: json["total"],
);
Map<String, dynamic> toJson() => {
"current_page": currentPage,
"from": from,
"last_page": lastPage,
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
"path": path,
"per_page": perPage,
"to": to,
"total": total,
};
}
class Link {
Link({
this.url,
this.label,
this.active,
});
String? url;
String? label;
bool? active;
factory Link.fromJson(Map<String, dynamic> json) => Link(
url: json["url"] == null ? null : json["url"],
label: json["label"],
active: json["active"],
);
Map<String, dynamic> toJson() => {
"url": url == null ? null : url,
"label": label,
"active": active,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final passwordConfirmResponse = passwordConfirmResponseFromJson(jsonString);
import 'dart:convert';
PasswordConfirmResponse passwordConfirmResponseFromJson(String str) => PasswordConfirmResponse.fromJson(json.decode(str));
String passwordConfirmResponseToJson(PasswordConfirmResponse data) => json.encode(data.toJson());
class PasswordConfirmResponse {
PasswordConfirmResponse({
this.result,
this.message,
});
bool? result;
String? message;
factory PasswordConfirmResponse.fromJson(Map<String, dynamic> json) => PasswordConfirmResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final passwordForgetResponse = passwordForgetResponseFromJson(jsonString);
import 'dart:convert';
PasswordForgetResponse passwordForgetResponseFromJson(String str) => PasswordForgetResponse.fromJson(json.decode(str));
String passwordForgetResponseToJson(PasswordForgetResponse data) => json.encode(data.toJson());
class PasswordForgetResponse {
PasswordForgetResponse({
this.result,
this.message,
});
bool? result;
String? message;
factory PasswordForgetResponse.fromJson(Map<String, dynamic> json) => PasswordForgetResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,160 @@
// To parse this JSON data, do
//
// final paymentHistoryResponse = paymentHistoryResponseFromJson(jsonString);
import 'dart:convert';
PaymentHistoryResponse paymentHistoryResponseFromJson(String str) =>
PaymentHistoryResponse.fromJson(json.decode(str));
String paymentHistoryResponseToJson(PaymentHistoryResponse data) =>
json.encode(data.toJson());
class PaymentHistoryResponse {
PaymentHistoryResponse({
this.data,
this.links,
this.meta,
});
List<Payment>? data;
Links? links;
Meta? meta;
factory PaymentHistoryResponse.fromJson(Map<String, dynamic> json) =>
PaymentHistoryResponse(
data: List<Payment>.from(json["data"].map((x) => Payment.fromJson(x))),
links: Links.fromJson(json["links"]),
meta: Meta.fromJson(json["meta"]),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
"links": links!.toJson(),
"meta": meta!.toJson(),
};
}
class Payment {
Payment({
this.id,
this.amount,
this.paymentMethod,
this.paymentDate,
});
int? id;
String? amount;
String? paymentMethod;
String? paymentDate;
factory Payment.fromJson(Map<String, dynamic> json) => Payment(
id: json["id"],
amount: json["amount"],
paymentMethod: json["payment_method"],
paymentDate: json["payment_date"],
);
Map<String, dynamic> toJson() => {
"id": id,
"amount": amount,
"payment_method": paymentMethod,
"payment_date": paymentDate,
};
}
class Links {
Links({
this.first,
this.last,
this.prev,
this.next,
});
String? first;
String? last;
dynamic prev;
dynamic next;
factory Links.fromJson(Map<String, dynamic> json) => Links(
first: json["first"],
last: json["last"],
prev: json["prev"],
next: json["next"],
);
Map<String, dynamic> toJson() => {
"first": first,
"last": last,
"prev": prev,
"next": next,
};
}
class Meta {
Meta({
this.currentPage,
this.from,
this.lastPage,
this.links,
this.path,
this.perPage,
this.to,
this.total,
});
var currentPage;
var from;
var lastPage;
List<Link>? links;
String? path;
var perPage;
var to;
var total;
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
currentPage: json["current_page"],
from: json["from"],
lastPage: json["last_page"],
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
path: json["path"],
perPage: json["per_page"],
to: json["to"],
total: json["total"],
);
Map<String, dynamic> toJson() => {
"current_page": currentPage,
"from": from,
"last_page": lastPage,
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
"path": path,
"per_page": perPage,
"to": to,
"total": total,
};
}
class Link {
Link({
this.url,
this.label,
this.active,
});
String? url;
String? label;
bool? active;
factory Link.fromJson(Map<String, dynamic> json) => Link(
url: json["url"] == null ? null : json["url"],
label: json["label"],
active: json["active"],
);
Map<String, dynamic> toJson() => {
"url": url == null ? null : url,
"label": label,
"active": active,
};
}

View File

@@ -0,0 +1,50 @@
// To parse this JSON data, do
//
// final paymentTypeResponse = paymentTypeResponseFromJson(jsonString);
import 'dart:convert';
List<PaymentTypeResponse> paymentTypeResponseFromJson(String str) => List<PaymentTypeResponse>.from(json.decode(str).map((x) => PaymentTypeResponse.fromJson(x)));
String paymentTypeResponseToJson(List<PaymentTypeResponse> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class PaymentTypeResponse {
PaymentTypeResponse({
this.payment_type,
this.payment_type_key,
this.image,
this.name,
this.title,
this.offline_payment_id,
this.details
});
String? payment_type;
String? payment_type_key;
String? image;
String? name;
String? title;
int? offline_payment_id;
String? details;
factory PaymentTypeResponse.fromJson(Map<String, dynamic> json) => PaymentTypeResponse(
payment_type: json["payment_type"],
payment_type_key: json["payment_type_key"],
image: json["image"],
name: json["name"],
title: json["title"],
offline_payment_id: json["offline_payment_id"],
details: json["details"],
);
Map<String, dynamic> toJson() => {
"payment_type": payment_type,
"payment_type_key": payment_type_key,
"image": image,
"name": name,
"title": title,
"offline_payment_id": offline_payment_id,
"details": details,
};
}

View File

@@ -0,0 +1,37 @@
// To parse this JSON data, do
//
// final bkashBeginResponse = bkashBeginResponseFromJson(jsonString);
import 'dart:convert';
BkashBeginResponse bkashBeginResponseFromJson(String str) => BkashBeginResponse.fromJson(json.decode(str));
String bkashBeginResponseToJson(BkashBeginResponse data) => json.encode(data.toJson());
class BkashBeginResponse {
BkashBeginResponse({
this.token,
this.result,
this.url,
this.message,
});
String? token;
bool? result;
String? url;
String? message;
factory BkashBeginResponse.fromJson(Map<String, dynamic> json) => BkashBeginResponse(
token: json["token"],
result: json["result"],
url: json["url"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"token": token,
"result": result,
"url": url,
"message": message,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final bkashPaymentProcessResponse = bkashPaymentProcessResponseFromJson(jsonString);
import 'dart:convert';
BkashPaymentProcessResponse bkashPaymentProcessResponseFromJson(String str) => BkashPaymentProcessResponse.fromJson(json.decode(str));
String bkashPaymentProcessResponseToJson(BkashPaymentProcessResponse data) => json.encode(data.toJson());
class BkashPaymentProcessResponse {
BkashPaymentProcessResponse({
this.result,
this.message,
});
bool? result;
String? message;
factory BkashPaymentProcessResponse.fromJson(Map<String, dynamic> json) => BkashPaymentProcessResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,33 @@
// To parse this JSON data, do
//
// final flutterwaveUrlResponse = flutterwaveUrlResponseFromJson(jsonString);
import 'dart:convert';
FlutterwaveUrlResponse flutterwaveUrlResponseFromJson(String str) => FlutterwaveUrlResponse.fromJson(json.decode(str));
String flutterwaveUrlResponseToJson(FlutterwaveUrlResponse data) => json.encode(data.toJson());
class FlutterwaveUrlResponse {
FlutterwaveUrlResponse({
this.result,
this.url,
this.message,
});
bool? result;
String? url;
String? message;
factory FlutterwaveUrlResponse.fromJson(Map<String, dynamic> json) => FlutterwaveUrlResponse(
result: json["result"],
url: json["url"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"url": url,
"message": message,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final iyzicoPaymentSuccessResponse = iyzicoPaymentSuccessResponseFromJson(jsonString);
import 'dart:convert';
IyzicoPaymentSuccessResponse iyzicoPaymentSuccessResponseFromJson(String str) => IyzicoPaymentSuccessResponse.fromJson(json.decode(str));
String iyzicoPaymentSuccessResponseToJson(IyzicoPaymentSuccessResponse data) => json.encode(data.toJson());
class IyzicoPaymentSuccessResponse {
IyzicoPaymentSuccessResponse({
this.result,
this.message,
});
bool? result;
String? message;
factory IyzicoPaymentSuccessResponse.fromJson(Map<String, dynamic> json) => IyzicoPaymentSuccessResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,37 @@
// To parse this JSON data, do
//
// final nagadBeginResponse = nagadBeginResponseFromJson(jsonString);
import 'dart:convert';
NagadBeginResponse nagadBeginResponseFromJson(String str) => NagadBeginResponse.fromJson(json.decode(str));
String nagadBeginResponseToJson(NagadBeginResponse data) => json.encode(data.toJson());
class NagadBeginResponse {
NagadBeginResponse({
this.token,
this.result,
this.url,
this.message,
});
String? token;
bool? result;
String? url;
String? message;
factory NagadBeginResponse.fromJson(Map<String, dynamic> json) => NagadBeginResponse(
token: json["token"],
result: json["result"],
url: json["url"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"token": token,
"result": result,
"url": url,
"message": message,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final nagadPaymentProcessResponse = nagadPaymentProcessResponseFromJson(jsonString);
import 'dart:convert';
NagadPaymentProcessResponse nagadPaymentProcessResponseFromJson(String str) => NagadPaymentProcessResponse.fromJson(json.decode(str));
String nagadPaymentProcessResponseToJson(NagadPaymentProcessResponse data) => json.encode(data.toJson());
class NagadPaymentProcessResponse {
NagadPaymentProcessResponse({
this.result,
this.message,
});
bool? result;
String? message;
factory NagadPaymentProcessResponse.fromJson(Map<String, dynamic> json) => NagadPaymentProcessResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,33 @@
// To parse this JSON data, do
//
// final paypalUrlResponse = paypalUrlResponseFromJson(jsonString);
import 'dart:convert';
PaypalUrlResponse paypalUrlResponseFromJson(String str) => PaypalUrlResponse.fromJson(json.decode(str));
String paypalUrlResponseToJson(PaypalUrlResponse data) => json.encode(data.toJson());
class PaypalUrlResponse {
PaypalUrlResponse({
this.result,
this.url,
this.message,
});
bool? result;
String? url;
String? message;
factory PaypalUrlResponse.fromJson(Map<String, dynamic> json) => PaypalUrlResponse(
result: json["result"],
url: json["url"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"url": url,
"message": message,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final paystackPaymentSuccessResponse = paystackPaymentSuccessResponseFromJson(jsonString);
import 'dart:convert';
PaystackPaymentSuccessResponse paystackPaymentSuccessResponseFromJson(String str) => PaystackPaymentSuccessResponse.fromJson(json.decode(str));
String paystackPaymentSuccessResponseToJson(PaystackPaymentSuccessResponse data) => json.encode(data.toJson());
class PaystackPaymentSuccessResponse {
PaystackPaymentSuccessResponse({
this.result,
this.message,
});
bool? result;
String? message;
factory PaystackPaymentSuccessResponse.fromJson(Map<String, dynamic> json) => PaystackPaymentSuccessResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final razorpayPaymentSuccessResponse = razorpayPaymentSuccessResponseFromJson(jsonString);
import 'dart:convert';
RazorpayPaymentSuccessResponse razorpayPaymentSuccessResponseFromJson(String str) => RazorpayPaymentSuccessResponse.fromJson(json.decode(str));
String razorpayPaymentSuccessResponseToJson(RazorpayPaymentSuccessResponse data) => json.encode(data.toJson());
class RazorpayPaymentSuccessResponse {
RazorpayPaymentSuccessResponse({
this.result,
this.message,
});
bool? result;
String? message;
factory RazorpayPaymentSuccessResponse.fromJson(Map<String, dynamic> json) => RazorpayPaymentSuccessResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,33 @@
// To parse this JSON data, do
//
// final sslcommerzBeginResponse = sslcommerzBeginResponseFromJson(jsonString);
import 'dart:convert';
SslcommerzBeginResponse sslcommerzBeginResponseFromJson(String str) => SslcommerzBeginResponse.fromJson(json.decode(str));
String sslcommerzBeginResponseToJson(SslcommerzBeginResponse data) => json.encode(data.toJson());
class SslcommerzBeginResponse {
SslcommerzBeginResponse({
this.result,
this.url,
this.message,
});
bool? result;
String? url;
String? message;
factory SslcommerzBeginResponse.fromJson(Map<String, dynamic> json) => SslcommerzBeginResponse(
result: json["result"],
url: json["url"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"url": url,
"message": message,
};
}

View File

@@ -0,0 +1,37 @@
// To parse this JSON data, do
//
// final phoneEmailAvailabilityResponse = phoneEmailAvailabilityResponseFromJson(jsonString);
import 'dart:convert';
PhoneEmailAvailabilityResponse phoneEmailAvailabilityResponseFromJson(String str) => PhoneEmailAvailabilityResponse.fromJson(json.decode(str));
String phoneEmailAvailabilityResponseToJson(PhoneEmailAvailabilityResponse data) => json.encode(data.toJson());
class PhoneEmailAvailabilityResponse {
PhoneEmailAvailabilityResponse({
this.phone_available,
this.email_available,
this.phone_available_message,
this.email_available_message,
});
bool? phone_available;
bool? email_available;
String? phone_available_message;
String? email_available_message;
factory PhoneEmailAvailabilityResponse.fromJson(Map<String, dynamic> json) => PhoneEmailAvailabilityResponse(
phone_available: json["phone_available"],
email_available: json["email_available"],
phone_available_message: json["phone_available_message"],
email_available_message: json["email_available_message"],
);
Map<String, dynamic> toJson() => {
"phone_available": phone_available,
"email_available": email_available,
"phone_available_message": phone_available_message,
"email_available_message": email_available_message,
};
}

View File

@@ -0,0 +1,11 @@
import 'package:active_ecommerce_seller_app/const/dropdown_models.dart';
class AttributesModel {
CommonDropDownItem name;
List<CommonDropDownItem> attributeItems = [];
List<CommonDropDownItem> selectedAttributeItems;
CommonDropDownItem? selectedAttributeItem;
AttributesModel(this.name, this.attributeItems, this.selectedAttributeItems,
this.selectedAttributeItem);
}

View File

@@ -0,0 +1,85 @@
// To parse this JSON data, do
//
// final attributeResponse = attributeResponseFromJson(jsonString);
import 'dart:convert';
AttributeResponse attributeResponseFromJson(String str) => AttributeResponse.fromJson(json.decode(str));
String attributeResponseToJson(AttributeResponse data) => json.encode(data.toJson());
class AttributeResponse {
AttributeResponse({
this.data,
});
List<Attribute>? data;
factory AttributeResponse.fromJson(Map<String, dynamic> json) => AttributeResponse(
data: List<Attribute>.from(json["data"].map((x) => Attribute.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class Attribute {
Attribute({
this.id,
this.name,
this.values,
});
var id;
String? name;
List<Value>? values;
factory Attribute.fromJson(Map<String, dynamic> json) => Attribute(
id: json["id"],
name: json["name"],
values: List<Value>.from(json["values"].map((x) => Value.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"id": id,
"name": name,
"values": List<dynamic>.from(values!.map((x) => x.toJson())),
};
}
class Value {
Value({
this.id,
this.attributeId,
this.value,
this.colorCode,
this.createdAt,
this.updatedAt,
});
var id;
var attributeId;
String? value;
dynamic colorCode;
DateTime? createdAt;
DateTime? updatedAt;
factory Value.fromJson(Map<String, dynamic> json) => Value(
id: json["id"],
attributeId: json["attribute_id"],
value: json["value"],
colorCode: json["color_code"],
createdAt: DateTime.parse(json["created_at"]),
updatedAt: DateTime.parse(json["updated_at"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"attribute_id": attributeId,
"value": value,
"color_code": colorCode,
"created_at": createdAt!.toIso8601String(),
"updated_at": updatedAt!.toIso8601String(),
};
}

View File

@@ -0,0 +1,49 @@
// To parse this JSON data, do
//
// final brandResponse = brandResponseFromJson(jsonString);
import 'dart:convert';
BrandResponse brandResponseFromJson(String str) => BrandResponse.fromJson(json.decode(str));
String brandResponseToJson(BrandResponse data) => json.encode(data.toJson());
class BrandResponse {
BrandResponse({
this.data,
});
List<Brand>? data;
factory BrandResponse.fromJson(Map<String, dynamic> json) => BrandResponse(
data: List<Brand>.from(json["data"].map((x) => Brand.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class Brand {
Brand({
this.id,
this.name,
this.icon,
});
int? id;
String? name;
String? icon;
factory Brand.fromJson(Map<String, dynamic> json) => Brand(
id: json["id"],
name: json["name"],
icon: json["icon"],
);
Map<String, dynamic> toJson() => {
"id": id,
"name": name,
"icon": icon,
};
}

View File

@@ -0,0 +1,73 @@
// To parse this JSON data, do
//
// final categoryResponse = categoryResponseFromJson(jsonString);
import 'dart:convert';
CategoryResponse categoryResponseFromJson(String str) => CategoryResponse.fromJson(json.decode(str));
String categoryResponseToJson(CategoryResponse data) => json.encode(data.toJson());
class CategoryResponse {
CategoryResponse({
this.data,
});
List<Category>? data;
factory CategoryResponse.fromJson(Map<String, dynamic> json) => CategoryResponse(
data: List<Category>.from(json["data"].map((x) => Category.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class Category {
Category({
this.id,
this.parentId,
this.level,
this.name,
this.banner,
this.icon,
this.featured,
this.digital,
this.child,
});
var id;
var parentId;
var level;
String? name;
String? banner;
String? icon;
bool? featured;
bool? digital;
List<Category>? child;
factory Category.fromJson(Map<String, dynamic> json) => Category(
id: json["id"],
parentId: json["parent_id"],
level: int.parse(json["level"].toString()),
name: json["name"],
banner: json["banner"],
icon: json["icon"],
featured: json["featured"],
digital: json["digital"],
child: List<Category>.from(json["child"].map((x) => Category.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"id": id,
"parent_id": parentId,
"level": level,
"name": name,
"banner": banner,
"icon": icon,
"featured": featured,
"digital": digital,
"child": List<dynamic>.from(child!.map((x) => x.toJson())),
};
}

View File

@@ -0,0 +1,18 @@
class CategoryModel{
String? id ="",parentId="";
String? parentLevel='';
int? level=0;
String? levelText='';
CategoryModel({this.id, this.parentId, this.parentLevel,this.level ,this.levelText});
setLevelText(){
String tmpTxt="";
for(int i =0;i<level!;i++){
tmpTxt+="";
}
levelText="$tmpTxt $levelText";
}
}

View File

@@ -0,0 +1,49 @@
// To parse this JSON data, do
//
// final colorResponse = colorResponseFromJson(jsonString);
import 'dart:convert';
ColorResponse colorResponseFromJson(String str) => ColorResponse.fromJson(json.decode(str));
String colorResponseToJson(ColorResponse data) => json.encode(data.toJson());
class ColorResponse {
ColorResponse({
this.data,
});
List<ColorInfo>? data;
factory ColorResponse.fromJson(Map<String, dynamic> json) => ColorResponse(
data: List<ColorInfo>.from(json["data"].map((x) => ColorInfo.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class ColorInfo {
ColorInfo({
this.id,
this.name,
this.code,
});
int? id;
String? name;
String? code;
factory ColorInfo.fromJson(Map<String, dynamic> json) => ColorInfo(
id: json["id"],
name: json["name"],
code: json["code"],
);
Map<String, dynamic> toJson() => {
"id": id,
"name": name,
"code": code,
};
}

View File

@@ -0,0 +1,8 @@
class CustomRadioModel{
String title,key;
bool isActive;
CustomRadioModel(this.title,this.key, this.isActive);
}

View File

@@ -0,0 +1,442 @@
// To parse this JSON data, do
//
// final productEditResponse = productEditResponseFromJson(jsonString);
import 'dart:convert';
import 'package:active_ecommerce_seller_app/data_model/uploaded_file_list_response.dart';
ProductEditResponse productEditResponseFromJson(String str) => ProductEditResponse.fromJson(json.decode(str));
String productEditResponseToJson(ProductEditResponse data) => json.encode(data.toJson());
class ProductEditResponse {
ProductEditResponse({
this.data,
this.result,
this.status,
});
ProductInfo? data;
bool? result;
var status;
factory ProductEditResponse.fromJson(Map<String, dynamic> json) => ProductEditResponse(
data: ProductInfo.fromJson(json["data"]),
result: json["result"],
status: json["status"],
);
Map<String, dynamic> toJson() => {
"data": data!.toJson(),
"result": result,
"status": status,
};
}
class ProductInfo {
ProductInfo({
this.id,
this.lang,
this.productName,
this.productUnit,
this.description,
this.categoryId,
this.brandId,
this.photos,
this.thumbnailImg,
this.videoProvider,
this.videoLink,
this.tags,
this.unitPrice,
this.purchasePrice,
this.variantProduct,
this.attributes,
this.choiceOptions,
this.colors,
this.variations,
this.stocks,
this.todaysDeal,
this.published,
this.approved,
this.stockVisibilityState,
this.cashOnDelivery,
this.featured,
this.sellerFeatured,
this.refundable,
this.currentStock,
this.weight,
this.minQty,
this.lowStockQuantity,
this.discount,
this.discountType,
this.discountStartDate,
this.discountEndDate,
this.tax,
this.taxType,
this.shippingType,
this.shippingCost,
this.isQuantityMultiplied,
this.estShippingDays,
this.numOfSale,
this.metaTitle,
this.metaDescription,
this.metaImg,
this.pdf,
this.slug,
this.rating,
this.barcode,
this.digital,
this.auctionProduct,
this.fileName,
this.filePath,
this.externalLink,
this.externalLinkBtn,
this.wholesaleProduct,
this.createdAt,
this.updatedAt,
});
var id;
String? lang;
String? productName;
String? productUnit;
dynamic description;
var categoryId;
dynamic brandId;
Photos? photos;
Photos? thumbnailImg;
String? videoProvider;
dynamic videoLink;
String? tags;
var unitPrice;
dynamic purchasePrice;
var variantProduct;
List<String>? attributes;
List<ChoiceOption>? choiceOptions;
List<String>? colors;
dynamic variations;
Stock? stocks;
var todaysDeal;
var published;
var approved;
String? stockVisibilityState;
var cashOnDelivery;
var featured;
var sellerFeatured;
var refundable;
var currentStock;
var weight;
var minQty;
var lowStockQuantity;
var discount;
String? discountType;
var discountStartDate;
var discountEndDate;
List<Tax>? tax;
dynamic taxType;
String? shippingType;
var shippingCost;
var isQuantityMultiplied;
dynamic estShippingDays;
var numOfSale;
String? metaTitle;
String? metaDescription;
Photos? metaImg;
Photos? pdf;
String? slug;
var rating;
dynamic barcode;
var digital;
var auctionProduct;
dynamic fileName;
dynamic filePath;
dynamic externalLink;
dynamic externalLinkBtn;
var wholesaleProduct;
DateTime? createdAt;
DateTime? updatedAt;
factory ProductInfo.fromJson(Map<String, dynamic> json) => ProductInfo(
id: json["id"],
lang: json["lang"],
productName: json["product_name"],
productUnit: json["product_unit"],
description: json["description"],
categoryId: json["category_id"],
brandId: json["brand_id"],
photos: Photos.fromJson(json["photos"]),
thumbnailImg: Photos.fromJson(json["thumbnail_img"]),
videoProvider: json["video_provider"],
videoLink: json["video_link"],
tags: json["tags"],
unitPrice: json["unit_price"],
purchasePrice: json["purchase_price"],
variantProduct: json["variant_product"],
attributes: List<String>.from(json["attributes"].map((x) => x)),
choiceOptions: List<ChoiceOption>.from(json["choice_options"].map((x) => ChoiceOption.fromJson(x))),
colors: List<String>.from(json["colors"].map((x) => x)),
variations: json["variations"],
stocks: Stock.fromJson(json["stocks"]),
todaysDeal: json["todays_deal"],
published: json["published"],
approved: json["approved"],
stockVisibilityState: json["stock_visibility_state"],
cashOnDelivery: json["cash_on_delivery"],
featured: json["featured"],
sellerFeatured: json["seller_featured"]??0,
refundable: json["refundable"],
currentStock: json["current_stock"],
weight: json["weight"],
minQty: json["min_qty"],
lowStockQuantity: json["low_stock_quantity"],
discount: json["discount"],
discountType: json["discount_type"],
discountStartDate: json["discount_start_date"],
discountEndDate: json["discount_end_date"],
tax:List<Tax>.from(json["tax"].map((x) => Tax.fromJson(x))),
taxType: json["tax_type"],
shippingType: json["shipping_type"],
shippingCost: json["shipping_cost"],
isQuantityMultiplied: json["is_quantity_multiplied"],
estShippingDays: json["est_shipping_days"],
numOfSale: json["num_of_sale"],
metaTitle: json["meta_title"],
metaDescription: json["meta_description"],
// metaImg: json["meta_img"],
metaImg: Photos.fromJson(json["meta_img"]),
pdf: Photos.fromJson(json["pdf"]),
slug: json["slug"],
rating: json["rating"],
barcode: json["barcode"],
digital: json["digital"],
auctionProduct: json["auction_product"],
fileName: json["file_name"],
filePath: json["file_path"],
externalLink: json["external_link"],
externalLinkBtn: json["external_link_btn"],
wholesaleProduct: json["wholesale_product"],
createdAt: DateTime.parse(json["created_at"]),
updatedAt: DateTime.parse(json["updated_at"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"lang": lang,
"product_name": productName,
"product_unit": productUnit,
"description": description,
"category_id": categoryId,
"brand_id": brandId,
"photos": photos!.toJson(),
"thumbnail_img": thumbnailImg!.toJson(),
"video_provider": videoProvider,
"video_link": videoLink,
"tags": tags,
"unit_price": unitPrice,
"purchase_price": purchasePrice,
"variant_product": variantProduct,
"attributes": List<dynamic>.from(attributes!.map((x) => x)),
"choice_options": List<dynamic>.from(choiceOptions!.map((x) => x.toJson())),
"colors": List<dynamic>.from(colors!.map((x) => x)),
"variations": variations,
"stocks": stocks!.toJson(),
"todays_deal": todaysDeal,
"published": published,
"approved": approved,
"stock_visibility_state": stockVisibilityState,
"cash_on_delivery": cashOnDelivery,
"featured": featured,
"seller_featured": sellerFeatured,
"refundable": refundable,
"current_stock": currentStock,
"weight": weight,
"min_qty": minQty,
"low_stock_quantity": lowStockQuantity,
"discount": discount,
"discount_type": discountType,
"discount_start_date": discountStartDate,
"discount_end_date": discountEndDate,
"tax": List<dynamic>.from(tax!.map((x) => x.toJson())),
"tax_type": taxType,
"shipping_type": shippingType,
"shipping_cost": shippingCost,
"is_quantity_multiplied": isQuantityMultiplied,
"est_shipping_days": estShippingDays,
"num_of_sale": numOfSale,
"meta_title": metaTitle,
"meta_description": metaDescription,
"meta_img": metaImg!.toJson(),
"pdf": pdf!.toJson(),
"slug": slug,
"rating": rating,
"barcode": barcode,
"digital": digital,
"auction_product": auctionProduct,
"file_name": fileName,
"file_path": filePath,
"external_link": externalLink,
"external_link_btn": externalLinkBtn,
"wholesale_product": wholesaleProduct,
"created_at": createdAt!.toIso8601String(),
"updated_at": updatedAt!.toIso8601String(),
};
}
class ChoiceOption {
ChoiceOption({
this.attributeId,
this.values,
});
String? attributeId;
List<String>? values;
factory ChoiceOption.fromJson(Map<String, dynamic> json) => ChoiceOption(
attributeId: json["attribute_id"],
values: List<String>.from(json["values"].map((x) => x)),
);
Map<String, dynamic> toJson() => {
"attribute_id": attributeId,
"values": List<dynamic>.from(values!.map((x) => x)),
};
}
class StockValues {
StockValues({
this.id,
this.fileOriginalName,
this.fileName,
this.url,
this.fileSize,
this.extension,
this.type,
this.productId,
this.variant,
this.sku,
this.price,
this.qty,
this.image,
});
var id;
String? fileOriginalName;
String? fileName;
String? url;
var fileSize;
String? extension;
String? type;
var productId;
String? variant;
String? sku;
var price;
var qty;
Photos? image;
factory StockValues.fromJson(Map<String, dynamic> json) => StockValues(
id: json["id"],
fileOriginalName: json["file_original_name"],
fileName: json["file_name"],
url: json["url"],
fileSize: json["file_size"],
extension: json["extension"],
type: json["type"],
productId: json["product_id"],
variant: json["variant"],
sku: json["sku"],
price: json["price"],
qty: json["qty"],
image: json["image"] == null ? null : Photos.fromJson(json["image"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"file_original_name": fileOriginalName,
"file_name": fileName,
"url": url,
"file_size": fileSize,
"extension": extension,
"type": type,
"product_id": productId,
"variant": variant,
"sku": sku,
"price": price,
"qty": qty,
"image": image!.toJson(),
};
}
class Photos {
Photos({
this.data,
});
List<FileInfo>? data;
factory Photos.fromJson(Map<String, dynamic> json) => Photos(
data: List<FileInfo>.from(json["data"].map((x) => FileInfo.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class Stock {
Stock({
this.data,
});
List<StockValues>? data;
factory Stock.fromJson(Map<String, dynamic> json) => Stock(
data: List<StockValues>.from(json["data"].map((x) => StockValues.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class Tax {
Tax({
this.id,
this.productId,
this.taxId,
this.tax,
this.taxType,
this.createdAt,
this.updatedAt,
});
var id;
var productId;
var taxId;
var tax;
String? taxType;
DateTime? createdAt;
DateTime? updatedAt;
factory Tax.fromJson(Map<String, dynamic> json) => Tax(
id: json["id"],
productId: json["product_id"],
taxId: json["tax_id"],
tax: json["tax"],
taxType: json["tax_type"],
createdAt: DateTime.parse(json["created_at"]),
updatedAt: DateTime.parse(json["updated_at"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"product_id": productId,
"tax_id": taxId,
"tax": tax,
"tax_type": taxType,
"created_at": createdAt!.toIso8601String(),
"updated_at": updatedAt!.toIso8601String(),
};
}

View File

@@ -0,0 +1,45 @@
// To parse this JSON data, do
//
// final taxResponse = taxResponseFromJson(jsonString);
import 'dart:convert';
TaxResponse taxResponseFromJson(String str) => TaxResponse.fromJson(json.decode(str));
String taxResponseToJson(TaxResponse data) => json.encode(data.toJson());
class TaxResponse {
TaxResponse({
this.data,
});
List<Datum>? data;
factory TaxResponse.fromJson(Map<String, dynamic> json) => TaxResponse(
data: List<Datum>.from(json["data"].map((x) => Datum.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class Datum {
Datum({
this.id,
this.name,
});
int? id;
String? name;
factory Datum.fromJson(Map<String, dynamic> json) => Datum(
id: json["id"],
name: json["name"],
);
Map<String, dynamic> toJson() => {
"id": id,
"name": name,
};
}

View File

@@ -0,0 +1,18 @@
import 'package:active_ecommerce_seller_app/const/dropdown_models.dart';
import 'package:flutter/material.dart';
class VatTaxModel{
String id ,name;
VatTaxModel(this.id, this.name);
}
class VatTaxViewModel{
VatTaxModel vatTaxModel;
TextEditingController amount= TextEditingController(text: "0");
List<CommonDropDownItem> items;
CommonDropDownItem? selectedItem;
VatTaxViewModel(this.vatTaxModel, this.items,{CommonDropDownItem? selectedItem,String? amount}) {
this.selectedItem= selectedItem ?? items.first;
this.amount.text=amount??"0";
}
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final deleteProduct = deleteProductFromJson(jsonString);
import 'dart:convert';
DeleteProduct deleteProductFromJson(String str) => DeleteProduct.fromJson(json.decode(str));
String deleteProductToJson(DeleteProduct data) => json.encode(data.toJson());
class DeleteProduct {
DeleteProduct({
this.result,
this.message,
});
bool? result;
String? message;
factory DeleteProduct.fromJson(Map<String, dynamic> json) => DeleteProduct(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final productDuplicateResponse = productDuplicateResponseFromJson(jsonString);
import 'dart:convert';
ProductDuplicateResponse productDuplicateResponseFromJson(String str) => ProductDuplicateResponse.fromJson(json.decode(str));
String productDuplicateResponseToJson(ProductDuplicateResponse data) => json.encode(data.toJson());
class ProductDuplicateResponse {
ProductDuplicateResponse({
this.result,
this.message,
});
bool? result;
String? message;
factory ProductDuplicateResponse.fromJson(Map<String, dynamic> json) => ProductDuplicateResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,69 @@
// To parse this JSON data, do
//
// final productForCouponResponse = productForCouponResponseFromJson(jsonString);
import 'dart:convert';
ProductForCouponResponse productForCouponResponseFromJson(String str) => ProductForCouponResponse.fromJson(json.decode(str));
String productForCouponResponseToJson(ProductForCouponResponse data) => json.encode(data.toJson());
class ProductForCouponResponse {
ProductForCouponResponse({
this.data,
});
List<CouponProduct>? data;
factory ProductForCouponResponse.fromJson(Map<String, dynamic> json) => ProductForCouponResponse(
data: List<CouponProduct>.from(json["data"].map((x) => CouponProduct.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class CouponProduct {
CouponProduct({
this.id,
this.name,
this.thumbnailImg,
this.price,
this.currentStock,
this.status,
this.category,
this.featured,
});
int? id;
String? name;
String? thumbnailImg;
String? price;
var currentStock;
bool? status;
String? category;
bool? featured;
factory CouponProduct.fromJson(Map<String, dynamic> json) => CouponProduct(
id: json["id"],
name: json["name"],
thumbnailImg: json["thumbnail_img"],
price: json["price"],
currentStock: json["current_stock"],
status: json["status"],
category: json["category"],
featured: json["featured"],
);
Map<String, dynamic> toJson() => {
"id": id,
"name": name,
"thumbnail_img": thumbnailImg,
"price": price,
"current_stock": currentStock,
"status": status,
"category": category,
"featured": featured,
};
}

View File

@@ -0,0 +1,177 @@
// To parse this JSON data, do
//
// final productReviewResponse = productReviewResponseFromJson(jsonString);
import 'dart:convert';
ProductReviewResponse productReviewResponseFromJson(String str) => ProductReviewResponse.fromJson(json.decode(str));
String productReviewResponseToJson(ProductReviewResponse data) => json.encode(data.toJson());
class ProductReviewResponse {
ProductReviewResponse({
this.data,
this.links,
this.meta,
});
List<Review>? data;
Links? links;
Meta? meta;
factory ProductReviewResponse.fromJson(Map<String, dynamic> json) => ProductReviewResponse(
data: List<Review>.from(json["data"].map((x) => Review.fromJson(x))),
links: Links.fromJson(json["links"]),
meta: Meta.fromJson(json["meta"]),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
"links": links!.toJson(),
"meta": meta!.toJson(),
};
}
class Review {
Review({
this.id,
this.rating,
this.comment,
this.status,
this.updatedAt,
this.productName,
this.userId,
this.name,
this.avatar,
});
int? id;
var rating;
String? comment;
int? status;
DateTime? updatedAt;
String? productName;
int? userId;
String? name;
dynamic avatar;
factory Review.fromJson(Map<String, dynamic> json) => Review(
id: json["id"],
rating: json["rating"],
comment: json["comment"],
status: json["status"],
updatedAt: DateTime.parse(json["updated_at"]),
productName: json["product_name"],
userId: json["user_id"],
name: json["name"],
avatar: json["avatar"],
);
Map<String, dynamic> toJson() => {
"id": id,
"rating": rating,
"comment": comment,
"status": status,
"updated_at": updatedAt!.toIso8601String(),
"product_name": productName,
"user_id": userId,
"name": name,
"avatar": avatar,
};
}
class Links {
Links({
this.first,
this.last,
this.prev,
this.next,
});
String? first;
String? last;
dynamic prev;
String? next;
factory Links.fromJson(Map<String, dynamic> json) => Links(
first: json["first"],
last: json["last"],
prev: json["prev"],
next: json["next"],
);
Map<String, dynamic> toJson() => {
"first": first,
"last": last,
"prev": prev,
"next": next,
};
}
class Meta {
Meta({
this.currentPage,
this.from,
this.lastPage,
this.links,
this.path,
this.perPage,
this.to,
this.total,
});
int? currentPage;
int? from;
int? lastPage;
List<Link>? links;
String? path;
int? perPage;
int? to;
int? total;
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
currentPage: json["current_page"],
from: json["from"],
lastPage: json["last_page"],
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
path: json["path"],
perPage: json["per_page"],
to: json["to"],
total: json["total"],
);
Map<String, dynamic> toJson() => {
"current_page": currentPage,
"from": from,
"last_page": lastPage,
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
"path": path,
"per_page": perPage,
"to": to,
"total": total,
};
}
class Link {
Link({
this.url,
this.label,
this.active,
});
String? url;
String? label;
bool? active;
factory Link.fromJson(Map<String, dynamic> json) => Link(
url: json["url"] == null ? null : json["url"],
label: json["label"],
active: json["active"],
);
Map<String, dynamic> toJson() => {
"url": url == null ? null : url,
"label": label,
"active": active,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final ProductStatusChange = ProductStatusChangeFromJson(jsonString);
import 'dart:convert';
ProductStatusChange ProductStatusChangeFromJson(String str) => ProductStatusChange.fromJson(json.decode(str));
String ProductStatusChangeToJson(ProductStatusChange data) => json.encode(data.toJson());
class ProductStatusChange {
ProductStatusChange({
this.result,
this.message,
});
bool? result;
String? message;
factory ProductStatusChange.fromJson(Map<String, dynamic> json) => ProductStatusChange(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,174 @@
// To parse this JSON data, do
//
// final productsResponse = productsResponseFromJson(jsonString);
import 'dart:convert';
ProductsResponse productsResponseFromJson(String str) => ProductsResponse.fromJson(json.decode(str));
String productsResponseToJson(ProductsResponse data) => json.encode(data.toJson());
class ProductsResponse {
ProductsResponse({
this.data,
this.links,
this.meta,
});
List<Product>? data;
Links? links;
Meta? meta;
factory ProductsResponse.fromJson(Map<String, dynamic> json) => ProductsResponse(
data: List<Product>.from(json["data"].map((x) => Product.fromJson(x))),
links: Links.fromJson(json["links"]),
meta: Meta.fromJson(json["meta"]),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
"links": links!.toJson(),
"meta": meta!.toJson(),
};
}
class Product {
Product({
this.id,
this.name,
this.thumbnailImg,
this.price,
this.status,
this.category,
this.featured,
this.quantity
});
var id;
String? name;
String? thumbnailImg;
String? price;
var status;
String? category;
var featured;
var quantity;
factory Product.fromJson(Map<String, dynamic> json) => Product(
id: json["id"],
name: json["name"],
thumbnailImg: json["thumbnail_img"],
price: json["price"],
status: json["status"],
category: json["category"],
featured: json["featured"],
quantity: json["current_stock"]
);
Map<String, dynamic> toJson() => {
"id": id,
"name": name,
"thumbnail_img": thumbnailImg,
"price": price,
"status": status,
"category": category,
"featured": featured,
"current_stock": quantity,
};
}
class Links {
Links({
this.first,
this.last,
this.prev,
this.next,
});
String? first;
String? last;
dynamic prev;
String? next;
factory Links.fromJson(Map<String, dynamic> json) => Links(
first: json["first"],
last: json["last"],
prev: json["prev"],
next: json["next"],
);
Map<String, dynamic> toJson() => {
"first": first,
"last": last,
"prev": prev,
"next": next,
};
}
class Meta {
Meta({
this.currentPage,
this.from,
this.lastPage,
this.links,
this.path,
this.perPage,
this.to,
this.total,
});
int? currentPage;
int? from;
int? lastPage;
List<Link>? links;
String? path;
int? perPage;
int? to;
int? total;
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
currentPage: json["current_page"],
from: json["from"],
lastPage: json["last_page"],
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
path: json["path"],
perPage: json["per_page"],
to: json["to"],
total: json["total"],
);
Map<String, dynamic> toJson() => {
"current_page": currentPage,
"from": from,
"last_page": lastPage,
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
"path": path,
"per_page": perPage,
"to": to,
"total": total,
};
}
class Link {
Link({
this.url,
this.label,
this.active,
});
String? url;
String? label;
bool? active;
factory Link.fromJson(Map<String, dynamic> json) => Link(
url: json["url"] == null ? null : json["url"],
label: json["label"],
active: json["active"],
);
Map<String, dynamic> toJson() => {
"url": url == null ? null : url,
"label": label,
"active": active,
};
}

View File

@@ -0,0 +1,37 @@
// To parse this JSON data, do
//
// final profileImageUpdateResponse = profileImageUpdateResponseFromJson(jsonString);
import 'dart:convert';
ProfileImageUpdateResponse profileImageUpdateResponseFromJson(String str) => ProfileImageUpdateResponse.fromJson(json.decode(str));
String profileImageUpdateResponseToJson(ProfileImageUpdateResponse data) => json.encode(data.toJson());
class ProfileImageUpdateResponse {
ProfileImageUpdateResponse({
this.result,
this.message,
this.path,
this.upload_id
});
bool? result;
String? message;
String? path;
var upload_id;
factory ProfileImageUpdateResponse.fromJson(Map<String, dynamic> json) => ProfileImageUpdateResponse(
result: json["result"],
message: json["message"],
path: json["path"],
upload_id: json["upload_id"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
"path": path,
"upload_id": upload_id,
};
}

View File

@@ -0,0 +1,53 @@
// To parse this JSON data, do
//
// final sellerProfileResponse = sellerProfileResponseFromJson(jsonString);
import 'dart:convert';
SellerProfileResponse sellerProfileResponseFromJson(String str) => SellerProfileResponse.fromJson(json.decode(str));
String sellerProfileResponseToJson(SellerProfileResponse data) => json.encode(data.toJson());
class SellerProfileResponse {
SellerProfileResponse({
this.result,
this.id,
this.type,
this.name,
this.email,
this.avatar,
this.avatarOriginal,
this.phone,
});
bool? result;
int? id;
String? type;
String? name;
String? email;
String? avatar;
String? avatarOriginal;
dynamic phone;
factory SellerProfileResponse.fromJson(Map<String, dynamic> json) => SellerProfileResponse(
result: json["result"],
id: json["id"],
type: json["type"],
name: json["name"],
email: json["email"],
avatar: json["avatar"],
avatarOriginal: json["avatar_original"],
phone: json["phone"],
);
Map<String, dynamic> toJson() => {
"result": result,
"id": id,
"type": type,
"name": name,
"email": email,
"avatar": avatar,
"avatar_original": avatarOriginal,
"phone": phone,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final profileUpdateResponse = profileUpdateResponseFromJson(jsonString);
import 'dart:convert';
ProfileUpdateResponse profileUpdateResponseFromJson(String str) => ProfileUpdateResponse.fromJson(json.decode(str));
String profileUpdateResponseToJson(ProfileUpdateResponse data) => json.encode(data.toJson());
class ProfileUpdateResponse {
ProfileUpdateResponse({
this.result,
this.message,
});
bool? result;
String? message;
factory ProfileUpdateResponse.fromJson(Map<String, dynamic> json) => ProfileUpdateResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,21 @@
import 'dart:convert';
RemainingProduct remainingProductFromJson(String str) => RemainingProduct.fromJson(json.decode(str));
String remainingProductToJson(RemainingProduct data) => json.encode(data.toJson());
class RemainingProduct {
RemainingProduct({
this.ramainingProduct,
});
var ramainingProduct;
factory RemainingProduct.fromJson(Map<String, dynamic> json) => RemainingProduct(
ramainingProduct: json["ramaining_product"],
);
Map<String, dynamic> toJson() => {
"ramaining_product": ramainingProduct,
};
}

View File

@@ -0,0 +1,29 @@
// To parse this JSON data, do
//
// final resendCodeResponse = resendCodeResponseFromJson(jsonString);
import 'dart:convert';
ResendCodeResponse resendCodeResponseFromJson(String str) => ResendCodeResponse.fromJson(json.decode(str));
String resendCodeResponseToJson(ResendCodeResponse data) => json.encode(data.toJson());
class ResendCodeResponse {
ResendCodeResponse({
this.result,
this.message,
});
bool? result;
String? message;
factory ResendCodeResponse.fromJson(Map<String, dynamic> json) => ResendCodeResponse(
result: json["result"],
message: json["message"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
};
}

View File

@@ -0,0 +1,65 @@
// To parse this JSON data, do
//
// final sellerPackageResponse = sellerPackageResponseFromJson(jsonString);
import 'dart:convert';
SellerPackageResponse sellerPackageResponseFromJson(String str) => SellerPackageResponse.fromJson(json.decode(str));
String sellerPackageResponseToJson(SellerPackageResponse data) => json.encode(data.toJson());
class SellerPackageResponse {
SellerPackageResponse({
this.data,
});
List<Package>? data;
factory SellerPackageResponse.fromJson(Map<String, dynamic> json) => SellerPackageResponse(
data: List<Package>.from(json["data"].map((x) => Package.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class Package {
Package({
this.id,
this.name,
this.logo,
this.productUploadLimit,
this.amount,
this.price,
this.duration,
});
int? id;
String? name;
String? logo;
int? productUploadLimit;
String? amount;
var price;
int? duration;
factory Package.fromJson(Map<String, dynamic> json) => Package(
id: json["id"],
name: json["name"],
logo: json["logo"],
productUploadLimit: json["product_upload_limit"],
amount: json["amount"],
price: json["price"],
duration: json["duration"],
);
Map<String, dynamic> toJson() => {
"id": id,
"name": name,
"logo": logo,
"product_upload_limit": productUploadLimit,
"amount": amount,
"price": price,
"duration": duration,
};
}

View File

@@ -0,0 +1,197 @@
// To parse this JSON ShopInfo, do
//
// final shopInfoResponse = shopInfoResponseFromJson(jsonString);
import 'dart:convert';
ShopInfoResponse shopInfoResponseFromJson(String str) => ShopInfoResponse.fromJson(json.decode(str));
String shopInfoResponseToJson(ShopInfoResponse ShopInfo) => json.encode(ShopInfo.toJson());
class ShopInfoResponse {
ShopInfoResponse({
this.shopInfo,
this.success,
this.status,
});
ShopInfo? shopInfo;
bool? success;
var status;
factory ShopInfoResponse.fromJson(Map<String, dynamic> json) => ShopInfoResponse(
shopInfo: ShopInfo.fromJson(json["data"]),
success: json["success"],
status: json["status"],
);
Map<String, dynamic> toJson() => {
"data": shopInfo!.toJson(),
"success": success,
"status": status,
};
}
class ShopInfo {
ShopInfo({
this.id,
this.userId,
this.name,
this.title,
this.description,
this.deliveryPickupLatitude,
this.deliveryPickupLongitude,
this.logo,
this.packageInvalidAt,
this.productUploadLimit,
this.sellerPackage,
this.sellerPackageImg,
this.uploadId,
this.sliders,
this.slidersId,
this.address,
this.adminToPay,
this.is_submitted_form,
this.phone,
this.facebook,
this.google,
this.twitter,
this.instagram,
this.youtube,
this.cashOnDeliveryStatus,
this.bank_payment_status,
this.bankName,
this.bankAccName,
this.bankAccNo,
this.bankRoutingNo,
this.rating,
this.verified,
this.verifiedImg,
this.verifyText,
this.email,
this.products,
this.orders,
this.sales,
});
var id;
var userId;
String? name;
String? title;
String? description;
dynamic deliveryPickupLatitude;
dynamic deliveryPickupLongitude;
String? logo;
String? packageInvalidAt;
var productUploadLimit;
String? sellerPackage;
String? sellerPackageImg;
String? uploadId;
List<String>? sliders;
dynamic slidersId;
String? address;
var adminToPay;
bool? is_submitted_form;
String? phone;
String? facebook;
String? google;
String? twitter;
dynamic instagram;
String? youtube;
var cashOnDeliveryStatus;
var bank_payment_status;
String? bankName;
String? bankAccName;
String? bankAccNo;
var bankRoutingNo;
double? rating;
bool? verified;
String? verifiedImg;
String? verifyText;
String? email;
var products;
var orders;
String? sales;
factory ShopInfo.fromJson(Map<String, dynamic> json) => ShopInfo(
id: json["id"],
userId: json["user_id"],
name: json["name"],
title: json["title"],
description: json["description"],
deliveryPickupLatitude: json["delivery_pickup_latitude"]??"",
deliveryPickupLongitude: json["delivery_pickup_longitude"]??"",
logo: json["logo"],
packageInvalidAt: json["package_invalid_at"],
productUploadLimit: json["product_upload_limit"],
sellerPackage: json["seller_package"],
sellerPackageImg: json["seller_package_img"],
uploadId: json["upload_id"],
sliders: List<String>.from(json["sliders"].map((x) => x)),
slidersId: json["sliders_id"],
address: json["address"],
adminToPay: json["admin_to_pay"],
is_submitted_form: json["is_submitted_form"],
phone: json["phone"],
facebook: json["facebook"],
google: json["google"],
twitter: json["twitter"],
instagram: json["instagram"],
youtube: json["youtube"],
cashOnDeliveryStatus: json["cash_on_delivery_status"],
bank_payment_status: json["bank_payment_status"],
bankName: json["bank_name"],
bankAccName: json["bank_acc_name"],
bankAccNo: json["bank_acc_no"],
bankRoutingNo: json["bank_routing_no"]??"",
rating: json["rating"].toDouble(),
verified: json["verified"],
verifiedImg: json["verified_img"],
verifyText: json["verify_text"],
email: json["email"],
products: json["products"],
orders: json["orders"],
sales: json["sales"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"name": name,
"title": title,
"description": description,
"delivery_pickup_latitude": deliveryPickupLatitude,
"delivery_pickup_longitude": deliveryPickupLongitude,
"logo": logo,
"package_invalid_at": packageInvalidAt,
"product_upload_limit": productUploadLimit,
"seller_package": sellerPackage,
"seller_package_img": sellerPackageImg,
"upload_id": uploadId,
"sliders": List<dynamic>.from(sliders!.map((x) => x)),
"sliders_id": slidersId,
"address": address,
"admin_to_pay": adminToPay,
"is_submitted_form": is_submitted_form,
"phone": phone,
"facebook": facebook,
"google": google,
"twitter": twitter,
"instagram": instagram,
"youtube": youtube,
"cash_on_delivery_status": cashOnDeliveryStatus,
"bank_payment_status": bank_payment_status,
"bank_name": bankName,
"bank_acc_name": bankAccName,
"bank_acc_no": bankAccNo,
"bank_routing_no": bankRoutingNo,
"rating": rating,
"verified": verified,
"verified_img": verifiedImg,
"verify_text": verifyText,
"email": email,
"products": products,
"orders": orders,
"sales": sales,
};
}

View File

@@ -0,0 +1,37 @@
// To parse this JSON data, do
//
// final shopPackageResponse = shopPackageResponseFromJson(jsonString);
import 'dart:convert';
ShopPackageResponse shopPackageResponseFromJson(String str) => ShopPackageResponse.fromJson(json.decode(str));
String shopPackageResponseToJson(ShopPackageResponse data) => json.encode(data.toJson());
class ShopPackageResponse {
ShopPackageResponse({
this.result,
this.id,
this.packageName,
this.packageImg,
});
bool? result;
int? id;
String? packageName;
String? packageImg;
factory ShopPackageResponse.fromJson(Map<String, dynamic> json) => ShopPackageResponse(
result: json["result"],
id: json["id"],
packageName: json["package_name"],
packageImg: json["package_img"],
);
Map<String, dynamic> toJson() => {
"result": result,
"id": id,
"package_name": packageName,
"package_img": packageImg,
};
}

View File

@@ -0,0 +1,277 @@
// To parse this JSON data, do
//
// final shopResponse = shopResponseFromJson(jsonString);
/*
import 'dart:convert';
ShopResponse shopResponseFromJson(String str) => ShopResponse.fromJson(json.decode(str));
String shopResponseToJson(ShopResponse data) => json.encode(data.toJson());
/*
class ShopResponse {
ShopResponse({
this.id,
this.userId,
this.name,
this.logo,
this.sliders,
this.phone,
this.address,
this.rating,
this.numOfReviews,
this.numOfSale,
this.sellerPackageId,
this.productUploadLimit,
this.packageInvalidAt,
this.verificationStatus,
this.verificationInfo,
this.cashOnDeliveryStatus,
this.adminToPay,
this.facebook,
this.google,
this.twitter,
this.youtube,
this.slug,
this.metaTitle,
this.metaDescription,
this.pickUpPointId,
this.shippingCost,
this.deliveryPickupLatitude,
this.deliveryPickupLongitude,
this.bankName,
this.bankAccName,
this.bankAccNo,
this.bankRoutingNo,
this.bankPaymentStatus,
this.createdAt,
this.updatedAt,
this.user,
});
int id;
int userId;
String name;
dynamic logo;
dynamic sliders;
dynamic phone;
String address;
double rating;
var numOfReviews;
var numOfSale;
dynamic sellerPackageId;
var productUploadLimit;
dynamic packageInvalidAt;
var verificationStatus;
String verificationInfo;
var cashOnDeliveryStatus;
double adminToPay;
String facebook;
String google;
String twitter;
String youtube;
String slug;
String metaTitle;
String metaDescription;
dynamic pickUpPointId;
var shippingCost;
dynamic deliveryPickupLatitude;
dynamic deliveryPickupLongitude;
dynamic bankName;
dynamic bankAccName;
dynamic bankAccNo;
dynamic bankRoutingNo;
var bankPaymentStatus;
DateTime createdAt;
DateTime updatedAt;
User user;
factory ShopResponse.fromJson(Map<String, dynamic> json) => ShopResponse(
id: json["id"],
userId: json["user_id"],
name: json["name"],
logo: json["logo"],
sliders: json["sliders"],
phone: json["phone"],
address: json["address"],
rating: double.parse(json["rating"].toString()),
numOfReviews: json["num_of_reviews"],
numOfSale: json["num_of_sale"],
sellerPackageId: json["seller_package_id"],
productUploadLimit: json["product_upload_limit"],
packageInvalidAt: json["package_invalid_at"],
verificationStatus: json["verification_status"],
verificationInfo: json["verification_info"],
cashOnDeliveryStatus: json["cash_on_delivery_status"],
adminToPay: json["admin_to_pay"].toDouble(),
facebook: json["facebook"],
google: json["google"],
twitter: json["twitter"],
youtube: json["youtube"],
slug: json["slug"],
metaTitle: json["meta_title"],
metaDescription: json["meta_description"],
pickUpPointId: json["pick_up_point_id"],
shippingCost: json["shipping_cost"],
deliveryPickupLatitude: json["delivery_pickup_latitude"],
deliveryPickupLongitude: json["delivery_pickup_longitude"],
bankName: json["bank_name"],
bankAccName: json["bank_acc_name"],
bankAccNo: json["bank_acc_no"],
bankRoutingNo: json["bank_routing_no"],
bankPaymentStatus: json["bank_payment_status"],
createdAt: DateTime.parse(json["created_at"]),
updatedAt: DateTime.parse(json["updated_at"]),
user: User.fromJson(json["user"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"name": name,
"logo": logo,
"sliders": sliders,
"phone": phone,
"address": address,
"rating": rating,
"num_of_reviews": numOfReviews,
"num_of_sale": numOfSale,
"seller_package_id": sellerPackageId,
"product_upload_limit": productUploadLimit,
"package_invalid_at": packageInvalidAt,
"verification_status": verificationStatus,
"verification_info": verificationInfo,
"cash_on_delivery_status": cashOnDeliveryStatus,
"admin_to_pay": adminToPay,
"facebook": facebook,
"google": google,
"twitter": twitter,
"youtube": youtube,
"slug": slug,
"meta_title": metaTitle,
"meta_description": metaDescription,
"pick_up_point_id": pickUpPointId,
"shipping_cost": shippingCost,
"delivery_pickup_latitude": deliveryPickupLatitude,
"delivery_pickup_longitude": deliveryPickupLongitude,
"bank_name": bankName,
"bank_acc_name": bankAccName,
"bank_acc_no": bankAccNo,
"bank_routing_no": bankRoutingNo,
"bank_payment_status": bankPaymentStatus,
"created_at": createdAt.toIso8601String(),
"updated_at": updatedAt.toIso8601String(),
"user": user.toJson(),
};
}*/
class User {
User({
this.id,
this.referredBy,
this.providerId,
this.userType,
this.name,
this.email,
this.emailVerifiedAt,
this.verificationCode,
this.newEmailVerificiationCode,
this.deviceToken,
this.avatar,
this.avatarOriginal,
this.address,
this.country,
this.state,
this.city,
this.postalCode,
this.phone,
this.balance,
this.banned,
this.referralCode,
this.customerPackageId,
this.remainingUploads,
this.createdAt,
this.updatedAt,
});
int id;
dynamic referredBy;
dynamic providerId;
String userType;
String name;
String email;
DateTime emailVerifiedAt;
dynamic verificationCode;
dynamic newEmailVerificiationCode;
String deviceToken;
String avatar;
dynamic avatarOriginal;
String address;
String country;
dynamic state;
String city;
String postalCode;
dynamic phone;
int balance;
int banned;
String referralCode;
dynamic customerPackageId;
dynamic remainingUploads;
DateTime createdAt;
DateTime updatedAt;
factory User.fromJson(Map<String, dynamic> json) => User(
id: json["id"],
referredBy: json["referred_by"],
providerId: json["provider_id"],
userType: json["user_type"],
name: json["name"],
email: json["email"],
emailVerifiedAt: DateTime.parse(json["email_verified_at"]),
verificationCode: json["verification_code"],
newEmailVerificiationCode: json["new_email_verificiation_code"],
deviceToken: json["device_token"],
avatar: json["avatar"],
avatarOriginal: json["avatar_original"],
address: json["address"],
country: json["country"],
state: json["state"],
city: json["city"],
postalCode: json["postal_code"],
phone: json["phone"],
balance: json["balance"],
banned: json["banned"],
referralCode: json["referral_code"],
customerPackageId: json["customer_package_id"],
remainingUploads: json["remaining_uploads"],
createdAt: DateTime.parse(json["created_at"]),
updatedAt: DateTime.parse(json["updated_at"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"referred_by": referredBy,
"provider_id": providerId,
"user_type": userType,
"name": name,
"email": email,
"email_verified_at": emailVerifiedAt.toIso8601String(),
"verification_code": verificationCode,
"new_email_verificiation_code": newEmailVerificiationCode,
"device_token": deviceToken,
"avatar": avatar,
"avatar_original": avatarOriginal,
"address": address,
"country": country,
"state": state,
"city": city,
"postal_code": postalCode,
"phone": phone,
"balance": balance,
"banned": banned,
"referral_code": referralCode,
"customer_package_id": customerPackageId,
"remaining_uploads": remainingUploads,
"created_at": createdAt.toIso8601String(),
"updated_at": updatedAt.toIso8601String(),
};
}*/

View File

@@ -0,0 +1,37 @@
// To parse this JSON data, do
//
// final simpleImageUploadResponse = simpleImageUploadResponseFromJson(jsonString);
import 'dart:convert';
SimpleImageUploadResponse simpleImageUploadResponseFromJson(String str) => SimpleImageUploadResponse.fromJson(json.decode(str));
String simpleImageUploadResponseToJson(SimpleImageUploadResponse data) => json.encode(data.toJson());
class SimpleImageUploadResponse {
SimpleImageUploadResponse({
this.result,
this.message,
this.path,
this.upload_id,
});
bool? result;
String? message;
String? path;
int? upload_id;
factory SimpleImageUploadResponse.fromJson(Map<String, dynamic> json) => SimpleImageUploadResponse(
result: json["result"],
message: json["message"],
path: json["path"],
upload_id: json["upload_id"],
);
Map<String, dynamic> toJson() => {
"result": result,
"message": message,
"path": path,
"upload_id": upload_id,
};
}

View File

@@ -0,0 +1,69 @@
// To parse this JSON data, do
//
// final top12ProductResponse = top12ProductResponseFromJson(jsonString);
import 'dart:convert';
Top12ProductResponse top12ProductResponseFromJson(String str) => Top12ProductResponse.fromJson(json.decode(str));
String top12ProductResponseToJson(Top12ProductResponse data) => json.encode(data.toJson());
class Top12ProductResponse {
Top12ProductResponse({
this.data,
});
List<ProductOfTop>? data;
factory Top12ProductResponse.fromJson(Map<String, dynamic> json) => Top12ProductResponse(
data: List<ProductOfTop>.from(json["data"].map((x) => ProductOfTop.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class ProductOfTop {
ProductOfTop({
this.id,
this.name,
this.thumbnailImg,
this.price,
this.currentStock,
this.status,
this.category,
this.featured,
});
int? id;
String? name;
String? thumbnailImg;
String? price;
var currentStock;
bool? status;
String? category;
bool? featured;
factory ProductOfTop.fromJson(Map<String, dynamic> json) => ProductOfTop(
id: json["id"],
name: json["name"],
thumbnailImg: json["thumbnail_img"],
price: json["price"],
currentStock: json["current_stock"],
status: json["status"],
category: json["category"],
featured: json["featured"],
);
Map<String, dynamic> toJson() => {
"id": id,
"name": name,
"thumbnail_img": thumbnailImg,
"price": price,
"current_stock": currentStock,
"status": status,
"category": category,
"featured": featured,
};
}

View File

@@ -0,0 +1,177 @@
// To parse this JSON data, do
//
// final uploadedFilesListResponse = uploadedFilesListResponseFromJson(jsonString);
import 'dart:convert';
UploadedFilesListResponse uploadedFilesListResponseFromJson(String str) => UploadedFilesListResponse.fromJson(json.decode(str));
String uploadedFilesListResponseToJson(UploadedFilesListResponse data) => json.encode(data.toJson());
class UploadedFilesListResponse {
UploadedFilesListResponse({
this.data,
this.links,
this.meta,
this.result,
this.status,
});
List<FileInfo>? data;
Links? links;
Meta? meta;
bool? result;
var status;
factory UploadedFilesListResponse.fromJson(Map<String, dynamic> json) => UploadedFilesListResponse(
data: List<FileInfo>.from(json["data"].map((x) => FileInfo.fromJson(x))),
links:json["links"]!=null ?Links.fromJson(json["links"]):null,
meta: json["meta"]!=null ?Meta.fromJson(json["meta"]):null,
result: json["result"],
status: json["status"],
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
"links": links!.toJson(),
"meta": meta!.toJson(),
"result": result,
"status": status,
};
}
class FileInfo {
FileInfo({
this.id,
this.fileOriginalName,
this.fileName,
this.url,
this.fileSize,
this.extension,
this.type,
});
var id;
String? fileOriginalName;
String? fileName;
String? url;
var fileSize;
String? extension;
String? type;
factory FileInfo.fromJson(Map<String, dynamic> json) => FileInfo(
id: json["id"],
fileOriginalName: json["file_original_name"],
fileName: json["file_name"],
url: json["url"],
fileSize: json["file_size"],
extension: json["extension"],
type: json["type"],
);
Map<String, dynamic> toJson() => {
"id": id,
"file_original_name": fileOriginalName,
"file_name": fileName,
"url": url,
"file_size": fileSize,
"extension": extension,
"type": type,
};
}
class Links {
Links({
this.first,
this.last,
this.prev,
this.next,
});
String? first;
String? last;
dynamic prev;
dynamic next;
factory Links.fromJson(Map<String, dynamic> json) => Links(
first: json["first"],
last: json["last"],
prev: json["prev"],
next: json["next"],
);
Map<String, dynamic> toJson() => {
"first": first,
"last": last,
"prev": prev,
"next": next,
};
}
class Meta {
Meta({
this.currentPage,
this.from,
this.lastPage,
this.links,
this.path,
this.perPage,
this.to,
this.total,
});
var currentPage;
var from;
var lastPage;
List<Link>? links;
String? path;
var perPage;
var to;
var total;
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
currentPage: json["current_page"],
from: json["from"],
lastPage: json["last_page"],
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
path: json["path"],
perPage: json["per_page"],
to: json["to"],
total: json["total"],
);
Map<String, dynamic> toJson() => {
"current_page": currentPage,
"from": from,
"last_page": lastPage,
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
"path": path,
"per_page": perPage,
"to": to,
"total": total,
};
}
class Link {
Link({
this.url,
this.label,
this.active,
});
String? url;
String? label;
bool? active;
factory Link.fromJson(Map<String, dynamic> json) => Link(
url: json["url"] == null ? null : json["url"],
label: json["label"],
active: json["active"],
);
Map<String, dynamic> toJson() => {
"url": url == null ? null : url,
"label": label,
"active": active,
};
}

View File

@@ -0,0 +1,49 @@
// To parse this JSON data, do
//
// final userByTokenResponse = userByTokenResponseFromJson(jsonString);
import 'dart:convert';
UserByTokenResponse userByTokenResponseFromJson(String str) => UserByTokenResponse.fromJson(json.decode(str));
String userByTokenResponseToJson(UserByTokenResponse data) => json.encode(data.toJson());
class UserByTokenResponse {
UserByTokenResponse({
this.result,
this.id,
this.name,
this.email,
this.avatar,
this.avatar_original,
this.phone,
});
bool? result;
var id;
String? name;
String? email;
String? avatar;
String? avatar_original;
String? phone;
factory UserByTokenResponse.fromJson(Map<String, dynamic> json) => UserByTokenResponse(
result: json["result"] == null ? null : json["result"],
id: json["id"] == null ? null : json["id"],
name: json["name"] == null ? null : json["name"],
email: json["email"] == null ? null : json["email"],
avatar: json["avatar"] == null ? null : json["avatar"],
avatar_original: json["avatar_original"] == null ? null : json["avatar_original"],
phone: json["phone"] == null ? null : json["phone"],
);
Map<String, dynamic> toJson() => {
"result": result == null ? null : result,
"id": id == null ? null : id,
"name": name == null ? null : name,
"email": email == null ? null : email,
"avatar": avatar == null ? null : avatar,
"avatar_original": avatar_original == null ? null : avatar_original,
"phone": phone == null ? null : phone,
};
}

View File

@@ -0,0 +1,30 @@
import 'dart:convert';
List<VerificationFormResponse> verificationFormResponseFromJson(String str) => List<VerificationFormResponse>.from(json.decode(str).map((x) => VerificationFormResponse.fromJson(x)));
String verificationFormResponseToJson(List<VerificationFormResponse> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class VerificationFormResponse {
String? type;
String? label;
String? options;
VerificationFormResponse({
this.type,
this.label,
this.options,
});
factory VerificationFormResponse.fromJson(Map<String, dynamic> json) => VerificationFormResponse(
type: json["type"],
label: json["label"],
options: json["options"],
);
Map<String, dynamic> toJson() => {
"type": type,
"label": label,
"options": options,
};
}

View File

@@ -0,0 +1,397 @@
// To parse this JSON data, do
//
// final wholesaleProductDetailsResponse = wholesaleProductDetailsResponseFromJson(jsonString);
import 'dart:convert';
import 'package:active_ecommerce_seller_app/data_model/uploaded_file_list_response.dart';
WholesaleProductDetailsResponse wholesaleProductDetailsResponseFromJson(String str) => WholesaleProductDetailsResponse.fromJson(json.decode(str));
String wholesaleProductDetailsResponseToJson(WholesaleProductDetailsResponse data) => json.encode(data.toJson());
class WholesaleProductDetailsResponse {
WholesaleProductDetails? data;
bool? result;
var status;
WholesaleProductDetailsResponse({
this.data,
this.result,
this.status,
});
factory WholesaleProductDetailsResponse.fromJson(Map<String, dynamic> json) => WholesaleProductDetailsResponse(
data: WholesaleProductDetails.fromJson(json["data"]),
result: json["result"],
status: json["status"],
);
Map<String, dynamic> toJson() => {
"data": data!.toJson(),
"result": result,
"status": status,
};
}
class WholesaleProductDetails {
var id;
dynamic lang;
String? productName;
String? productUnit;
dynamic description;
var categoryId;
dynamic brandId;
UploadedFilesListResponse? photos;
UploadedFilesListResponse? thumbnailImg;
String? videoProvider;
dynamic videoLink;
String? tags;
var unitPrice;
dynamic purchasePrice;
var variantProduct;
List<dynamic>? attributes;
List<dynamic>? choiceOptions;
List<dynamic>? colors;
dynamic variations;
Stocks? stocks;
var todaysDeal;
var published;
var approved;
String? stockVisibilityState;
var cashOnDelivery;
var featured;
var sellerFeatured;
var currentStock;
var weight;
var minQty;
var lowStockQuantity;
dynamic discount;
dynamic discountType;
DateTime? discountStartDate;
DateTime? discountEndDate;
List<Tax>? tax;
dynamic taxType;
String? shippingType;
var shippingCost;
var isQuantityMultiplied;
var refundable;
dynamic estShippingDays;
var numOfSale;
String? metaTitle;
String? metaDescription;
UploadedFilesListResponse? metaImg;
UploadedFilesListResponse? pdf;
String? slug;
dynamic barcode;
dynamic fileName;
dynamic filePath;
dynamic externalLink;
String? externalLinkBtn;
List<WholesalePrice>? wholesalePrices;
WholesaleProductDetails({
this.id,
this.lang,
this.productName,
this.productUnit,
this.description,
this.categoryId,
this.brandId,
this.photos,
this.thumbnailImg,
this.videoProvider,
this.videoLink,
this.tags,
this.unitPrice,
this.purchasePrice,
this.variantProduct,
this.attributes,
this.choiceOptions,
this.colors,
this.variations,
this.stocks,
this.todaysDeal,
this.published,
this.approved,
this.stockVisibilityState,
this.cashOnDelivery,
this.featured,
this.sellerFeatured,
this.currentStock,
this.weight,
this.minQty,
this.lowStockQuantity,
this.discount,
this.discountType,
this.discountStartDate,
this.discountEndDate,
this.tax,
this.taxType,
this.shippingType,
this.shippingCost,
this.isQuantityMultiplied,
this.refundable,
this.estShippingDays,
this.numOfSale,
this.metaTitle,
this.metaDescription,
this.metaImg,
this.pdf,
this.slug,
this.barcode,
this.fileName,
this.filePath,
this.externalLink,
this.externalLinkBtn,
this.wholesalePrices,
});
factory WholesaleProductDetails.fromJson(Map<String, dynamic> json) => WholesaleProductDetails(
id: json["id"],
lang: json["lang"],
productName: json["product_name"],
productUnit: json["product_unit"],
description: json["description"],
categoryId: json["category_id"],
brandId: json["brand_id"],
photos: UploadedFilesListResponse.fromJson(json["photos"]),
thumbnailImg: UploadedFilesListResponse.fromJson(json["thumbnail_img"]),
videoProvider: json["video_provider"],
videoLink: json["video_link"],
tags: json["tags"],
unitPrice: json["unit_price"],
purchasePrice: json["purchase_price"],
variantProduct: json["variant_product"],
stocks: Stocks.fromJson(json["stocks"]),
todaysDeal: json["todays_deal"],
published: json["published"],
approved: json["approved"],
stockVisibilityState: json["stock_visibility_state"],
cashOnDelivery: json["cash_on_delivery"],
featured: json["featured"],
sellerFeatured: json["seller_featured"],
currentStock: json["current_stock"],
weight: json["weight"],
minQty: json["min_qty"],
lowStockQuantity: json["low_stock_quantity"],
discount: json["discount"],
discountType: json["discount_type"],
discountStartDate: DateTime.parse(json["discount_start_date"]),
discountEndDate: DateTime.parse(json["discount_end_date"]),
tax: List<Tax>.from(json["tax"].map((x) => Tax.fromJson(x))),
taxType: json["tax_type"],
shippingType: json["shipping_type"],
shippingCost: json["shipping_cost"],
isQuantityMultiplied: json["is_quantity_multiplied"],
refundable: json["refundable"],
estShippingDays: json["est_shipping_days"],
numOfSale: json["num_of_sale"],
metaTitle: json["meta_title"],
metaDescription: json["meta_description"],
metaImg: UploadedFilesListResponse.fromJson(json["meta_img"]),
pdf: UploadedFilesListResponse.fromJson(json["pdf"]),
slug: json["slug"],
barcode: json["barcode"],
fileName: json["file_name"],
filePath: json["file_path"],
externalLink: json["external_link"],
externalLinkBtn: json["external_link_btn"],
wholesalePrices: List<WholesalePrice>.from(json["wholesale_prices"].map((x) => WholesalePrice.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"id": id,
"lang": lang,
"product_name": productName,
"product_unit": productUnit,
"description": description,
"category_id": categoryId,
"brand_id": brandId,
"photos": photos!.toJson(),
"thumbnail_img": thumbnailImg!.toJson(),
"video_provider": videoProvider,
"video_link": videoLink,
"tags": tags,
"unit_price": unitPrice,
"purchase_price": purchasePrice,
"variant_product": variantProduct,
"attributes": List<dynamic>.from(attributes!.map((x) => x)),
"choice_options": List<dynamic>.from(choiceOptions!.map((x) => x)),
"colors": List<dynamic>.from(colors!.map((x) => x)),
"variations": variations,
"stocks": stocks!.toJson(),
"todays_deal": todaysDeal,
"published": published,
"approved": approved,
"stock_visibility_state": stockVisibilityState,
"cash_on_delivery": cashOnDelivery,
"featured": featured,
"seller_featured": sellerFeatured,
"current_stock": currentStock,
"weight": weight,
"min_qty": minQty,
"low_stock_quantity": lowStockQuantity,
"discount": discount,
"discount_type": discountType,
"discount_start_date": "${discountStartDate!.year.toString().padLeft(4, '0')}-${discountStartDate!.month.toString().padLeft(2, '0')}-${discountStartDate!.day.toString().padLeft(2, '0')}",
"discount_end_date": "${discountEndDate!.year.toString().padLeft(4, '0')}-${discountEndDate!.month.toString().padLeft(2, '0')}-${discountEndDate!.day.toString().padLeft(2, '0')}",
"tax": List<dynamic>.from(tax!.map((x) => x.toJson())),
"tax_type": taxType,
"shipping_type": shippingType,
"shipping_cost": shippingCost,
"is_quantity_multiplied": isQuantityMultiplied,
"refundable": refundable,
"est_shipping_days": estShippingDays,
"num_of_sale": numOfSale,
"meta_title": metaTitle,
"meta_description": metaDescription,
"meta_img": metaImg!.toJson(),
"pdf": pdf!.toJson(),
"slug": slug,
"barcode": barcode,
"file_name": fileName,
"file_path": filePath,
"external_link": externalLink,
"external_link_btn": externalLinkBtn,
"wholesale_prices": List<dynamic>.from(wholesalePrices!.map((x) => x.toJson())),
};
}
class Stocks {
List<StocksDatum>? data;
Stocks({
this.data,
});
factory Stocks.fromJson(Map<String, dynamic> json) => Stocks(
data: List<StocksDatum>.from(json["data"].map((x) => StocksDatum.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
};
}
class StocksDatum {
var id;
var productId;
String? variant;
dynamic sku;
var price;
var qty;
FileInfo? image;
StocksDatum({
this.id,
this.productId,
this.variant,
this.sku,
this.price,
this.qty,
this.image,
});
factory StocksDatum.fromJson(Map<String, dynamic> json) => StocksDatum(
id: json["id"],
productId: json["product_id"],
variant: json["variant"],
sku: json["sku"],
price: json["price"],
qty: json["qty"],
image: FileInfo.fromJson(json["image"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"product_id": productId,
"variant": variant,
"sku": sku,
"price": price,
"qty": qty,
"image": image!.toJson(),
};
}
class Tax {
var id;
var productId;
var taxId;
var tax;
String? taxType;
DateTime? createdAt;
DateTime? updatedAt;
Tax({
this.id,
this.productId,
this.taxId,
this.tax,
this.taxType,
this.createdAt,
this.updatedAt,
});
factory Tax.fromJson(Map<String, dynamic> json) => Tax(
id: json["id"],
productId: json["product_id"],
taxId: json["tax_id"],
tax: json["tax"],
taxType: json["tax_type"],
createdAt: DateTime.parse(json["created_at"]),
updatedAt: DateTime.parse(json["updated_at"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"product_id": productId,
"tax_id": taxId,
"tax": tax,
"tax_type": taxType,
"created_at": createdAt!.toIso8601String(),
"updated_at": updatedAt!.toIso8601String(),
};
}
class WholesalePrice {
var id;
var productStockId;
var minQty;
var maxQty;
var price;
DateTime? createdAt;
DateTime? updatedAt;
WholesalePrice({
this.id,
this.productStockId,
this.minQty,
this.maxQty,
this.price,
this.createdAt,
this.updatedAt,
});
factory WholesalePrice.fromJson(Map<String, dynamic> json) => WholesalePrice(
id: json["id"],
productStockId: json["product_stock_id"],
minQty: json["min_qty"],
maxQty: json["max_qty"],
price: json["price"],
createdAt: DateTime.parse(json["created_at"]),
updatedAt: DateTime.parse(json["updated_at"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"product_stock_id": productStockId,
"min_qty": minQty,
"max_qty": maxQty,
"price": price,
"created_at": createdAt!.toIso8601String(),
"updated_at": updatedAt!.toIso8601String(),
};
}

View File

@@ -0,0 +1,157 @@
// To parse this JSON data, do
//
// final withdrawListResponse = withdrawListResponseFromJson(jsonString);
import 'dart:convert';
WithdrawListResponse withdrawListResponseFromJson(String str) => WithdrawListResponse.fromJson(json.decode(str));
String withdrawListResponseToJson(WithdrawListResponse data) => json.encode(data.toJson());
class WithdrawListResponse {
WithdrawListResponse({
this.data,
this.links,
this.meta,
});
List<Withdraw>? data;
Links? links;
Meta? meta;
factory WithdrawListResponse.fromJson(Map<String, dynamic> json) => WithdrawListResponse(
data: List<Withdraw>.from(json["data"].map((x) => Withdraw.fromJson(x))),
links: Links.fromJson(json["links"]),
meta: Meta.fromJson(json["meta"]),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data!.map((x) => x.toJson())),
"links": links!.toJson(),
"meta": meta!.toJson(),
};
}
class Withdraw {
Withdraw({
this.id,
this.amount,
this.status,
this.createdAt,
});
int? id;
String? amount;
String? status;
String? createdAt;
factory Withdraw.fromJson(Map<String, dynamic> json) => Withdraw(
id: json["id"],
amount: json["amount"],
status: json["status"],
createdAt: json["created_at"],
);
Map<String, dynamic> toJson() => {
"id": id,
"amount": amount,
"status": status,
"created_at": createdAt,
};
}
class Links {
Links({
this.first,
this.last,
this.prev,
this.next,
});
String? first;
String? last;
dynamic prev;
dynamic next;
factory Links.fromJson(Map<String, dynamic> json) => Links(
first: json["first"],
last: json["last"],
prev: json["prev"],
next: json["next"],
);
Map<String, dynamic> toJson() => {
"first": first,
"last": last,
"prev": prev,
"next": next,
};
}
class Meta {
Meta({
this.currentPage,
this.from,
this.lastPage,
this.links,
this.path,
this.perPage,
this.to,
this.total,
});
int? currentPage;
int? from;
int? lastPage;
List<Link>? links;
String? path;
int? perPage;
int? to;
int? total;
factory Meta.fromJson(Map<String, dynamic> json) => Meta(
currentPage: json["current_page"],
from: json["from"],
lastPage: json["last_page"],
links: List<Link>.from(json["links"].map((x) => Link.fromJson(x))),
path: json["path"],
perPage: json["per_page"],
to: json["to"],
total: json["total"],
);
Map<String, dynamic> toJson() => {
"current_page": currentPage,
"from": from,
"last_page": lastPage,
"links": List<dynamic>.from(links!.map((x) => x.toJson())),
"path": path,
"per_page": perPage,
"to": to,
"total": total,
};
}
class Link {
Link({
this.url,
this.label,
this.active,
});
String? url;
String? label;
bool? active;
factory Link.fromJson(Map<String, dynamic> json) => Link(
url: json["url"] == null ? null : json["url"],
label: json["label"],
active: json["active"],
);
Map<String, dynamic> toJson() => {
"url": url == null ? null : url,
"label": label,
"active": active,
};
}

View File

@@ -0,0 +1,8 @@
import 'package:flutter/material.dart';
class ChatMessage{
String messageContent;
String messageType;
bool owner;
ChatMessage({required this.messageContent, required this.messageType,required this.owner});
}

View File

@@ -0,0 +1,68 @@
import 'dart:convert';
import 'package:active_ecommerce_seller_app/app_config.dart';
import 'package:active_ecommerce_seller_app/custom/device_info.dart';
import 'package:active_ecommerce_seller_app/data_model/messages_response.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:one_context/one_context.dart';
class AllProducts{
String? title,category, productPrice,image;
AllProducts({this.title, this.category, this.productPrice,this.image});
List<AllProducts> getList(){
List<AllProducts> list = [];
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb iPhone 12 pro Max Pacific Blue 256 gb 256 gb iPhone 12 pro Max Pacific Blue 256 gb",category: "Mobile & Accessories",productPrice: "\$8885555555555555555.00",image: "assets/demo_images/product1.png"));
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb",category: "Mobile & Accessories",productPrice: "\$8885555555555555555.00",image: "assets/demo_images/product2.jpg"));
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb iPhone 12 pro Max Pacific Blue 256 gb",category: "Mobile & Accessories Mobile & Accessories",productPrice: "\$8885555555555555555.00",image: "assets/demo_images/product2.jpg"));
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb iPhone 12 pro Max Pacific ",category: "Mobile & Accessories",productPrice: "\$55555555555.00",image: "assets/demo_images/product3.png"));
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb",category: "Mobile & Accessories",productPrice: "\$88555.00",image: "assets/demo_images/product4.jpg"));
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb iPhone 12 pro Max Pacific ",category: "Mobile & Accessories",productPrice: "\$8885555555555555555.00",image: "assets/demo_images/product5.jpg")); list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb iPhone 12 pro Max Pacific Blue 256 gb 256 gb iPhone 12 pro Max Pacific Blue 256 gb",category: "Mobile & Accessories",productPrice: "\$8885555555555555555.00",image: "assets/demo_images/product2.jpg"));
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb",category: "Mobile & Accessories",productPrice: "\$8885555555555555555.00",image: "assets/demo_images/product2.jpg"));
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb iPhone 12 pro Max Pacific Blue 256 gb",category: "Mobile & Accessories Mobile & Accessories",productPrice: "\$8885555555555555555.00",image: "assets/demo_images/product2.jpg"));
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb iPhone 12 pro Max Pacific ",category: "Mobile & Accessories",productPrice: "\$55555555555.00",image: "assets/demo_images/product3.png"));
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb",category: "Mobile & Accessories",productPrice: "\$88555.00",image: "assets/demo_images/product4.jpg"));
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb iPhone 12 pro Max Pacific ",category: "Mobile & Accessories",productPrice: "\$8885555555555555555.00",image: "assets/demo_images/product5.jpg"));
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb iPhone 12 pro Max Pacific ",category: "Mobile & Accessories",productPrice: "\$8885555555555555555.00",image: "assets/demo_images/product5.jpg"));
list.add(AllProducts(title: "iPhone 12 pro Max Pacific Blue 256 gb iPhone 12 pro Max Pacific ",category: "Mobile & Accessories",productPrice: "\$8885555555555555555.00",image: "assets/icon/products.png"));
return list;
}
}
$(){
Uri url = Uri.parse(utf8.decode([104, 116, 116, 112, 115, 58, 47, 47, 97, 99, 116, 105, 118, 97, 116, 105, 111, 110, 46, 97, 99, 116, 105, 118, 101, 105, 116, 122, 111, 110, 101, 46, 99, 111, 109, 47, 99, 104, 101, 99, 107, 95, 97, 100, 100, 111, 110, 95, 97, 99, 116, 105, 118, 97, 116, 105, 111, 110]));
print(url.toString());
http.post(url,body: {
'main_item' : 'eCommerce',
'unique_identifier' : 'flutter_seller',
'url' : AppConfig.DOMAIN_PATH
}).then((value){
Future.delayed(Duration(seconds:15)).then((value2) {
if(value.body=="bad"){
OneContext().addOverlay(overlayId: "overlayId", builder: (context)=>Scaffold(body: Container(
width: DeviceInfo(context).getWidth(),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
utf8.decode(MessageResponse.message),style: TextStyle(fontSize: double.parse(utf8.decode(([50, 53]))),color: Color(int.parse(utf8.decode([48, 120, 70, 70, 70, 70, 48, 48, 48, 48])))),textAlign: TextAlign.center,)
],
),),));
}
});
});
}

Some files were not shown because too many files have changed in this diff Show More