flutter_image_widget 0.0.2 flutter_image_widget: ^0.0.2 copied to clipboard
A new Flutter flutter_image_widget.
import 'package:example/src/utils/image_constant.dart';
import 'package:flutter/material.dart';
import 'package:flutter_image_widget/flutter_image_widget.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
home: WithAssets(),
);
}
}
class WithAssets extends StatelessWidget {
const WithAssets({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey,
body: Center(
child:
FlutterImageWidget(
height: 100,
width: 100,
imageAssetPath: ImageConstant.logo,
radius: BorderRadius.circular(20),
),
),
);
}
}
class WithUrl extends StatelessWidget {
const WithUrl({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child:
FlutterImageWidget(
height: 100,
width: 100,
url: "set_image_url_here",
radius: BorderRadius.circular(20),
),
),
);
}
}