Flutter Tutorials

Flutter app development tutorials


flutter – Card rounded corners image

main.dart


import 'package:flutter/material.dart';

void main() {
  runApp(
      MaterialApp(
          theme: ThemeData(primarySwatch: Colors.blueGrey),
          home: Scaffold(
              appBar: AppBar(
                  title: const Text("Card Rounded Corners Image")
              ),
              body: bodyContent()
          )
      )
  );
}

bodyContent(){
  return SizedBox(
      width: double.infinity,
      height: 250,
      child: Card(
          elevation: 8,
          margin: const EdgeInsets.all(16),
          shape: const RoundedRectangleBorder(
              borderRadius: BorderRadius.all(Radius.circular(24))
          ),
          clipBehavior: Clip.antiAliasWithSaveLayer,
          child: Image.network(
              "https://picsum.photos/600",
              fit: BoxFit.cover
          )
      )
  );
}

More flutter tutorials



About Me

Flutter Developer

Design a site like this with WordPress.com
Get started