diff --git a/game_messenger_app/lib/main.dart b/game_messenger_app/lib/main.dart index 8b8df72..b0f95ad 100644 --- a/game_messenger_app/lib/main.dart +++ b/game_messenger_app/lib/main.dart @@ -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'; @@ -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), ); @@ -64,6 +66,6 @@ class AuthenticationWrapper extends StatelessWidget { if (theUser != null) { return CreateProfileAccount(); } - return verification_light1(); + return Introdution(); } } diff --git a/game_messenger_app/lib/screens/introduction.dart b/game_messenger_app/lib/screens/introduction.dart index 02f4929..eb99764 100644 --- a/game_messenger_app/lib/screens/introduction.dart +++ b/game_messenger_app/lib/screens/introduction.dart @@ -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'))), ], ), ), diff --git a/game_messenger_app/lib/screens/verification_screen/OTP_verification_screen.dart b/game_messenger_app/lib/screens/verification_screen/OTP_verification_screen.dart index 4e0e198..552a6bb 100644 --- a/game_messenger_app/lib/screens/verification_screen/OTP_verification_screen.dart +++ b/game_messenger_app/lib/screens/verification_screen/OTP_verification_screen.dart @@ -25,6 +25,8 @@ class _OTPVerificationScreenState extends State { @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( @@ -34,18 +36,41 @@ class _OTPVerificationScreenState extends State { 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, ), @@ -73,25 +98,36 @@ class _OTPVerificationScreenState extends State { ), 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(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: diff --git a/game_messenger_app/lib/screens/verification_screen/create_profile_screen.dart b/game_messenger_app/lib/screens/verification_screen/create_profile_screen.dart index 766d8b1..e464557 100644 --- a/game_messenger_app/lib/screens/verification_screen/create_profile_screen.dart +++ b/game_messenger_app/lib/screens/verification_screen/create_profile_screen.dart @@ -16,13 +16,15 @@ class _CreateProfileAccountState extends State { @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( @@ -43,13 +45,23 @@ class _CreateProfileAccountState extends State { 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: [ 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", @@ -82,7 +94,13 @@ class _CreateProfileAccountState extends State { 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, diff --git a/game_messenger_app/lib/screens/verification_screen/verification_light1.dart b/game_messenger_app/lib/screens/verification_screen/verification_light1.dart index e76e509..261394b 100644 --- a/game_messenger_app/lib/screens/verification_screen/verification_light1.dart +++ b/game_messenger_app/lib/screens/verification_screen/verification_light1.dart @@ -19,6 +19,8 @@ class _verification_light1State extends State { 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( @@ -26,7 +28,19 @@ class _verification_light1State extends State { 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) @@ -36,61 +50,105 @@ class _verification_light1State extends State { ), ), 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(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(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: