universal_images_plus 0.0.1
universal_images_plus: ^0.0.1 copied to clipboard
A Flutter package that provides a universal image widget supporting network, asset, SVG, and fallback images with customizable shapes and placeholders.
example/lib/main.dart
import 'package:example/universal_images.dart';
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(
home: Scaffold(
appBar: AppBar(title: const Text("Universal Images Example")),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const UniversalImage(
imagePath: 'https://fastly.picsum.photos/id/235/200/200.jpg?hmac=YnNmt_uSm-7R-s3j5I_di0aCpJqnfzRzeAzZCV-SS4w',
height: 100,
width: 100,
isCircular: true,
),
const SizedBox(height: 20),
const UniversalImage(
imagePath: 'assets/images/local_image.png',
height: 80,
width: 80,
),
const SizedBox(height: 20),
const UniversalImage(
imagePath: 'assets/images/local_image.png',
height: 60,
width: 60,
borderRadius: 0,
),
const SizedBox(height: 20),
const UniversalImage(
imagePath:
'data:image/png;base64,iVBORw0K...', // Base64
height: 50,
width: 50,
),
],
),
),
),
);
}
}