feat:Order item created
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
import 'package:food_delivery_client/feature/basket/presentation/pages/basket_page/widgets/w_basket_empty.dart';
|
||||
import 'package:food_delivery_client/feature/basket/presentation/pages/basket_page/widgets/w_basket_header.dart';
|
||||
|
||||
import '../../../../../food_delivery_client.dart';
|
||||
|
||||
class BasketPage extends StatelessWidget {
|
||||
@@ -8,10 +5,13 @@ class BasketPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WLayout(
|
||||
child: Scaffold(body: Column(children: [
|
||||
WBasketHeader(),
|
||||
WBasketEmpty()])),
|
||||
return BlocProvider(
|
||||
create: (context) => sl<BasketBloc>()..add(BasketEvent.started()),
|
||||
child: BlocBuilder<BasketBloc, BasketState>(
|
||||
builder: (context, state) {
|
||||
return WLayout(child: Scaffold(body: WBasketBody()));
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'package:food_delivery_client/feature/basket/presentation/pages/basket_page/widgets/w_basket_loading.dart';
|
||||
|
||||
import '../../../../../../food_delivery_client.dart';
|
||||
|
||||
class WBasketBody extends StatelessWidget {
|
||||
const WBasketBody({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<BasketBloc, BasketState>(
|
||||
builder: (context, state) {
|
||||
return Column(
|
||||
children: [
|
||||
WBasketHeader(),
|
||||
OrderItem(),
|
||||
|
||||
if (state.status.isLoading()) Text("Loading"),
|
||||
if (state.status.isLoaded())
|
||||
if (state.orders.isEmpty) WBasketEmpty(),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import '../../../../../../food_delivery_client.dart';
|
||||
|
||||
class WBasketLoading extends StatelessWidget {
|
||||
const WBasketLoading({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(children: []);
|
||||
}
|
||||
}
|
||||
|
||||
class OrderItem extends StatelessWidget {
|
||||
const OrderItem({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {},
|
||||
child: Ink(
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: AppUtils.kBorderRadius40,
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: AppLocaleKeys.imageUrl,
|
||||
height: 70,
|
||||
width: 70,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
16.horizontalSpace,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("Begs & Megs", style: AppTextStyles.size16Medium),
|
||||
Text(
|
||||
"1 item",
|
||||
style: AppTextStyles.size14Regular.copyWith(
|
||||
color: AppColors.c6B6B6B,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Deliver to San Franciscao Bay Area",
|
||||
style: AppTextStyles.size14Regular.copyWith(
|
||||
color: AppColors.c6B6B6B,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Icon(Icons.arrow_forward_ios_outlined),
|
||||
],
|
||||
).paddingSymmetric(vertical: 10, horizontal: 16),
|
||||
10.verticalSpace,
|
||||
WDivider(indent: 120, endIndent: 20, height: 1),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user