rup-project/app/lib/screens/signup_screen.dart

187 lines
5.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class SignupScreen extends StatelessWidget {
const SignupScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
backgroundColor: Colors.white,
elevation: 0,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black, size: 20),
onPressed: () => Navigator.pop(context),
),
title: Text(
'회원가입',
style: TextStyle(
fontSize: 15,
fontFamily: 'SCDream',
fontWeight: FontWeight.w500,
color: Colors.black,
),
),
centerTitle: true,
),
body: Padding(
padding: const EdgeInsets.fromLTRB(20, 0, 20, 240),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset('assets/img/foot.png', width: 30),
SizedBox(width: 10),
Text(
'서비스 이용 약관',
style: TextStyle(
fontSize: 24,
fontFamily: 'SCDream',
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
],
),
SizedBox(height: 10),
Text(
'똑똑한 반려생활을 위한 첫걸음,\nRUP에 오신것을 환영해요!',
style: TextStyle(
fontSize: 14,
fontFamily: 'SCDream',
fontWeight: FontWeight.w500,
color: Colors.black,
),
textAlign: TextAlign.start,
),
Spacer(),
Align(
alignment: Alignment.centerRight,
child: Image.asset('assets/img/cat.png', height: 150),
),
SizedBox(height: 10),
],
),
),
bottomSheet: Container(
color: Colors.white,
padding: EdgeInsets.fromLTRB(20, 20, 20, 40),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// Naver Login Button
_SocialLoginButton(
text: '네이버 로그인',
textColor: Colors.white,
fontFamily: 'SCDream',
fontWeight: FontWeight.bold,
fontSize: 15,
backgroundColor: Color(0xFF00D03F),
onPressed: () {},
iconPath: 'assets/icons/navericon.svg',
),
SizedBox(height: 15),
// Kakao Login Button
_SocialLoginButton(
text: '카카오로 3초만에 시작하기',
textColor: Color(0xFF212121),
fontFamily: 'SCDream',
fontWeight: FontWeight.bold,
fontSize: 15,
backgroundColor: Color(0xFFFAE100),
onPressed: () {},
iconPath: 'assets/icons/kakaoicon.svg',
),
SizedBox(height: 15),
// Google Login Button
_SocialLoginButton(
text: '구글 로그인',
textColor: Color(0xFF17191A),
fontFamily: 'SCDream',
fontWeight: FontWeight.bold,
fontSize: 15,
backgroundColor: Colors.white,
onPressed: () {},
iconPath: 'assets/icons/googleicon.svg',
isBordered: true,
),
],
),
),
);
}
}
class _SocialLoginButton extends StatelessWidget {
final String text;
final Color textColor;
final Color backgroundColor;
final VoidCallback onPressed;
final String iconPath;
final bool isBordered;
final String fontFamily;
final double fontSize;
final FontWeight fontWeight;
const _SocialLoginButton({
required this.text,
required this.textColor,
required this.backgroundColor,
required this.onPressed,
required this.iconPath,
this.isBordered = false,
this.fontFamily = 'SCDream',
this.fontWeight = FontWeight.w500,
this.fontSize = 16,
});
@override
Widget build(BuildContext context) {
return SizedBox(
height: 50,
child: ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
backgroundColor: backgroundColor,
foregroundColor: textColor,
elevation: 0,
shape: StadiumBorder(
side: isBordered
? BorderSide(color: Colors.grey[300]!)
: BorderSide.none,
),
padding: EdgeInsets.symmetric(horizontal: 20),
),
child: Row(
children: [
SvgPicture.asset(
iconPath,
width: 24,
height: 24,
fit: BoxFit.contain,
),
Expanded(
child: Text(
text,
style: TextStyle(
fontFamily: fontFamily,
fontWeight: fontWeight,
fontSize: fontSize,
),
textAlign: TextAlign.center,
),
),
SizedBox(width: 24),
],
),
),
);
}
}