webp 1.0.0+1 webp: ^1.0.0+1 copied to clipboard
Asset transformer for converting images into WebP files.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: _MyHomePage(),
);
}
}
class _MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: const Text('cwebp usage example'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [Image.asset('assets/images/example_image.png')],
),
),
);
}
}