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
- StateProvider
- 가공
- riverpid
- 정리
- 데이터
- Happy moment
- flutter
- FutureProvider
- flutter_secure_storage
- fetch
- StateNotifierProvider
- StreamProvider
- Flutter 상태관리
Archives
- Today
- Total
This Week's Record
[Flutter] 이미지화질조절 본문
자꾸 이미지가 저화질로 구현되서 이런저런 시도를 좀 해봤다.
더 좋은 방법이나 어떤 간단한 함수가 따로 있을 수도 있겠지만 우선 지금은 아래 방법에 만조쿠!
class ic24 extends StatelessWidget {
final String iconName;
ic24({Key? key, required this.iconName}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
width: 24,
height: 24,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/ic-${iconName}-24@3x.png"),
fit: BoxFit.cover)),
//decoration: BoxDecoration(image : DecorationImage(image: AssetImage("assets/photo1.png"))),
);
}
}
요롷고롬 재사용가능한 reusable 위젯을 만들고,
Image.asset('assets/ic-like-24.png'),
위의 이미지구현을
Container(
width: 24,
height: 24,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/ic-like-24@3x.png"),
fit: BoxFit.cover)),
//decoration: BoxDecoration(image : DecorationImage(image: AssetImage("assets/photo1.png"))),
);
위와같이 바꾸면 (위의 reusable wiget 를 활용하면 아래와 같음) 화질이 높아진다!!
ic24(iconName: 'more')