Skip to content

Instantly share code, notes, and snippets.

@MelbourneDeveloper
Last active May 5, 2023 09:43
Show Gist options
  • Save MelbourneDeveloper/7ec38a9d1049e037c012bec865630dfc to your computer and use it in GitHub Desktop.
Save MelbourneDeveloper/7ec38a9d1049e037c012bec865630dfc to your computer and use it in GitHub Desktop.
Card Shape
import 'package:flutter/material.dart';
void main() => runApp(
MaterialApp(
theme: ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(seedColor: Colors.red)
.copyWith(surface: Colors.pink),
cardTheme: CardTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
),
debugShowCheckedModeBanner: false,
home: Builder(
builder: (context) => Scaffold(
body: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Card(
child: SizedBox(
width: 100,
height: 100,
),
),
Card(
shape: (Theme.of(context).cardTheme.shape
as RoundedRectangleBorder)
.copyWith(
borderRadius: BorderRadius.circular(16.0),
),
child: const SizedBox(
width: 100,
height: 100,
),
),
],
),
),
),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment