Skip to content

Instantly share code, notes, and snippets.

@mirkancal
Created December 17, 2023 13:23
Show Gist options
  • Save mirkancal/180649b62ceb378d8f0eb695c1365f65 to your computer and use it in GitHub Desktop.
Save mirkancal/180649b62ceb378d8f0eb695c1365f65 to your computer and use it in GitHub Desktop.
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: Colors.white,
body: Center(
child: DealCard(
title: 'Yearly',
saleAmount: '25',
previousPrice: '145.99',
currentPrice: '89.99',
),
),
),
);
}
}
class DealCard extends StatelessWidget {
final String title;
final String saleAmount;
final String previousPrice;
final String currentPrice;
const DealCard({
Key? key,
required this.title,
required this.saleAmount,
required this.previousPrice,
required this.currentPrice,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15.0),
border: Border.all(color: Colors.blue, width: 2.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 1,
blurRadius: 5,
offset: Offset(0, 3),
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(Icons.check_circle, color: Colors.blue),
SizedBox(width: 8.0),
Text(
title,
style: TextStyle(
color: Colors.black,
fontSize: 16.0,
fontWeight: FontWeight.bold,
),
),
],
),
Row(
children: [
Text(
'%$saleAmount SALE',
style: TextStyle(
color: Colors.blue,
fontSize: 12.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(width: 8.0),
Text(
'\$$previousPrice',
style: TextStyle(
color: Colors.grey,
fontSize: 14.0,
decoration: TextDecoration.lineThrough,
),
),
SizedBox(width: 8.0),
Text(
'\$$currentPrice',
style: TextStyle(
color: Colors.black,
fontSize: 16.0,
fontWeight: FontWeight.bold,
),
),
],
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment