Slide 21
Slide 21 text
맛픽 (ma’at pick)
Flutter 개발기
@override
Widget build(BuildContext context) {
return Material(
color: Colors.transparent,
child: InkWell(
onTap: this.onPressed,
splashColor: const Color(0x40000000),
highlightColor: const Color(0x20000000),
child: Listener(
onPointerDown: (status) {
setState(() {
_isTapped = true;
});
},
onPointerUp: (status) {
setState(() {
_isTapped = false;
});
},
behavior: HitTestBehavior.translucent,
child: Container(
height: 60,
padding: EdgeInsets.only(top: 12, bottom: 12),
decoration: BoxDecoration(
border: Border.all(
color: _isTapped ? Colors.orange : Colors.white),
borderRadius: BorderRadius.circular(4)),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
new Image.asset(
'assets/icons/google_g_logo.png',
width: 34,
),
Padding(
padding: EdgeInsets.only(left: 24),
child: Text(
'Join with google',
style: TextStyle(
fontFamily: 'Oswald',
fontWeight: FontWeight.normal,
fontSize: 22,
color: Colors.white),
))
],
),
))),
);
}
setState(() {
_isTapped = true;
});
setState(() {
_isTapped = false;
});
_isTapped
? Colors.orange : Colors.white)
StatefulWidget의
setState()
01. UI Type
02. State
03. Code Structure
04. Native Component
05. Performance
00. Flutter