odoo_image_show 2.1.0 copy "odoo_image_show: ^2.1.0" to clipboard
odoo_image_show: ^2.1.0 copied to clipboard

A Flutter package to display profile images from the Odoo API with progress indication, error handling, and customization.

odoo_image_show #

odoo_image_show is a Flutter package designed to display profile images from Odoo APIs (v17, v18, v19) with ease.
It uses dio for efficient networking and automatically extracts authentication details (like session_id and access_token) from the provided image URL.

Features #

  • Unified Widget: One widget (OdooImage) for all Odoo versions.
  • Automatic Auth Extraction: Extracts session_id and access_token directly from the URL query parameters.
  • Customizable: Set image size, border color, fallback icons, and custom loading/error builders.
  • Progress Indication: Built-in progress indicator while the image is downloading.
  • Backward Compatible: Maintains OdooProfileImage and Odoo19ProfileImage as deprecated aliases.

Getting Started #

Add the dependency in your pubspec.yaml:

dependencies:
  odoo_image_show: ^2.1.0

Then run:

flutter pub get

Usage #

Simplified Usage (Automatic Auth) #

Just pass the URL containing the session_id or access_token:

import 'package:odoo_image_show/odoo_image_show.dart';

OdooImage(
  imageUrl: "https://example.com/web/image/res.users/1/image_128?session_id=your_session_id",
  size: 160,
)

Customization #

OdooImage(
  imageUrl: imageUrl, // e.g. "https://domain.com/image?access_token=..."
  size: 128,
  borderColor: Colors.blue,
  iconColor: Colors.grey,
  loadingBuilder: (context) => const CircularProgressIndicator(),
  errorBuilder: (context) => const Icon(Icons.error),
)

Example App #

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

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: Center(
          child: OdooImage(
            imageUrl: "https://example.com/web/image/res.users/1/image_128?session_id=XYZ",
          ),
        ),
      ),
    );
  }
}

Additional Information #

  • Error Handling: Displays a fallback icon or a custom widget if fetching fails.
  • Loading: Shows a progress indicator by default.
  • Dio: Uses the dio package for all network requests.

License #

MIT License © 2026 Md. Rahul Reza

1
likes
160
points
241
downloads

Publisher

verified publisherrahulreza.com

Weekly Downloads

A Flutter package to display profile images from the Odoo API with progress indication, error handling, and customization.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

dio, flutter, intl, path_provider

More

Packages that depend on odoo_image_show