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.
313 lines
12 KiB
Dart
313 lines
12 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
import 'package:diplomaticquarterapp/config/config.dart';
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
|
|
import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';
|
|
import 'package:rating_bar/rating_bar.dart';
|
|
import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart';
|
|
|
|
class ProductReviewPage extends StatefulWidget {
|
|
|
|
@override
|
|
_ProductReviewPageState createState() => _ProductReviewPageState();
|
|
}
|
|
|
|
class _ProductReviewPageState extends State<ProductReviewPage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
centerTitle: true,
|
|
title: Text(TranslationBase.of(context).writeReview, style: TextStyle(color:Colors.white)),
|
|
backgroundColor: Colors.green,
|
|
),
|
|
body: Container(
|
|
color: Colors.white,
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
children: <Widget> [
|
|
// Container(
|
|
// child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00,
|
|
// productReviews:4, ),
|
|
// ),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
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,
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top :15.0, bottom: 15.0),
|
|
child: Column(
|
|
children: <Widget>[
|
|
Row(
|
|
children: <Widget>[
|
|
Text('medication name',
|
|
style: TextStyle(fontSize: 16.0,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(left: 5),
|
|
child: Text('90.00',
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(left: 5),
|
|
child: Text('SAR',
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
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,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
child: Text('4.9',
|
|
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(left: 5),
|
|
child: Text('10 (reviews)',
|
|
style: TextStyle(fontSize: 12.0,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Divider(
|
|
color: Colors.grey[350],
|
|
height: 20,
|
|
thickness: 8,
|
|
indent: 0,
|
|
endIndent: 0,
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only( top: 12.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: <Widget>[
|
|
RatingBar(
|
|
// initialRating:
|
|
// this.doctor.actualDoctorRate.toDouble(),
|
|
size: 40.0,
|
|
filledColor: Colors.yellow[700],
|
|
emptyColor: Colors.grey[500],
|
|
isHalfAllowed: true,
|
|
halfFilledIcon: Icons.star_half,
|
|
filledIcon: Icons.star,
|
|
emptyIcon: Icons.star,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
padding: EdgeInsets.fromLTRB(8.0, 20.0, 8.0,20.0),
|
|
child: Column(
|
|
children:<Widget> [
|
|
TextFormField (
|
|
decoration: InputDecoration(
|
|
contentPadding: const EdgeInsets.symmetric(vertical: 60.0),
|
|
border: InputBorder.none,
|
|
hintText: 'Tell us more about product!',
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(5.0),
|
|
borderSide: BorderSide(width: 1, color: Colors.grey[400]),
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.all(Radius.circular(5.0)),
|
|
borderSide: BorderSide(color: Colors.grey[400], width: 1),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
InkWell(
|
|
onTap: () {
|
|
|
|
},
|
|
child: Container(
|
|
height: 50.0,
|
|
width: 400.0,
|
|
color: Colors.transparent,
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
border: Border.all(
|
|
color: Colors.yellow[700],
|
|
style: BorderStyle.solid,
|
|
width: 1.0
|
|
),
|
|
color: Colors.yellow[700],
|
|
borderRadius: BorderRadius.circular(5.0)
|
|
),
|
|
child: Center(
|
|
child: Text(
|
|
TranslationBase.of(context).shareReview,
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 16.0,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
//new screen is showing after submitting the review
|
|
Widget getReviewedProduct(){
|
|
return Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children:<Widget> [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children:<Widget> [
|
|
SvgPicture.asset(
|
|
'assets/images/pharmacy/check_icon.svg',
|
|
width: 28,
|
|
height: 28,),
|
|
Container(
|
|
margin: EdgeInsets.only(left: 10.0),
|
|
child: Text(TranslationBase.of(context).reviewSuccessful,
|
|
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top:5.0, bottom: 20.0 ),
|
|
child: Text(TranslationBase.of(context).reviewShared,
|
|
style: TextStyle(fontSize: 15.0,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(bottom: 30.0, top: 30.0 ),
|
|
child: SvgPicture.asset(
|
|
'assets/images/pharmacy/success_review_icon.svg',
|
|
width: 100,
|
|
height: 100,),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(left: 20.0, right: 20.0),
|
|
child: Column(
|
|
children:<Widget> [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children:<Widget> [
|
|
SvgPicture.asset(
|
|
'assets/images/pharmacy/quote_start.svg',
|
|
width: 15,
|
|
height: 15,),
|
|
],
|
|
),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children:<Widget> [
|
|
Text(TranslationBase.of(context).reviewComment,
|
|
style: TextStyle(fontSize: 15.0,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
children:<Widget> [
|
|
SvgPicture.asset(
|
|
'assets/images/pharmacy/quote_end.svg',
|
|
width: 15,
|
|
height: 15,),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 20.0 ),
|
|
child: InkWell(
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(builder: (context) {
|
|
return PharmacyProfilePage();
|
|
}),
|
|
);
|
|
},
|
|
child: Container(
|
|
height: 50.0, color: Colors.transparent,
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
border: Border.all(
|
|
color: Colors.orange,
|
|
style: BorderStyle.solid,
|
|
width: 1.0
|
|
),
|
|
color: Colors.transparent,
|
|
borderRadius: BorderRadius.circular(5.0)
|
|
),
|
|
child: Center(
|
|
child: Text(
|
|
TranslationBase.of(context).backMyAccount,
|
|
style: TextStyle(
|
|
color: Colors.orange,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|