[무작정 플러터 강의노트] 07 프로필 화면 만들기

1
2
3
4
5
6
7
# pubspec.yaml
dependencies:
flutter:
sdk: flutter
carousel_slider:
flutter_linkify:
url_launcher:
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// main.dart
import 'package:flutter/material.dart';
import 'package:netflix_clone_lecture_note/screen/home_screen.dart';
import 'package:netflix_clone_lecture_note/screen/more_screen.dart';
import 'package:netflix_clone_lecture_note/widget/bottom_bar.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
TabController controller;
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Bbongflix',
theme: ThemeData(
brightness: Brightness.dark,
primaryColor: Colors.black,
accentColor: Colors.white,
),
home: DefaultTabController(
length: 4,
child: Scaffold(
body: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: <Widget>[
HomeScreen(),
Container(
child: Center(
child: Text('search'),
),
),
Container(
child: Center(
child: Text('save'),
),
),
MoreScreen(),
],
),
bottomNavigationBar: Bottom(),
),
),
);
}
}
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// more_screen.dart
import 'package:flutter/material.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:url_launcher/url_launcher.dart';

class MoreScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
child: Center(
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 50),
child: CircleAvatar(
radius: 100,
backgroundImage: AssetImage('images/bbongflix_logo.png'),
),
),
Container(
padding: EdgeInsets.only(top: 15),
child: Text(
'TaeBbong',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
color: Colors.white),
),
),
Container(
padding: EdgeInsets.all(15),
width: 140,
height: 5,
color: Colors.red,
),
Container(
padding: EdgeInsets.all(10),
child: Linkify(
onOpen: (link) async {
if (await canLaunch(link.url)) {
await launch(link.url);
}
},
text: "https://github.com/TaeBbong",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
linkStyle: TextStyle(color: Colors.white),
),
),
Container(
padding: EdgeInsets.all(10),
child: FlatButton(
onPressed: () {},
child: Container(
color: Colors.red,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(
Icons.edit,
color: Colors.white,
),
SizedBox(
width: 10,
),
Text(
'프로필 수정하기',
style: TextStyle(color: Colors.white),
),
],
),
),
),
),
],
),
),
);
}
}

[무작정 플러터 강의노트] 07 프로필 화면 만들기

https://taebbong.github.io/2020/03/23/2020-03-23-bbongflix-lec07-post/

Author

TaeBbong Kwon

Posted on

2020-03-23

Updated on

2022-08-06

Licensed under

Comments