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 |
Tags
- 변수
- BottomNavigationBar
- Kotlin
- 안드로이드
- 회원가입
- dart
- UserAccountsDrawerHeader
- 1과목
- Null Safety
- setState
- 함수
- non-nullable
- firebase
- 이메일
- 정보처리기사
- Android
- flutter
- swift
- java
- firebase_auth
- 로그인
- Provider
- auth
- StatefulWidget
- GetX
- 상태관리
- 안드로이드 스튜디오
- go_router
- IOS
- Cocoa touch Framework
Archives
- Today
- Total
앱 개발 공부방
Flutter-AnimatedOpacity 본문
728x90
AnimatedOpacity
Opacity는 투명도로 애니메이션으로 투명도를 조절하는 것입니다
import 'package:flutter/material.dart';
class MyAnimatedOpacity extends StatefulWidget {
@override
_MyAnimatedOpacityState createState() => _MyAnimatedOpacityState();
}
class _MyAnimatedOpacityState extends State<MyAnimatedOpacity> {
bool _visible=true;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('AnimatedOpacity'),
),
body:Center(
child: AnimatedOpacity(opacity: _visible ? 1.0 : 0.0,
duration: Duration(milliseconds: 500),
child: Container(
width: 200,
height: 200,
color: Colors.green,
),
),
),
floatingActionButton:
FloatingActionButton(child: Icon(Icons.play_arrow),onPressed: (){
setState(() {
_visible=!_visible;
});
}),
);
}
}
위 코드처럼 치시고 실행하고 버튼클릭시 투명해졌다가 다시 누르면 다시 보이는 걸 볼 수 있습니다.
728x90
'FLUTTER' 카테고리의 다른 글
Flutter-TabBar (0) | 2020.10.31 |
---|---|
Flutter-Drawer (0) | 2020.10.25 |
Flutter-AnimatedContainer (0) | 2020.10.23 |
Flutter-BottomNavigationBar (0) | 2020.10.23 |
Flutter-Column , text에 int형 넣기 (0) | 2020.10.21 |
Comments