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.
247 lines
6.4 KiB
Dart
247 lines
6.4 KiB
Dart
import 'package:diplomaticquarterapp/config/config.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
import 'package:rating_bar/rating_bar.dart';
|
|
import 'package:diplomaticquarterapp/services/pharmacy_services/wishList_service.dart';
|
|
|
|
|
|
void main() => runApp(WishlistPage());
|
|
|
|
class WishlistPage extends StatefulWidget {
|
|
|
|
@override
|
|
_WishlistPageState createState() => _WishlistPageState();
|
|
}
|
|
|
|
class _WishlistPageState extends State<WishlistPage> {
|
|
|
|
@override
|
|
void initState(){
|
|
WidgetsBinding.instance.addPostFrameCallback((_) => getWishListItems());
|
|
}
|
|
|
|
Widget build(BuildContext context) {
|
|
return AppScaffold(
|
|
appBarTitle: 'Wishlist page',
|
|
isShowAppBar: true,
|
|
isPharmacy: true,
|
|
body: Container(
|
|
// child: productTile(),
|
|
child: ListView.builder(
|
|
itemCount: 3,
|
|
itemBuilder: (BuildContext context, int index) {
|
|
return Column(
|
|
children: [
|
|
Container(
|
|
child: productTile(),
|
|
),
|
|
Divider(height: 1, color: Colors.grey)
|
|
],
|
|
);
|
|
}),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
getWishListItems() {
|
|
|
|
print("getWishListItems");
|
|
WishListService service = new WishListService();
|
|
service.getWishlist(AppGlobal.context).then((res) {
|
|
print(res);
|
|
});
|
|
|
|
}
|
|
|
|
productTile() {
|
|
return Container(
|
|
height: 120,
|
|
width: double.infinity,
|
|
color: Colors.white,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(left: 10),
|
|
child: Image(
|
|
image:
|
|
AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'),
|
|
fit: BoxFit.cover,
|
|
width: 80,
|
|
height: 80,
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 5,
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.all(5),
|
|
child: Align(
|
|
alignment: Alignment.topLeft,
|
|
child: RichText(
|
|
text: TextSpan(
|
|
text:
|
|
'Dulcolax 5 Mg 30 Tablets asdfasdfadsf asdfasdfas dasd fasdf asd fasdfsad',
|
|
style: TextStyle(
|
|
color: Colors.black54,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.bold),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.all(5),
|
|
child: Align(
|
|
alignment: Alignment.topLeft,
|
|
child: RichText(
|
|
text: TextSpan(
|
|
text: 'SAR 9999.99',
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.black,
|
|
fontSize: 13),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.all(5),
|
|
child: Align(
|
|
alignment: Alignment.topLeft,
|
|
child: RatingBar.readOnly(
|
|
initialRating: 3,
|
|
size: 15.0,
|
|
filledColor: Colors.yellow[700],
|
|
emptyColor: Colors.grey[500],
|
|
isHalfAllowed: true,
|
|
halfFilledIcon: Icons.star_half,
|
|
filledIcon: Icons.star,
|
|
emptyIcon: Icons.star,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Column(
|
|
children: [
|
|
Icon(FontAwesomeIcons.trashAlt, size: 15),
|
|
SizedBox(height: 50,),
|
|
Icon(FontAwesomeIcons.shoppingCart, size: 15),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
//return Container(
|
|
//height: 120,
|
|
//color: Colors.white,
|
|
//child: Row(
|
|
//children: [
|
|
//Container(
|
|
//margin: EdgeInsets.all(10),
|
|
//child: Image(
|
|
//image: AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'),
|
|
//fit: BoxFit.cover,
|
|
//),
|
|
//),
|
|
//Column(
|
|
//mainAxisAlignment: MainAxisAlignment.center,
|
|
//crossAxisAlignment: CrossAxisAlignment.start,
|
|
//children: [
|
|
//Container(
|
|
//margin: EdgeInsets.all(5),
|
|
//child: Align(
|
|
//alignment: Alignment.topLeft,
|
|
//child: RichText(
|
|
//text: TextSpan(
|
|
//text: 'Dulcolax 5 Mg 30 Tablets',
|
|
//style: TextStyle(
|
|
//color: Colors.black54,
|
|
//fontSize: 15,
|
|
//fontWeight: FontWeight.bold),
|
|
//),
|
|
//),
|
|
//),
|
|
//),
|
|
//SizedBox(height: 10,),
|
|
//Container(
|
|
//margin: EdgeInsets.all(5),
|
|
//child: Align(
|
|
//alignment: Alignment.topLeft,
|
|
//child: RichText(
|
|
//text: TextSpan(
|
|
//text: 'SAR 9999.99',
|
|
//style: TextStyle(
|
|
//fontWeight: FontWeight.bold,
|
|
//color: Colors.black,
|
|
//fontSize: 13),
|
|
//),
|
|
//),
|
|
//),
|
|
//),
|
|
//SizedBox(height: 5,),
|
|
//Container(
|
|
//margin: EdgeInsets.only(
|
|
//right: MediaQuery.of(AppGlobal.context).size.width * 0.20),
|
|
//child: RatingBar.readOnly(
|
|
//initialRating: 3,
|
|
//// widget.doctor.actualDoctorRate.toDouble(),
|
|
//size: 15.0,
|
|
//filledColor: Colors.yellow[700],
|
|
//emptyColor: Colors.grey[500],
|
|
//isHalfAllowed: true,
|
|
//halfFilledIcon: Icons.star_half,
|
|
//filledIcon: Icons.star,
|
|
//emptyIcon: Icons.star,
|
|
//),
|
|
//),
|
|
//],
|
|
//),
|
|
//SizedBox(width: MediaQuery.of(AppGlobal.context).size.width *0.18,),
|
|
//// SizedBox(width: MediaQuery.of(AppGlobal.context).size.width *0.52,),
|
|
//Container(
|
|
//margin: EdgeInsets.only(top: 20),
|
|
//child: Column(
|
|
//children: [
|
|
//Padding(
|
|
//padding: const EdgeInsets.only(left: 15.0),
|
|
//child: Align(
|
|
//alignment: Alignment.centerLeft,
|
|
//child: Icon(FontAwesomeIcons.trashAlt, size: 15),
|
|
//),
|
|
//),
|
|
//SizedBox(
|
|
//height: 50,
|
|
//),
|
|
//Padding(
|
|
//padding: const EdgeInsets.only(left: 10.0),
|
|
//child: Align(
|
|
//alignment: Alignment.centerLeft,
|
|
//child: Icon(FontAwesomeIcons.shoppingCart, size: 15),
|
|
//),
|
|
//),
|
|
//],
|
|
//),
|
|
//),
|
|
//],
|
|
//),
|
|
//
|
|
//
|
|
//
|
|
//);
|