Skip to content

Instantly share code, notes, and snippets.

@prakhart111
Created February 4, 2025 12:38
Show Gist options
  • Save prakhart111/a8eb47a53863d1941f8711cc2738e065 to your computer and use it in GitHub Desktop.
Save prakhart111/a8eb47a53863d1941f8711cc2738e065 to your computer and use it in GitHub Desktop.
Snippet created via Next.js API
// Dualite Generated Code
```dart
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Card Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Card Demo'),
),
body: Center(
child: Card(
elevation: 4,
child: Container(
width: 300,
padding: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
'Card Title',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 8),
const Text(
'This is some sample content that goes in the card. You can put any widgets here.',
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {},
child: const Text('Button'),
),
],
),
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment