Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
medapp_eksad
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qorri_di
medapp_eksad
Commits
5e37b544
Commit
5e37b544
authored
Aug 30, 2022
by
r.manan@eksad.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contact_us: smallscreen
parent
bbe60556
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
335 additions
and
2 deletions
+335
-2
small_contact_us1.dart
lib/public_small/small_contact/small_contact_us1.dart
+51
-0
small_contact_us2.dart
lib/public_small/small_contact/small_contact_us2.dart
+280
-0
contact_us.dart
lib/screen/contact_us/contact_us.dart
+4
-2
No files found.
lib/public_small/small_contact/small_contact_us1.dart
View file @
5e37b544
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
class
ContactUs1_small
extends
StatefulWidget
{
const
ContactUs1_small
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
ContactUs1_small
>
createState
()
=>
_ContactUsState
();
}
class
_ContactUsState
extends
State
<
ContactUs1_small
>
{
@override
Widget
build
(
BuildContext
context
)
{
var
screenSize
=
MediaQuery
.
of
(
context
).
size
;
return
Stack
(
children:
[
Container
(
width:
screenSize
.
width
,
height:
screenSize
.
height
*
0.42
,
decoration:
const
BoxDecoration
(
image:
DecorationImage
(
image:
AssetImage
(
"assets/images/contactus1.jpg"
,
),
alignment:
Alignment
.
center
,
fit:
BoxFit
.
cover
)),
),
Container
(
width:
screenSize
.
width
*
0.5
,
height:
screenSize
.
height
*
0.34
,
padding:
EdgeInsets
.
only
(
right:
screenSize
.
width
*
0.30
,
left:
screenSize
.
height
*
0.06
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
Text
(
'Contact Us'
,
style:
GoogleFonts
.
poppins
(
fontSize:
37
,
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
white
),
overflow:
TextOverflow
.
ellipsis
,
),
],
),
),
],
);
}
}
lib/public_small/small_contact/small_contact_us2.dart
View file @
5e37b544
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
// import 'package:mcs_flutter/widget/botton.dart';
// import 'package:mcs_flutter/const/conts.dart';
import
'dart:convert'
;
import
'package:http/http.dart'
as
http
;
import
'package:medapp_eksad/widget/button_color.dart'
;
class
ContactUs2_small
extends
StatelessWidget
{
ContactUs2_small
({
Key
?
key
})
:
super
(
key:
key
);
final
_formKey
=
GlobalKey
<
FormState
>();
final
nameController
=
TextEditingController
();
final
phoneController
=
TextEditingController
();
final
emailController
=
TextEditingController
();
final
messageController
=
TextEditingController
();
@override
Widget
build
(
BuildContext
context
)
{
var
screenSize
=
MediaQuery
.
of
(
context
).
size
;
return
Container
(
height:
screenSize
.
height
*
1.5
,
width:
screenSize
.
width
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
),
// color: Colors.blue,
decoration:
const
BoxDecoration
(
gradient:
LinearGradient
(
colors:
<
Color
>[
Color
(
0xff137fc2
),
Color
(
0xff3958d5
),
Color
(
0xff184b80
),
],
begin:
Alignment
.
topCenter
,
end:
Alignment
.
bottomCenter
,
)),
child:
Container
(
padding:
const
EdgeInsets
.
all
(
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
Text
(
'Yes, you need '
'
\n
'
'an outsourcing partner '
'you can trust and thrive with'
,
textAlign:
TextAlign
.
left
,
style:
GoogleFonts
.
poppins
(
color:
Colors
.
white
,
fontSize:
30
,
fontWeight:
FontWeight
.
bold
)),
Text
(
'Go for the one who knows what they are doing, those who you share values with, '
'and those who will celebrate your success, and help you win over your biggest challenges. '
'Looking for an outsourcing partner? '
,
textAlign:
TextAlign
.
justify
,
style:
GoogleFonts
.
poppins
(
color:
Colors
.
white
,
fontSize:
18
,
// fontWeight: FontWeight.bold,
letterSpacing:
1.1
)),
Text
(
"We’ll contact you immediately to discuss to help you."
,
style:
GoogleFonts
.
poppins
(
color:
Colors
.
white
,
fontSize:
18
,
letterSpacing:
1.2
)),
Form
(
key:
_formKey
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
Container
(
child:
Text
(
"Name"
,
style:
GoogleFonts
.
poppins
(
color:
Colors
.
white
,
fontSize:
20
,
fontWeight:
FontWeight
.
w400
),
),
),
Container
(
width:
450
,
child:
TextFormField
(
controller:
nameController
,
decoration:
const
InputDecoration
(
hintText:
"Enter your Name"
,
fillColor:
Colors
.
white
,
filled:
true
,
enabledBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
zero
,
borderSide:
BorderSide
(
width:
1
,
color:
Colors
.
white
),
),
focusedBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
zero
,
borderSide:
BorderSide
(
width:
1
,
color:
Colors
.
white
),
),
),
),
),
const
SizedBox
(
height:
20
,
),
Container
(
child:
Text
(
"Phone Number"
,
style:
GoogleFonts
.
poppins
(
color:
Colors
.
white
,
fontSize:
20
,
fontWeight:
FontWeight
.
w400
),
),
),
const
SizedBox
(
width:
80
,
),
Container
(
width:
450
,
child:
TextFormField
(
controller:
phoneController
,
decoration:
const
InputDecoration
(
hintText:
"Enter a valid phone number"
,
fillColor:
Colors
.
white
,
filled:
true
,
enabledBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
zero
,
borderSide:
BorderSide
(
width:
1
,
color:
Colors
.
white
),
),
focusedBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
zero
,
borderSide:
BorderSide
(
width:
1
,
color:
Colors
.
white
),
),
),
),
),
const
SizedBox
(
height:
20
,
),
Container
(
child:
Text
(
"Email"
,
style:
GoogleFonts
.
poppins
(
color:
Colors
.
white
,
fontSize:
20
,
fontWeight:
FontWeight
.
w400
),
),
),
const
SizedBox
(
width:
7
,
),
Container
(
width:
450
,
child:
TextFormField
(
controller:
emailController
,
decoration:
const
InputDecoration
(
hintText:
"Enter a valid email address"
,
fillColor:
Colors
.
white
,
filled:
true
,
enabledBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
zero
,
borderSide:
BorderSide
(
width:
1
,
color:
Colors
.
white
),
),
focusedBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
zero
,
borderSide:
BorderSide
(
width:
1
,
color:
Colors
.
white
),
),
),
),
),
const
SizedBox
(
height:
20
,
),
Text
(
"Message"
,
style:
GoogleFonts
.
poppins
(
color:
Colors
.
white
,
fontSize:
20
,
fontWeight:
FontWeight
.
w400
),
),
Container
(
width:
450
,
child:
TextFormField
(
controller:
messageController
,
decoration:
const
InputDecoration
(
hintText:
"Enter your message"
,
fillColor:
Colors
.
white
,
filled:
true
,
enabledBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
zero
,
borderSide:
BorderSide
(
width:
1
,
color:
Colors
.
white
),
),
focusedBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
zero
,
borderSide:
BorderSide
(
width:
1
,
color:
Colors
.
white
),
),
),
maxLines:
5
,
validator:
(
value
)
{
if
(
value
==
null
||
value
.
isEmpty
)
{
return
'*Required'
;
}
return
null
;
},
),
),
const
SizedBox
(
height:
20
,
),
SizedBox
(
height:
45
,
width:
100
,
child:
TextButton
(
style:
Btn_Submit
(),
onPressed:
()
async
{
if
(
_formKey
.
currentState
!.
validate
())
{
final
response
=
await
SendEmail
(
nameController
.
value
.
text
,
phoneController
.
value
.
text
,
emailController
.
value
.
text
,
messageController
.
value
.
text
);
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
response
==
200
?
const
SnackBar
(
content:
Text
(
'Message Sent!'
),
backgroundColor:
Colors
.
green
)
:
const
SnackBar
(
content:
Text
(
'Failed to send message!'
),
backgroundColor:
Colors
.
red
),
);
nameController
.
clear
();
phoneController
.
clear
();
emailController
.
clear
();
messageController
.
clear
();
}
},
child:
const
Text
(
'Submit'
,
style:
TextStyle
(
fontSize:
16
,
color:
Colors
.
white
),
),
),
),
]),
),
]),
),
);
}
Future
SendEmail
(
String
name
,
String
phone
,
String
email
,
String
message
)
async
{
final
url
=
Uri
.
parse
(
'https://api.emailjs.com/api/v1.0/email/send'
);
const
serviceId
=
'service_wava70j'
;
const
templateId
=
'template_koc73cj'
;
const
userId
=
'h4BmDnyWlm3OziBDx'
;
final
response
=
await
http
.
post
(
url
,
headers:
{
'Content-Type'
:
'application/json'
},
//This line makes sure it works for all platforms.
body:
json
.
encode
({
'service_id'
:
serviceId
,
'template_id'
:
templateId
,
'user_id'
:
userId
,
'template_params'
:
{
'from_name'
:
name
,
'from_phone'
:
phone
,
'to_email'
:
email
,
'message'
:
message
}
}));
return
response
.
statusCode
;
}
}
lib/screen/contact_us/contact_us.dart
View file @
5e37b544
import
'package:flutter/material.dart'
;
import
'package:medapp_eksad/appbar/appbar_home.dart'
;
import
'package:medapp_eksad/public_small/small_contact/small_contact_us1.dart'
;
import
'package:medapp_eksad/public_small/small_contact/small_contact_us2.dart'
;
import
'package:medapp_eksad/screen/contact_us/contact_us1.dart'
;
import
'package:medapp_eksad/screen/contact_us/contact_us2.dart'
;
import
'package:medapp_eksad/screen/footer.dart'
;
...
...
@@ -36,8 +38,8 @@ class _ContactUsState extends State<ContactUs> {
body:
ResponsiveWidget
.
isSmallScreen
(
context
)
?
ListView
(
children:
[
const
ContactUs1
(),
ContactUs2
(),
const
ContactUs1
_small
(),
ContactUs2
_small
(),
const
Footer
(),
],
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment