Change image assets from png to webp

This commit is contained in:
Moe Poi ~ 2020-09-07 23:09:30 +07:00
parent 993dccf15f
commit 071fd0c30b
23 changed files with 19 additions and 19 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

BIN
lib/assets/creator.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

BIN
lib/assets/drawer-top.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

BIN
lib/assets/image-error.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 413 KiB

BIN
lib/assets/splash.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -16,7 +16,7 @@ class MainDrawer extends StatelessWidget {
// color: Colors.amberAccent,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('lib/assets/drawer-top.jpg'),
image: AssetImage('lib/assets/drawer-top.webp'),
fit: BoxFit.fill),
),
),
@ -61,7 +61,7 @@ class MainDrawer extends StatelessWidget {
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('lib/assets/drawer-bottom.png'))),
image: AssetImage('lib/assets/drawer-bottom.webp'))),
))
],
)),

View file

@ -83,7 +83,7 @@ class _SearchState extends State<Search> {
child: CachedNetworkImage(
imageUrl: data[index]['image'],
placeholder: (context, url) => CupertinoActivityIndicator(),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.jpg'),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.webp'),
fadeOutDuration: Duration(milliseconds: 5),
imageBuilder: (context, imageProvider) => Container(
width: 400,

View file

@ -131,7 +131,7 @@ class _SplashScreenState extends State<SplashScreen> {
height: 200,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('lib/assets/splash.png')
image: AssetImage('lib/assets/splash.webp')
)
),
),

View file

@ -30,7 +30,7 @@ class _AboutState extends State<About> {
width: 160,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('lib/assets/creator.jpg'),
image: AssetImage('lib/assets/creator.webp'),
fit: BoxFit.scaleDown
),
),

View file

@ -44,7 +44,7 @@ class AnimeDetail extends StatelessWidget {
placeholder: (context, url) =>
CupertinoActivityIndicator(),
errorWidget: (context, url, error) =>
Image.asset('lib/assets/image-error.jpg'),
Image.asset('lib/assets/image-error.webp'),
fadeOutDuration: Duration(milliseconds: 5),
imageBuilder: (context, imageProvider) => Container(
width: 120,

View file

@ -87,7 +87,7 @@ class _AnimeState extends State<Anime>
child: CachedNetworkImage(
imageUrl: listData[index]['image'],
placeholder: (context, url) => CupertinoActivityIndicator(),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.jpg'),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.webp'),
fadeOutDuration: Duration(milliseconds: 5),
imageBuilder: (context, imageProvider) => Container(
width: 400,

View file

@ -39,7 +39,7 @@ class BatchDetail extends StatelessWidget {
child: CachedNetworkImage(
imageUrl: data['image'],
placeholder: (context, url) => CupertinoActivityIndicator(),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.jpg'),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.webp'),
fadeOutDuration: Duration(milliseconds: 5),
imageBuilder: (context, imageProvider) => Container(
width: 200,
@ -83,7 +83,7 @@ class BatchDetail extends StatelessWidget {
child: CachedNetworkImage(
imageUrl: data['image'],
placeholder: (context, url) => CupertinoActivityIndicator(),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.jpg'),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.webp'),
fadeOutDuration: Duration(milliseconds: 5),
imageBuilder: (context, imageProvider) => Container(
width: 120,

View file

@ -90,7 +90,7 @@ class _BatchState extends State<Batch>
child: CachedNetworkImage(
imageUrl: listData[index]['image'],
placeholder: (context, url) => CupertinoActivityIndicator(),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.jpg'),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.webp'),
fadeOutDuration: Duration(milliseconds: 5),
imageBuilder: (context, imageProvider) => Container(
width: 400,

View file

@ -107,7 +107,7 @@ class _EpisodeDetailState extends State<EpisodeDetail> {
child: CachedNetworkImage(
imageUrl: data['image'],
placeholder: (context, url) => CupertinoActivityIndicator(),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.jpg'),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.webp'),
fadeOutDuration: Duration(milliseconds: 5),
imageBuilder: (context, imageProvider) => Container(
width: 120,

View file

@ -71,7 +71,7 @@ class MovieDetail extends StatelessWidget {
child: CachedNetworkImage(
imageUrl: data['image'],
placeholder: (context, url) => CupertinoActivityIndicator(),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.jpg'),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.webp'),
fadeOutDuration: Duration(milliseconds: 5),
imageBuilder: (context, imageProvider) => Container(
width: 120,

View file

@ -87,7 +87,7 @@ class _MovieState extends State<Movie>
child: CachedNetworkImage(
imageUrl: listData[index]['image'],
placeholder: (context, url) => CupertinoActivityIndicator(),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.jpg'),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.webp'),
fadeOutDuration: Duration(milliseconds: 5),
imageBuilder: (context, imageProvider) => Container(
width: 400,

View file

@ -87,7 +87,7 @@ class _NewReleaseState extends State<NewRelease>
child: CachedNetworkImage(
imageUrl: listData[index]['image'],
placeholder: (context, url) => CupertinoActivityIndicator(),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.jpg'),
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.webp'),
fadeOutDuration: Duration(milliseconds: 5),
imageBuilder: (context, imageProvider) => Container(
width: 400,

View file

@ -53,11 +53,11 @@ flutter:
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- lib/assets/splash.png
- lib/assets/drawer-top.jpg
- lib/assets/drawer-bottom.png
- lib/assets/creator.jpg
- lib/assets/image-error.jpg
- lib/assets/splash.webp
- lib/assets/drawer-top.webp
- lib/assets/drawer-bottom.webp
- lib/assets/creator.webp
- lib/assets/image-error.webp
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see