Skip to content

Commit

Permalink
Merge pull request #24 from 2024-Saphy/design/SAPHY-146-design-update
Browse files Browse the repository at this point in the history
설계:
  • Loading branch information
devlwh0830 authored Aug 30, 2024
2 parents f554f4d + 5907772 commit ae4b0fa
Show file tree
Hide file tree
Showing 13 changed files with 548 additions and 347 deletions.
Binary file removed assets/images/LogoBig.png
Binary file not shown.
7 changes: 7 additions & 0 deletions assets/images/LogoBig.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/images/LogoFixed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
222 changes: 141 additions & 81 deletions lib/screens/welcome/otp_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:saphy/utils/colors.dart';
import 'package:saphy/utils/log.dart';
import 'package:saphy/utils/otp_form.dart';
Expand Down Expand Up @@ -44,93 +45,152 @@ class _OtpScreenState extends State<OtpScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: newGray,
resizeToAvoidBottomInset: false,
body: Form(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'안전한 중고거래를 위해서!',
style: TextStyle(
fontFamily: 'Pretendard-Bold',
fontSize: 30.0,
fontWeight: FontWeight.w800,
color: altBlack,
body: Stack(
children: [
Positioned(
top: 100,
left: -240,
child: Opacity(
opacity: 0.5,
child: SvgPicture.asset(
'assets/images/LogoFixed.svg',
width: MediaQuery.of(context).size.width + 500.0,
),
),
const SizedBox(
height: 10.0,
),
Text(
'${widget.phoneNumber}로 인증번호가 전송되었습니다.',
style: const TextStyle(
fontFamily: 'Pretendard-Medium',
fontSize: 20.0,
fontWeight: FontWeight.w400,
color: altBlack,
),
Form(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const SizedBox(height: 10.0),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'안전한 중고거래를 위해서!',
style: TextStyle(
fontFamily: 'Pretendard-Bold',
fontSize: 35.0,
fontWeight: FontWeight.w800,
color: white,
),
),
const SizedBox(
height: 10.0,
),
Text(
'${widget.phoneNumber}로 인증번호가 전송되었습니다.',
style: const TextStyle(
fontFamily: 'Pretendard-Medium',
fontSize: 20.0,
fontWeight: FontWeight.w400,
color: gray100,
),
),
const SizedBox(
height: 10.0,
),
OtpForms(
controller1: _controller1,
controller2: _controller2,
controller3: _controller3,
controller4: _controller4,
controller5: _controller5,
controller6: _controller6),
],
),
Padding(
padding: const EdgeInsets.only(bottom: 20.0),
child: NormalButton(
title: "인증하기",
bgColor: mainPrimary,
txtColor: black,
flag: true,
onTap: () async {
logger.i(smsCode);
try {
final credential = PhoneAuthProvider.credential(
verificationId: widget.verificationId,
smsCode: smsCode);
await FirebaseAuth.instance
.signInWithCredential(credential)
.then((_) {
widget.onVerificationSuccess();
Navigator.of(context).pop();
});
} catch (e) {
print(e);
}
},
),
),
],
),
),
const SizedBox(
height: 10.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
OtpForm(
controller: _controller1,
lastNode: false,
),
OtpForm(
controller: _controller2,
lastNode: false,
),
OtpForm(
controller: _controller3,
lastNode: false,
),
OtpForm(
controller: _controller4,
lastNode: false,
),
OtpForm(
controller: _controller5,
lastNode: false,
),
OtpForm(
controller: _controller6,
lastNode: true,
),
],
),
const SizedBox(
height: 20.0,
),
NormalButton(
title: "인증하기",
bgColor: mainPrimary,
txtColor: black,
flag: true,
onTap: () async {
logger.i(smsCode);
try {
final credential = PhoneAuthProvider.credential(
verificationId: widget.verificationId, smsCode: smsCode);
await FirebaseAuth.instance
.signInWithCredential(credential)
.then((_) {
widget.onVerificationSuccess();
Navigator.of(context).pop();
});
} catch (e) {
print(e);
}
},
),
],
),
],
),
);
}
}

class OtpForms extends StatelessWidget {
const OtpForms({
super.key,
required TextEditingController controller1,
required TextEditingController controller2,
required TextEditingController controller3,
required TextEditingController controller4,
required TextEditingController controller5,
required TextEditingController controller6,
}) : _controller1 = controller1,
_controller2 = controller2,
_controller3 = controller3,
_controller4 = controller4,
_controller5 = controller5,
_controller6 = controller6;

final TextEditingController _controller1;
final TextEditingController _controller2;
final TextEditingController _controller3;
final TextEditingController _controller4;
final TextEditingController _controller5;
final TextEditingController _controller6;

@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
OtpForm(
controller: _controller1,
lastNode: false,
),
OtpForm(
controller: _controller2,
lastNode: false,
),
OtpForm(
controller: _controller3,
lastNode: false,
),
OtpForm(
controller: _controller4,
lastNode: false,
),
OtpForm(
controller: _controller5,
lastNode: false,
),
OtpForm(
controller: _controller6,
lastNode: true,
),
)),
],
);
}
}
Loading

0 comments on commit ae4b0fa

Please sign in to comment.