protonimage 1.0.8 protonimage: ^1.0.8 copied to clipboard
Flutter package for smooth image loading, featuring shimmer and fade-in effects, ensuring a seamless user experience.
example/protonimage_example.dart
import 'package:flutter/material.dart';
import 'package:protonimage/protonimage.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Proton Image Example',
home: Scaffold(
appBar: AppBar(
title: Text('Proton Image Example'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Quick Use
ProtonImage(
path: 'https://example.com/image1.jpg',
height: 200,
radius: 20,
),
SizedBox(height: 20),
//Advance Use
ProtonImage(
path: 'https://example.com/image2.jpg',
height: 200,
radius: 20,
aspectRatio: 16 / 9,
baseColor: Colors.blue.withOpacity(0.3),
highlightColor: Colors.blue.withOpacity(0.6),
),
SizedBox(height: 20),
//Image Overlay
ProtonImage(
path: 'https://example.com/image2.jpg',
height: 200,
radius: 20,
aspectRatio: 16 / 9,
baseColor: Colors.blue.withOpacity(0.3),
highlightColor: Colors.blue.withOpacity(0.6),
overlayGradient: LinearGradient(
begin: Alignment.bottomRight,
stops: const [0.1, 0.8],
colors: [
Colors.black45.withOpacity(.1),
Colors.black45.withOpacity(.0),
],
),
),
SizedBox(height: 20),
//Transparent
ProtonImage(
path: 'https://example.com/image3.jpg',
height: 200,
radius: 20,
backgroundColor: Colors.transparent,
),
],
),
),
),
);
}
}