contact us, no data screen ui added & improvements
parent
f369aa6108
commit
ff8c972d12
@ -0,0 +1,21 @@
|
||||
<svg viewBox="0 0 456 456" xmlns="http://www.w3.org/2000/svg">
|
||||
<g data-name="Layer 2" id="Layer_2">
|
||||
<g data-name="Layer 7" id="Layer_7">
|
||||
<g data-name="1828, Block, Blocked, Website" id="_1828_Block_Blocked_Website">
|
||||
<g>
|
||||
<path style="fill: #ccc" d="M446.5,0H9.5A9.5,9.5,0,0,0,0,9.5v437A9.5,9.5,0,0,0,9.5,456h437a9.49,9.49,0,0,0,9.49-9.5V9.5A9.5,9.5,0,0,0,446.5,0ZM437,19V76H19V19ZM19,437V95H437V437Z"/>
|
||||
<path style="fill: #ccc" d="M47.5,38h19V57h-19Z"/>
|
||||
<path style="fill: #ccc" d="M380,38H408.5V57H380Z"/>
|
||||
<path style="fill: #ccc" d="M294.5,313.5h-133a9.5,9.5,0,0,0,0,19h133a9.5,9.5,0,1,0,0-19Z"/>
|
||||
<path style="fill: #ccc" d="M294.5,351.5h-133a9.5,9.5,0,0,0,0,19h133a9.5,9.5,0,1,0,0-19Z"/>
|
||||
<path style="fill: #ccc" d="M294.5,389.5h-133a9.5,9.5,0,0,0,0,19h133a9.5,9.5,0,1,0,0-19Z"/>
|
||||
<g>
|
||||
<path style="fill: #ccc" d="M243.45,123.44a61.87,61.87,0,1,0,61.87,61.87A61.94,61.94,0,0,0,243.45,123.44Zm0,110a48.13,48.13,0,1,1,48.12-48.12A48.18,48.18,0,0,1,243.45,233.44Z"/>
|
||||
<path style="fill: #ccc" d="M267.75,161a6.86,6.86,0,0,0-9.72,0l-14.58,14.58L228.87,161a6.88,6.88,0,0,0-9.73,9.72l14.59,14.59L219.14,199.9a6.88,6.88,0,0,0,9.73,9.72L243.45,195,258,209.62a6.87,6.87,0,0,0,9.72-9.72l-14.58-14.58,14.58-14.59a6.86,6.86,0,0,0,0-9.72Z"/>
|
||||
<line style="fill: none;stroke: #ccc;stroke-linecap: round;stroke-miterlimit: 10;stroke-width: 15.79006290435791px" x1="202" x2="150.68" y1="223.5" y2="266.92"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,26 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:tangheem/classes/colors.dart';
|
||||
|
||||
class NoDataUI extends StatelessWidget {
|
||||
NoDataUI({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(top: 100),
|
||||
child: Column(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/no_data.svg", width: 75, height: 75),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
"آسف! لا تتوافر بيانات",
|
||||
style: TextStyle(fontSize: 16, color: ColorConsts.primaryBlue.withOpacity(0.7), fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,154 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:tangheem/api/tangheem_user_api_client.dart';
|
||||
import 'package:tangheem/classes/colors.dart';
|
||||
import 'package:tangheem/classes/utils.dart';
|
||||
import 'package:tangheem/extensions/email_validator.dart';
|
||||
import 'package:tangheem/widgets/common_textfield_widget.dart';
|
||||
|
||||
class ContactUsScreen extends StatefulWidget {
|
||||
static const String routeName = "/contact_us";
|
||||
ContactUsScreen({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ContactUsScreenState createState() {
|
||||
return _ContactUsScreenState();
|
||||
}
|
||||
}
|
||||
|
||||
class _ContactUsScreenState extends State<ContactUsScreen> {
|
||||
TextEditingController _firstNameController = TextEditingController();
|
||||
TextEditingController _lastNameController = TextEditingController();
|
||||
TextEditingController _emailController = TextEditingController();
|
||||
TextEditingController _mobileNumberController = TextEditingController();
|
||||
TextEditingController _descriptionController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void sendFeedback(String _firstName, String _lastName, String _email, String _phone, String _description) async {
|
||||
Utils.showLoading(context);
|
||||
try {
|
||||
await TangheemUserApiClient().contactUs(_firstName, _lastName, _email, _phone, _description);
|
||||
Utils.showToast("شكرا لك على مراسلتنا ، نحن نقدر كلماتك.");
|
||||
Utils.hideLoading(context);
|
||||
Navigator.pop(context);
|
||||
} catch (ex, tr) {
|
||||
Utils.handleException(ex, null);
|
||||
Utils.hideLoading(context);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: ColorConsts.secondaryWhite,
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.all(32.0),
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8.0), color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 24, bottom: 24),
|
||||
child: SvgPicture.asset("assets/logos/tangheem_logo.svg", width: 100, height: 100),
|
||||
),
|
||||
Text(
|
||||
"اتصل بنا",
|
||||
style: TextStyle(fontSize: 22, color: ColorConsts.primaryBlue),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Text(
|
||||
"لا تتردد في الاتصال بنا ، يسعدنا أن نسمع منك",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 14, color: ColorConsts.primaryBlue, height: 1),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 16),
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(32.0),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorConsts.primaryBlue,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(8),
|
||||
bottomRight: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
CommonTextFieldWidget(hint: "الاسم الاول", controller: _firstNameController),
|
||||
SizedBox(height: 8),
|
||||
CommonTextFieldWidget(hint: "اسم النهاية", controller: _lastNameController),
|
||||
SizedBox(height: 8),
|
||||
CommonTextFieldWidget(hint: "الايميل", controller: _emailController),
|
||||
SizedBox(height: 8),
|
||||
CommonTextFieldWidget(hint: " رقم الجوال${" (" + ("9xx") + " xxxxxxxxx)"}", controller: _mobileNumberController),
|
||||
SizedBox(height: 8),
|
||||
CommonTextFieldWidget(hint: "اكتب لنا", controller: _descriptionController, maxLines: 4),
|
||||
SizedBox(height: 12),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 50,
|
||||
child: TextButton(
|
||||
onPressed: () {
|
||||
if (_firstNameController.text.length < 1) {
|
||||
Utils.showToast("الاسم الأول فارغ");
|
||||
return;
|
||||
}
|
||||
if (_lastNameController.text.length < 1) {
|
||||
Utils.showToast("الاسم الأخير فارغ");
|
||||
return;
|
||||
}
|
||||
if (_emailController.text.length < 1) {
|
||||
Utils.showToast("البريد الإلكتروني فارغ");
|
||||
return;
|
||||
}
|
||||
if (_mobileNumberController.text.length < 1) {
|
||||
Utils.showToast("رقم الهاتف فارغ");
|
||||
return;
|
||||
}
|
||||
if (_descriptionController.text.length < 1) {
|
||||
Utils.showToast("يجب أن تكتب لنا كلمات قليلة");
|
||||
return;
|
||||
}
|
||||
if (!_emailController.text.isValidEmail()) {
|
||||
Utils.showToast("بريد إلكتروني خاطئ");
|
||||
return;
|
||||
}
|
||||
sendFeedback(_firstNameController.text, _lastNameController.text, _emailController.text, _mobileNumberController.text, _descriptionController.text);
|
||||
},
|
||||
style: TextButton.styleFrom(
|
||||
primary: Colors.white,
|
||||
backgroundColor: ColorConsts.secondaryPink,
|
||||
textStyle: TextStyle(fontSize: 16, fontFamily: "DroidKufi"),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(6.0),
|
||||
),
|
||||
),
|
||||
child: Text("ارسل رأيك"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue