apptomate_custom_image 0.0.3 copy "apptomate_custom_image: ^0.0.3" to clipboard
apptomate_custom_image: ^0.0.3 copied to clipboard

A highly customizable image widget with support for both network and local assets, featuring advanced styling and interaction options.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:apptomate_custom_image/apptomate_custom_image.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home:  MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body:  Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            // Image with overlay and gestures
            CustomImage(
              imageUrl: 'https://fastly.picsum.photos/id/967/200/300.jpg?hmac=N516I7nonEwIoem47eN9JDOoQOXjDLqpDz98BaZz3qc',
              height: 180,
              width: 180,
              overlayWidget: Positioned(
                bottom: 10,
                child: Container(
                  padding: EdgeInsets.all(6),
                  color: Colors.black54,
                  child: Text('New', style: TextStyle(color: Colors.white)),
                ),
              ),
              onTap: () => print('Image tapped'),
            ),
            // Network Image Example
            SizedBox(height: 20),
            CustomImage(
              imageUrl: 'https://fastly.picsum.photos/id/967/200/300.jpg?hmac=N516I7nonEwIoem47eN9JDOoQOXjDLqpDz98BaZz3qc',
              height: 150,
              width: 150,
              borderRadius: 16,
              fit: BoxFit.cover,
              errorWidget: Icon(Icons.add),
              isNetworkImage: true,
            ),
            SizedBox(height: 20),
            // Asset Image Example
            CustomImage(
              imageUrl: 'assets/images/questionUpdateImg.png',
              height: 100,
              width: 100,
              borderRadius: 50,
              fit: BoxFit.contain,
              isNetworkImage: false,
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
140
points
44
downloads

Publisher

unverified uploader

Weekly Downloads

A highly customizable image widget with support for both network and local assets, featuring advanced styling and interaction options.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

cached_network_image, flutter

More

Packages that depend on apptomate_custom_image