-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/add transaction component (#12)
- Loading branch information
Showing
5 changed files
with
239 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import 'package:app_flutter/configs/themes.dart'; | ||
import 'package:badges/badges.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class ButtonOptionBadge extends StatelessWidget { | ||
final IconData iconData; | ||
final String text; | ||
final int badgeCount; | ||
final Function()? onPressed; | ||
|
||
const ButtonOptionBadge({ | ||
super.key, | ||
required this.iconData, | ||
required this.text, | ||
this.badgeCount = 0, | ||
this.onPressed, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return InkWell( | ||
onTap: onPressed, | ||
highlightColor: Colors.transparent, | ||
borderRadius: BorderRadius.circular(20), | ||
child: Ink( | ||
width: 90, | ||
height: 90, | ||
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
SizedBox( | ||
child: Badge( | ||
showBadge: badgeCount > 0, | ||
badgeColor: red, | ||
badgeContent: Text( | ||
badgeCount < 10 ? "0$badgeCount" : "$badgeCount", | ||
style: const TextStyle( | ||
color: Colors.white, | ||
fontSize: 10, | ||
fontWeight: FontWeight.w800, | ||
), | ||
), | ||
child: Icon(iconData, size: 35), | ||
), | ||
), | ||
const SizedBox(height: 4), | ||
Text( | ||
text, | ||
maxLines: 2, | ||
textAlign: TextAlign.center, | ||
style: const TextStyle( | ||
color: grey, | ||
fontWeight: FontWeight.w800, | ||
fontSize: 10, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
import 'package:app_flutter/components/button_option_badge.dart'; | ||
import 'package:app_flutter/configs/themes.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class TransactionPainel extends StatelessWidget { | ||
const TransactionPainel({ | ||
super.key, | ||
this.radius = 20, | ||
required this.icon, | ||
required this.title, | ||
}); | ||
|
||
final double radius; | ||
final IconData icon; | ||
final String title; | ||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 10), | ||
child: Ink( | ||
width: double.infinity, | ||
decoration: BoxDecoration( | ||
color: Colors.white, | ||
borderRadius: BorderRadius.circular(radius), | ||
boxShadow: const [ | ||
BoxShadow( | ||
color: Color.fromRGBO(0, 0, 0, 0.05), | ||
blurRadius: 20, | ||
), | ||
], | ||
), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
Ink( | ||
decoration: BoxDecoration( | ||
color: lightGrey, | ||
borderRadius: BorderRadius.only( | ||
topLeft: Radius.circular(radius), | ||
topRight: Radius.circular(radius), | ||
), | ||
), | ||
child: Padding( | ||
padding: const EdgeInsets.only( | ||
left: 20, | ||
top: 10, | ||
bottom: 10, | ||
right: 10, | ||
), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Row( | ||
children: [ | ||
Icon( | ||
icon, | ||
color: Colors.black, | ||
size: 32, | ||
), | ||
const SizedBox(width: 10), | ||
Text( | ||
title, | ||
style: const TextStyle( | ||
color: Colors.black, | ||
fontSize: 20, | ||
fontFamily: "Avenir", | ||
fontWeight: FontWeight.w800, | ||
), | ||
), | ||
], | ||
), | ||
InkWell( | ||
borderRadius: BorderRadius.circular(20), | ||
onTap: () {}, | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric( | ||
vertical: 10, | ||
horizontal: 10, | ||
), | ||
child: Row( | ||
children: const [ | ||
Text( | ||
'Mostrar Tudo', | ||
style: TextStyle( | ||
color: grey, | ||
fontSize: 14, | ||
fontFamily: "Avenir", | ||
fontWeight: FontWeight.w800, | ||
), | ||
), | ||
SizedBox(width: 10), | ||
Icon( | ||
Icons.arrow_forward_ios_rounded, | ||
color: grey, | ||
size: 18, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
ButtonOptionBadge( | ||
iconData: Icons.book_rounded, | ||
text: 'Pedidos Recebidos', | ||
onPressed: () {}, | ||
badgeCount: 10, | ||
), | ||
ButtonOptionBadge( | ||
iconData: Icons.book_rounded, | ||
text: 'Pedidos Feitos', | ||
onPressed: () {}, | ||
badgeCount: 9, | ||
), | ||
ButtonOptionBadge( | ||
iconData: Icons.book_rounded, | ||
text: 'Andamento', | ||
onPressed: () {}, | ||
), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters