Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- divider
- ListView.builder
- Navigator
- setstate
- swift 문법
- Swift
- globalkey
- permission
- Camera
- signout
- Firebase
- controller
- platformexception
- runTransaction
- Snapshot
- datetime
- borderRadius
- provider
- consumer
- enum
- changenotifierprovider
- user
- changenotifier
- Stream
- reference
- multiprovider
- transform
- snackbar
- 문법
- switch
Archives
- Today
- Total
코딩하는 제리
[Flutter/Project](Instagram Clone) Positioned(), RichText(TextSpan()), FlatButton(shape:) 본문
Flutter/Project_InstaClone(완)
[Flutter/Project](Instagram Clone) Positioned(), RichText(TextSpan()), FlatButton(shape:)
JerryCho 2021. 1. 24. 12:39
소스코드 및 pubspec.yaml
// screens/auth_screen.dart
import 'package:flutter/material.dart';
import 'package:flutter_project_IJ/widgets/fade_stack.dart';
class AuthScreen extends StatefulWidget {
@override
_AuthScreenState createState() => _AuthScreenState();
}
class _AuthScreenState extends State<AuthScreen> {
// index
int selectedForm = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Stack(
children: [
FadeStack(
selectedForm: selectedForm,
),
Positioned(
left: 0,
right: 0,
bottom: 0,
height: 45,
// 높이를 정해줘야 FlatButton의 shape:이 잘 맞음.
child: Container(
color: Colors.white,
child: FlatButton(
// 버튼 상단 회색 선
shape: Border(top: BorderSide(color: Colors.grey)),
onPressed: () {
setState(() {
if (selectedForm == 0)
selectedForm = 1;
else
selectedForm = 0;
});
},
child: RichText(
text: TextSpan(
text: selectedForm == 0
? "Already have an account? "
: "Don't have an account? ",
style: TextStyle(
color: Colors.grey, fontWeight: FontWeight.bold),
children: [
TextSpan(
text: selectedForm == 0 ? "Sign In" : "Sing Up",
style: TextStyle(color: Colors.blue),
),
]),
),
),
),
)
],
),
),
);
}
}
'Flutter > Project_InstaClone(완)' 카테고리의 다른 글
[Flutter/Project](Instagram Clone) TextFormField 데이터 정확성 확인 (0) | 2021.01.25 |
---|---|
[Flutter/Project](Instagram Clone) TextFormField() 회원가입 레이아웃 (0) | 2021.01.24 |
[Flutter/Project](Instagram Clone) FadeTransition() 화면 전환 애니메이션 (0) | 2021.01.24 |
[Flutter/Project](Instagram Clone) AnimatedIcon (0) | 2021.01.23 |
[Flutter/Project](Instagram Clone) Positioned 위젯 (0) | 2021.01.23 |
Comments