You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HMG_Patient_App/lib/pages/offers_categorise_page.dart

171 lines
7.6 KiB
Dart

import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/offers_Categorise_view_model.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'base/base_view.dart';
class OffersCategorisePage extends StatefulWidget {
@override
_OffersCategorisePageState createState() => _OffersCategorisePageState();
}
class _OffersCategorisePageState extends State<OffersCategorisePage> {
@override
Widget build(BuildContext context) {
return BaseView<OffersCategoriseViewModel>(
onModelReady: (model) => model.getOffersCategorise(),
builder: (BuildContext context, OffersCategoriseViewModel model,
Widget child) =>
AppScaffold(
isShowDecPage: false,
baseViewModel: model,
body: Container(
height: MediaQuery.of(context).size.height * 0.58,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(10.0),
child: Container(
child: Texts('Categories'),
),
),
Divider(
thickness: 2.0,
color: Colors.grey.shade400,
),
Expanded(
child: Container(
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: model.categorise.length,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: [
InkWell(
child: Column(
children: [
Container(
height: 60.0,
width: 65.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.orange.shade200
.withOpacity(0.45),
),
child: Icon(
Icons.apps_sharp,
size: 32.0,
),
),
Container(
width: MediaQuery.of(context)
.size
.width *
0.2,
height: MediaQuery.of(context)
.size
.height *
0.08,
child: Center(
child: Texts(model
.categorise[index].name),
),
),
],
),
onTap: () {
model.getOffersProducts();
}),
],
),
);
}),
),
),
Divider(
thickness: 2.0,
color: Colors.grey.shade400,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts('Parsonal Care'),
),
Row(
children: [
Container(
height: 44.0,
child: VerticalDivider(
color: Colors.black45,
thickness: 1.5,
//width: 0.3,
// indent: 0.0,
),
),
Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
Icons.widgets_sharp,
color: Colors.blue,
size: 29.0,
),
),
],
),
],
),
Divider(
thickness: 2.0,
color: Colors.grey.shade400,
),
Expanded(
child: Container(
child: GridView.builder(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 0.2,
mainAxisSpacing: 7.0,
childAspectRatio: 3.2,
),
itemCount: model.products.length,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: EdgeInsets.all(4.0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1),
color: Colors.grey.withOpacity(0.24),
),
child: Column(
children: [
Container(
child: Image.network(model
.products[index].images.isNotEmpty
? model
.products[index].images[0].thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png'),
),
],
),
),
);
},
),
),
),
],
),
),
));
}
}
//