Skip to content

Instantly share code, notes, and snippets.

@victor-carv
Created August 22, 2022 15:59
Show Gist options
  • Save victor-carv/015d1000024ad83d7611f47c5f051e5f to your computer and use it in GitHub Desktop.
Save victor-carv/015d1000024ad83d7611f47c5f051e5f to your computer and use it in GitHub Desktop.
flutter-card-error
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
static const String _title = 'Flutter Code Sample';
@override
Widget build(BuildContext context) {
return MaterialApp(
title: _title,
home: Scaffold(
appBar: AppBar(title: const Text(_title)),
body: const MyStatelessWidget(),
),
);
}
}
class MyStatelessWidget extends StatelessWidget {
const MyStatelessWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const ListTile(
leading: Icon(Icons.error),
title: Text('New page detected!'),
subtitle: Text('Would you like to discard the current results and scan this page for addresses?'),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
TextButton(
child: const Text('Cancel'),
onPressed: () {/* ... */},
),
const SizedBox(width: 8),
TextButton(
child: const Text('Scan'),
onPressed: () {/* ... */},
),
const SizedBox(width: 8),
],
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment