Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion game_messenger_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:game_messenger_app/constants.dart';
import 'package:game_messenger_app/screens/introduction.dart';
import 'package:game_messenger_app/screens/more_screen/moreScreen.dart';
import 'package:game_messenger_app/screens/verification_screen/OTP_verification_screen.dart';
import 'package:game_messenger_app/screens/verification_screen/create_profile_screen.dart';
Expand Down Expand Up @@ -51,6 +52,7 @@ class Main extends StatelessWidget {
'/verification': (context) => verification_light1(),
'/createProfile': (context) => CreateProfileAccount(),
'/moreScreen': (context) => MoreScreen(),
'/otpScreen':(context)=>OTPVerificationScreen(phoneNo: '744717')
},
theme: isDark ? darkTheme : lightTheme),
);
Expand All @@ -64,6 +66,6 @@ class AuthenticationWrapper extends StatelessWidget {
if (theUser != null) {
return CreateProfileAccount();
}
return verification_light1();
return Introdution();
}
}
6 changes: 4 additions & 2 deletions game_messenger_app/lib/screens/introduction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ class Introdution extends StatelessWidget {
width: 350,
height: 50,
child: ElevatedButton(
onPressed: () {}, child: Text('Start messigin'))),

onPressed: () {
Navigator.pushNamed(context, '/verification');
},
child: Text('Start messaging'))),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class _OTPVerificationScreenState extends State<OTPVerificationScreen> {

@override
Widget build(BuildContext context) {
var MQH = MediaQuery.of(context).size.height;
var MQW = MediaQuery.of(context).size.width;
return Scaffold(
body: SafeArea(
child: SingleChildScrollView(
Expand All @@ -34,18 +36,41 @@ class _OTPVerificationScreenState extends State<OTPVerificationScreen> {
width: 350,
height: 1060,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
//crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: MQW >= 820 && MQH >= 1180
? 130.0
: MQW >= 768 && MQH >= 1024
? 100.0
: MQW >= 393 && MQH >= 851
? 100.0
: MQW >= 414 && MQH >= 896
? 100.0
: MQW >= 390 && MQH >= 844
? 100.0
: MQW >= 360 && MQH >= 740
? 65.0
: 0),
Text(
'Enter Code',
style: Theme.of(context).textTheme.headline4,
style: MQW >= 820 && MQH >= 1180
? TextStyle(fontSize: 50)
: MQW >= 768 && MQH >= 1024
? TextStyle(fontSize: 55)
: Theme.of(context).textTheme.headline4,
),
SizedBox(
height: 20,
),
Text(
'We have sent you on SMS with the code to ${widget.phoneNo}',
style: Theme.of(context).textTheme.headline6),
'We have sent you on SMS with the code to \n ${widget.phoneNo}',
style: MQW >= 820 && MQH >= 1180
? TextStyle(fontSize: 30)
: MQW >= 768 && MQH >= 1024
? TextStyle(fontSize: 30)
: Theme.of(context).textTheme.headline6),
SizedBox(
height: 60,
),
Expand Down Expand Up @@ -73,25 +98,36 @@ class _OTPVerificationScreenState extends State<OTPVerificationScreen> {
),
Text(
'If you did not receive the code, do not worry, a new code will be sent in 60 seconds. ',
style: Theme.of(context).textTheme.headline6,
style: MQW >= 820 && MQH >= 1180
? TextStyle(fontSize: 25)
: MQW >= 768 && MQH >= 1024
? TextStyle(fontSize: 25)
: Theme.of(context).textTheme.headline6,
),
SizedBox(
height: 30,
),
ElevatedButton(
onPressed: () async {
print('++++++++++++++++++++++++++++++++++ Sms is :' +
onPressed: () //async
{
Navigator.pushNamed(context, '/createProfile');

/* print('++++++++++++++++++++++++++++++++++ Sms is :' +
_smsController.text);
await Provider.of<AuthService>(context, listen: false)
.autoPhoneVerification(
widget.phoneNo, context, _smsController.text)
.then((value) {
setState(() {});
});
}); */
},
child: Text(
'Continue',
style: TextStyle(color: Colors.white),
style: MQW >= 820 && MQH >= 1180
? TextStyle(fontSize: 25)
: MQW >= 768 && MQH >= 1024
? TextStyle(fontSize: 25)
: TextStyle(color: Colors.white),
),
style: ElevatedButton.styleFrom(
minimumSize:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ class _CreateProfileAccountState extends State<CreateProfileAccount> {

@override
Widget build(BuildContext context) {
var MQH = MediaQuery.of(context).size.height;
var MQW = MediaQuery.of(context).size.width;
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
elevation: 0,
title: Text(
'Your Profile',
style: Theme.of(context).textTheme.bodyText1,
style: Theme.of(context).textTheme.bodyText2,
),
actions: [
IconButton(
Expand All @@ -43,13 +45,23 @@ class _CreateProfileAccountState extends State<CreateProfileAccount> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: MQW >= 820 && MQH >= 1180
? 130.0
: MQW >= 768 && MQH >= 1024
? 100.0
: 0),
TextButton(
onPressed: () {},
child: Stack(
children: <Widget>[
CircleAvatar(
backgroundColor: color,
radius: 50,
radius: MQW >= 820 && MQH >= 1180
? 75.0
: MQW >= 768 && MQH >= 1024
? 75.0
: 40,
child: ClipOval(
child: Image.network(
"https://static.thenounproject.com/png/3465604-200.png",
Expand Down Expand Up @@ -82,7 +94,13 @@ class _CreateProfileAccountState extends State<CreateProfileAccount> {
Padding(
padding: const EdgeInsets.all(20),
child: TextField(
obscureText: true,
style: TextStyle(
fontSize: MQW >= 820 && MQH >= 1180
? 25.0
: MQW >= 768 && MQH >= 1024
? 25.0
: 10),
obscureText: false,
autofocus: true,
decoration: InputDecoration(
border: InputBorder.none,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,28 @@ class _verification_light1State extends State<verification_light1> {
AuthService _authService = AuthService();
@override
Widget build(BuildContext context) {
var MQH = MediaQuery.of(context).size.height;
var MQW = MediaQuery.of(context).size.width;
return Scaffold(
body: SafeArea(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.fromLTRB(25, 150, 25, 0),
margin: EdgeInsets.only(
top: MQW >= 820 && MQH >= 1180
? 300
: MQW >= 390 && MQH >= 844
? 100
: MQW >= 768 && MQH >= 1024
? 250
: MQW >= 393 && MQH >= 851
? 220
: MQW >= 540 && MQH >= 720
? 80.0
: 150),
// margin: EdgeInsets.fromLTRB(25, 150, 25, 0),
child: Text(
'Enter Your Phone Number',
style: Theme.of(context)
Expand All @@ -36,61 +50,105 @@ class _verification_light1State extends State<verification_light1> {
),
),
ConstrainedBox(
constraints: BoxConstraints(maxWidth: 300),
constraints: BoxConstraints(
maxWidth: MQW >= 820 && MQH >= 1180
? 400
: MQH >= 768 && MQW >= 1024
? 350
: 300),
child: Container(
margin: EdgeInsets.only(top: 7),
child: Text(
'please confirm your country code and enter your phone number',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.subtitle1)),
style: MQW >= 820 && MQH >= 1180
? TextStyle(fontSize: 25)
: MQW >= 768 && MQH >= 1024
? TextStyle(fontSize: 25)
: Theme.of(context).textTheme.bodyText1)),
),
SizedBox(
height: 70,
),
InternationalPhoneNumberInput(
onInputChanged: (PhoneNumber number) {
phoneNo = number.phoneNumber!;
},
errorMessage: 'please enter your phone number',
autoFocus: true,
cursorColor: Colors.blue,
keyboardType: TextInputType.phone,
textStyle: Theme.of(context).textTheme.bodyText1,
spaceBetweenSelectorAndTextField: 0,
selectorTextStyle: Theme.of(context).textTheme.bodyText1,
inputDecoration: InputDecoration(
hintText: 'Phone number',
hintStyle: TextStyle(color: Colors.grey[700]),
border: InputBorder.none,
filled: true,
fillColor: Colors.grey[100],
constraints: BoxConstraints(maxWidth: 250)),
searchBoxDecoration: InputDecoration(
border: InputBorder.none,
filled: true,
fillColor: Colors.grey[100],
constraints: BoxConstraints(maxWidth: 5)),
Padding(
padding: EdgeInsets.only(
left: MQW >= 820 && MQH >= 1180
? 200.0
: MQW >= 768 && MQH >= 1024
? 175.0
: MQW >= 912 && MQH >= 1368
? 200.0
: MQW >= 1024 && MQH >= 600
? 275.0
: MQH >= 1024 && MQW >= 768
? 50.0
: MQH >= 1024 && MQW >= 1366
? 300.0
: MQW >= 375 && MQH >= 667
? 0.0
: MQW >= 360 && MQH >= 740
? 45.0
: MQW >= 540 && MQH >= 720
? 100.0
: MQW >= 412 &&
MQH >= 915
? 10.0
: 250),
child: InternationalPhoneNumberInput(
onInputChanged: (PhoneNumber number) {
phoneNo = number.phoneNumber!;
},
errorMessage: 'please enter your phone number',
autoFocus: true,
cursorColor: Colors.blue,
keyboardType: TextInputType.phone,
textStyle: Theme.of(context).textTheme.bodyText1,
spaceBetweenSelectorAndTextField: 0,
selectorTextStyle: Theme.of(context).textTheme.headline6,
inputDecoration: InputDecoration(
hintText: 'Phone number',
hintStyle: TextStyle(color: Colors.grey[700]),
border: InputBorder.none,
filled: true,
fillColor: Colors.grey[100],
constraints: BoxConstraints(maxWidth: 250)),
searchBoxDecoration: InputDecoration(
border: InputBorder.none,
filled: true,
fillColor: Colors.grey[100],
constraints: BoxConstraints(maxWidth: 5)),
),
),
SizedBox(
height: 95,
),
ElevatedButton(
onPressed: () async {
await Provider.of<AuthService>(context, listen: false)
.autoPhoneVerification(phoneNo!, context)
.then((value) {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => OTPVerificationScreen(
phoneNo: phoneNo!,
)));
setState(() {});
});
onPressed: () // async
{
Navigator.pushNamed(context, '/otpScreen');
// await Provider.of<AuthService>(context, listen: false)
// .autoPhoneVerification(phoneNo!, context)
// .then((value) {
// Navigator.pushReplacement(
// context,
// MaterialPageRoute(
// builder: (context) => OTPVerificationScreen(
// phoneNo: phoneNo!,
// )));
// setState(() {}
// );
// }
//);
},
child: Text(
'Continue',
style: TextStyle(color: Colors.white),
style: TextStyle(
fontSize: MQW >= 820 && MQH >= 1180
? 25
: MQW >= 820 && MQH >= 1180
? 20
: 20,
color: Colors.white),
),
style: ElevatedButton.styleFrom(
minimumSize:
Expand Down