GithubHelp home page GithubHelp logo

flutter_custom_image's Introduction

👉 A versatile Flutter package for displaying images with various sources, including assets, SVGs, and
network images. The `ImageViewer` widget simplifies the integration of different image types,
providing customization options for dimensions, error handling, and border-radius.

👉 Parameters

imagePath Path to the image, either an asset, SVG, or network URL ✅
imageType Type of the image (ImageType.asset, ImageType.svg, ImageType.network) ✅
width and height Dimensions of the image ❌
boxFit BoxFit for the image ❌
errorIcon Icon to display in case of loading errors ❌
imageColor Color to apply to the image ❌
alignment Alignment of the image within its container ❌ 

topLeftRadius, 

topRightRadius, 

bottomLeftRadius, 

bottomRightRadius

Border radiius for clipping ❌

👉 Show me the code 👀

enum ImageType { asset, svg, network }
ImageViewer(
  imagePath: 'your_image_path',
  imageType: ImageType.asset, // Change to your desired ImageType
  // Add other optional parameters for customization
)
class MenuExample extends StatefulWidget {
  @override
  _MenuExampleState createState() => _MenuExampleState();
}
class _MenuExampleState extends State<MenuExample> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: ImageViewer(
          imagePath: 'http://via.placeholder.com/200x200',
          imageType: ImageType.network,
          width: 200,
          height: 200,
          boxFit: BoxFit.cover,
          errorIcon: Icons.error_outline,
          errorIconColor: Colors.blueGrey,
          imageColor: Colors.blue,
          alignment: Alignment.center,
          topLeftRadius: 10,
          topRightRadius: 20,
          bottomLeftRadius: 30,
          bottomRightRadius: 40,
        ),
      ),
    );
  }
}

flutter_custom_image's People

Contributors

haresh-v521 avatar

Stargazers

 avatar Palash Pandya avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.