Flutter ClipOval Widget – Circle Image



The ClipOval widget has a simple constructor that takes a child widget, an optional clipper, and an optional clip behavior as parameters. The child widget can be any widget that you want to display inside the oval shape, such as an image, text, or container.

The clipper parameter allows you to customize the size and position of the oval shape by implementing a custom class that extends CustomClipper. The clip behavior parameter controls how Flutter clips the object, and it can be one of these values: Clip.hardEdge, Clip.antiAlias, or Clip.antiAliasWithSaveLayer.

ClipOval Widget example:

ClipOval(
          child: Image.network(
            "https://cdn.pixabay.com/photo/2022/08/17/08/58/sun-has-7391959_960_720.jpg",
            fit: BoxFit.cover, // if you not use fit then not show image clearly...
          ),
        ),

Flutter ClipOval Widget Example

ClipOval

Tutorial source code example:

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(body: HomePage()),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    // Welcome to my channel.....
    // How any image .... circle using ClipOval widget....let's started....
    return Container(
      alignment: Alignment.center,
      padding: EdgeInsets.all(15),
      child: SizedBox(
        width: 250,
        height: 250,
        child: ClipOval(
          child: Image.network(
            "https://cdn.pixabay.com/photo/2022/08/17/08/58/sun-has-7391959_960_720.jpg",
            fit: BoxFit.cover, // if you not use fit then not show image clearly...
          ),
        ),
      ),

      // here already show image.. now circle it....
      // you can ...change this size usign .... SIzebox widget...
      // Thank you.... Please SUBSCIBE me.... code link in the description below...
    );
  }
}
  • How to Conduct YouTube Keyword Research Easily?
    Introduction YouTube is the second largest search engine in the world, making it a valuable platform for content creators and businesses alike. To maximize your visibility and reach on YouTube, it is crucial to conduct proper keyword research. By identifying the right keywords, you can optimize your videos for search and increase your chances of …

    Read more …

  • How to upgrade the Dart SDK version in flutter
    If you’re a Flutter developer, you know how important it is to stay up-to-date with the latest version of the Dart SDK. Upgrading the Dart SDK ensures that you have access to the latest features, bug fixes, and performance improvements. Step 1: Check Your Current Dart SDK Version Before you begin the upgrade process, it’s …

    Read more …

  • Why Do Advertisers Use Testimonials?
    In the ever-competitive business landscape, nurturing strong connections with your customers remains paramount for enhancing your credibility and positioning yourself as an industry authority. Establishing credibility is the bedrock upon which trust is built, ultimately translating into increased sales. To bolster your company’s credibility, integrating testimonial advertising into your marketing strategy is essential. So, what …

    Read more …

  • How To Earn $5 Fast Method!
    Looking to boost your income by $25 in less than an hour? This isn’t the start of a clichéd sales pitch; it’s about discovering several quick and simple ways to earn $5 online within minutes. For instance, you can make five bucks by completing tasks such as taking brief surveys, participating in short website usability …

    Read more …

  • What Does BMF Mean On TikTok? Latest Social Media Acronyms
    In the fast-paced world of social media, acronyms are the language of choice, enabling users to communicate swiftly without the need for lengthy phrases. While classics like LOL and OMG are still in use, the younger generation on TikTok has introduced a new acronym into the mix: BMF. So, what exactly does BMF mean, and …

    Read more …

Read also, Flutter Card Widget Ui Design.

The ClipOval widget is useful for creating interesting effects with images or other widgets.

Leave a Comment