Flutter Tutorials

Flutter app development tutorials


flutter – Card with image

main.dart


import 'package:flutter/material.dart';

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

bodyContent(){
  return SizedBox(
      width: double.infinity,
      height: 250,
      child: Card(
          elevation: 6,
          margin: const EdgeInsets.all(12),
          child: Padding(
              padding: const EdgeInsets.all(16),
              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