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
- multiprovider
- permission
- divider
- transform
- swift 문법
- globalkey
- Firebase
- runTransaction
- provider
- changenotifier
- consumer
- signout
- setstate
- enum
- Snapshot
- datetime
- Stream
- ListView.builder
- 문법
- user
- switch
- platformexception
- Swift
- borderRadius
- Navigator
- changenotifierprovider
- Camera
- snackbar
- controller
- reference
Archives
- Today
- Total
코딩하는 제리
[Flutter/Project](Instagram Clone) 유저 프로필 화면 만들기01 본문
Flutter/Project_InstaClone(완)
[Flutter/Project](Instagram Clone) 유저 프로필 화면 만들기01
JerryCho 2021. 1. 19. 17:42
소스코드
// profile_screen.dart
import 'package:flutter/material.dart';
import 'package:flutter_project_IJ/constants/common_size.dart';
class ProfileScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey[100],
body: SafeArea(
// SafeArea() 디바이스 상단바와 거리를 띄움
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_appbar(),
Expanded(
// CustomScrollView()가 빈공간을 차지하도록 해야 표시됨.
child: CustomScrollView(
// CustomScrollView() 스크롤 가능한 뷰들을 섞어서 사용할 때
slivers: <Widget> [
SliverList(
delegate: SliverChildListDelegate([
_username(),
_userBio(),
_editProfileBtn(),
]),
)
],
),
),
],
),
),
);
}
Widget _editProfileBtn() {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: common_gap),
child: SizedBox(
height: 24,
child: OutlineButton(
onPressed: () {},
borderSide: BorderSide(color: Colors.black45),
shape: RoundedRectangleBorder(
// RoundedRectangleBorder() 둥근 모서리 직사각형
borderRadius: BorderRadius.circular(6),
),
child: Text(
'Edit Profile',
style: TextStyle(fontWeight: FontWeight.bold),
),
),
),
);
}
Widget _username() {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: common_gap),
child: Text(
'username',
style: TextStyle(fontWeight: FontWeight.bold),
),
);
}
Widget _userBio() {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: common_gap),
child: Text(
'username',
style: TextStyle(fontWeight: FontWeight.w400),
),
);
}
Row _appbar() {
return Row(
children: [
SizedBox(width: 44),
Expanded(
child: Text(
'jerrycho',
textAlign: TextAlign.center,
),
),
IconButton(
icon: Icon(Icons.menu),
onPressed: () {},
)
],
);
}
}
'Flutter > Project_InstaClone(완)' 카테고리의 다른 글
[Flutter/Project](Instagram Clone) enum의 간단한 사용 (0) | 2021.01.20 |
---|---|
[Flutter/Project](Instagram Clone) 탭 버튼 만들기 (0) | 2021.01.20 |
[Flutter/Project](Instagram Clone) 프로필 화면 상단바 만들기 (0) | 2021.01.19 |
[Flutter/Project](Instagram Clone) 아이콘, 아이디, 게시글 내용 만들기 (0) | 2021.01.19 |
[Flutter/Project](Instagram Clone) 포스트 액션 버튼 만들기 (0) | 2021.01.19 |
Comments