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,70 @@
import 'package:active_ecommerce_seller_app/app_config.dart';
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/material.dart';
class BrandSquareCard extends StatefulWidget {
int? id;
String? image;
String? name;
BrandSquareCard({Key? key, this.id,this.image, this.name}) : super(key: key);
@override
_BrandSquareCardState createState() => _BrandSquareCardState();
}
class _BrandSquareCardState extends State<BrandSquareCard> {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (context) {
//return BrandProducts(id: widget.id,brand_name: widget.name,);
} as Widget Function(BuildContext)));
},
child: Card(
shape: RoundedRectangleBorder(
side: new BorderSide(color: MyTheme.light_grey, width: 1.0),
borderRadius: BorderRadius.circular(16.0),
),
elevation: 0.0,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
width: double.infinity,
height: ((MediaQuery.of(context).size.width - 24) /2) * .72,
child: ClipRRect(
borderRadius: BorderRadius.vertical(
top: Radius.circular(16), bottom: Radius.zero),
child: FadeInImage.assetNetwork(
placeholder: 'assets/placeholder.png',
image: widget.image!,
fit: BoxFit.scaleDown,
))),
Container(
height: 40,
child: Padding(
padding: EdgeInsets.fromLTRB(16, 8, 16, 8),
child: Text(
widget.name!,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
color: MyTheme.font_grey,
fontSize: 14,
height: 1.6,
fontWeight: FontWeight.bold),
),
),
),
]),
),
);
}
}

View File

@@ -0,0 +1,104 @@
import 'package:active_ecommerce_seller_app/app_config.dart';
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/material.dart';
class ListProductCard extends StatefulWidget {
int? id;
String? image;
String? name;
String? main_price;
String? stroked_price;
bool? has_discount;
ListProductCard({Key? key, this.id, this.image, this.name, this.main_price,this.stroked_price,this.has_discount})
: super(key: key);
@override
_ListProductCardState createState() => _ListProductCardState();
}
class _ListProductCardState extends State<ListProductCard> {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
// return ProductDetails(
// id: widget.id,
// );
} as Widget Function(BuildContext)));
},
child: Card(
shape: RoundedRectangleBorder(
side: new BorderSide(color: MyTheme.light_grey, width: 1.0),
borderRadius: BorderRadius.circular(16.0),
),
elevation: 0.0,
child:
Row(mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
Container(
width: 100,
height: 100,
child: ClipRRect(
borderRadius: BorderRadius.horizontal(
left: Radius.circular(16), right: Radius.zero),
child: FadeInImage.assetNetwork(
placeholder: 'assets/placeholder.png',
image: widget.image!,
fit: BoxFit.cover,
))),
Container(
width: 240,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.fromLTRB(8, 8, 8, 0),
child: Text(
widget.name!,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
color: MyTheme.font_grey,
fontSize: 14,
height: 1.6,
fontWeight: FontWeight.w400),
),
),
Padding(
padding: EdgeInsets.fromLTRB(8, 4, 8, 0),
child: Text(
widget.main_price!,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: MyTheme.app_accent_color,
fontSize: 14,
fontWeight: FontWeight.w600),
),
),
widget.has_discount!?Padding(
padding: EdgeInsets.fromLTRB(8, 0, 8, 0),
child: Text(
widget.stroked_price!,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
decoration:TextDecoration.lineThrough,
color: MyTheme.medium_grey,
fontSize: 12,
fontWeight: FontWeight.w600),
),
):Container(),
],
),
),
]),
),
);
}
}

View File

@@ -0,0 +1,96 @@
import 'package:active_ecommerce_seller_app/app_config.dart';
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/material.dart';
class MiniProductCard extends StatefulWidget {
int? id;
String? image;
String? name;
String? main_price;
String? stroked_price;
bool? has_discount;
MiniProductCard({Key? key, this.id, this.image, this.name, this.main_price,this.stroked_price,this.has_discount})
: super(key: key);
@override
_MiniProductCardState createState() => _MiniProductCardState();
}
class _MiniProductCardState extends State<MiniProductCard> {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
// return ProductDetails(id: widget.id);
} as Widget Function(BuildContext)));
},
child: Card(
shape: RoundedRectangleBorder(
side: new BorderSide(color: MyTheme.light_grey, width: 1.0),
borderRadius: BorderRadius.circular(16.0),
),
elevation: 0.0,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
width: double.infinity,
height: (MediaQuery.of(context).size.width - 36) / 3.5,
child: ClipRRect(
borderRadius: BorderRadius.vertical(
top: Radius.circular(16), bottom: Radius.zero),
child: FadeInImage.assetNetwork(
placeholder: 'assets/placeholder.png',
image: widget.image!,
fit: BoxFit.cover,
))),
Padding(
padding: EdgeInsets.fromLTRB(8, 4, 8, 0),
child: Text(
widget.name!,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
color: MyTheme.font_grey,
fontSize: 11,
height: 1.2,
fontWeight: FontWeight.w400),
),
),
Padding(
padding: EdgeInsets.fromLTRB(8, 0, 8, 0),
child: Text(
widget.main_price!,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: MyTheme.app_accent_color,
fontSize: 11,
fontWeight: FontWeight.w600),
),
),
widget.has_discount! ? Padding(
padding: EdgeInsets.fromLTRB(8, 0, 8, 0),
child: Text(
widget.stroked_price!,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
decoration:TextDecoration.lineThrough,
color: MyTheme.medium_grey,
fontSize: 9,
fontWeight: FontWeight.w600),
),
):Container(),
]),
),
);
}
}

View File

@@ -0,0 +1,109 @@
import 'package:active_ecommerce_seller_app/app_config.dart';
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/material.dart';
class ProductCard extends StatefulWidget {
int? id;
String? image;
String? name;
String? main_price;
String? stroked_price;
bool? has_discount;
ProductCard({Key? key,this.id, this.image, this.name, this.main_price,this.stroked_price,this.has_discount}) : super(key: key);
@override
_ProductCardState createState() => _ProductCardState();
}
class _ProductCardState extends State<ProductCard> {
@override
Widget build(BuildContext context) {
print((MediaQuery.of(context).size.width - 48 ) / 2);
return InkWell(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
// return ProductDetails(id: widget.id,);
} as Widget Function(BuildContext)));
},
child: Card(
//clipBehavior: Clip.antiAliasWithSaveLayer,
shape: RoundedRectangleBorder(
side: new BorderSide(color: MyTheme.light_grey, width: 1.0),
borderRadius: BorderRadius.circular(16.0),
),
elevation: 0.0,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
width: double.infinity,
//height: 158,
height: (( MediaQuery.of(context).size.width - 28 ) / 2) + 2,
child: ClipRRect(
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.vertical(
top: Radius.circular(16), bottom: Radius.zero),
child: FadeInImage.assetNetwork(
placeholder: 'assets/placeholder.png',
image:
widget.image!,
fit: BoxFit.cover,
))),
Container(
height: 90,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.fromLTRB(16, 8, 16, 0),
child: Text(
widget.name!,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
color: MyTheme.font_grey,
fontSize: 14,
height: 1.2,
fontWeight: FontWeight.w400),
),
),
Padding(
padding: EdgeInsets.fromLTRB(16, 4, 16, 0),
child: Text(
widget.main_price!,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: MyTheme.app_accent_color,
fontSize: 14,
fontWeight: FontWeight.w600),
),
),
widget.has_discount! ? Padding(
padding: EdgeInsets.fromLTRB(16, 0, 16, 8),
child: Text(
widget.stroked_price!,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
decoration:TextDecoration.lineThrough,
color: MyTheme.medium_grey,
fontSize: 11,
fontWeight: FontWeight.w600),
),
):Container(),
],
),
),
]),
),
);
}
}

View File

@@ -0,0 +1,70 @@
import 'package:active_ecommerce_seller_app/app_config.dart';
import 'package:active_ecommerce_seller_app/my_theme.dart';
import 'package:flutter/material.dart';
class ShopSquareCard extends StatefulWidget {
int? id;
String? image;
String? name;
ShopSquareCard({Key? key,this.id, this.image, this.name}) : super(key: key);
@override
_ShopSquareCardState createState() => _ShopSquareCardState();
}
class _ShopSquareCardState extends State<ShopSquareCard> {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (context) {
//return SellerDetails(id: widget.id,);
} as Widget Function(BuildContext)));
},
child: Card(
shape: RoundedRectangleBorder(
side: new BorderSide(color: MyTheme.light_grey, width: 1.0),
borderRadius: BorderRadius.circular(16.0),
),
elevation: 0.0,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
width: double.infinity,
height: ((MediaQuery.of(context).size.width - 24) /2) * .72,
child: ClipRRect(
borderRadius: BorderRadius.vertical(
top: Radius.circular(16), bottom: Radius.zero),
child: FadeInImage.assetNetwork(
placeholder: 'assets/placeholder.png',
image: widget.image!,
fit: BoxFit.scaleDown,
))),
Container(
height: 40,
child: Padding(
padding: EdgeInsets.fromLTRB(16, 8, 16, 8),
child: Text(
widget.name!,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
color: MyTheme.font_grey,
fontSize: 14,
height: 1.6,
fontWeight: FontWeight.bold),
),
),
),
]),
),
);
}
}