Skip to content

Commit

Permalink
Added WarningCardsListView
Browse files Browse the repository at this point in the history
  • Loading branch information
luizdebem committed Oct 13, 2021
1 parent cbceb92 commit ce08acb
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 27 deletions.
54 changes: 27 additions & 27 deletions lib/components/ActionsListView.dart
Expand Up @@ -2,36 +2,36 @@ import 'package:flutter/material.dart';
import 'package:luizdebank/components/LabeledIconButton.dart';

class ActionsListView extends StatelessWidget {
const ActionsListView({Key key}) : super(key: key);
ActionsListView({Key key}) : super(key: key);

@override
Widget build(BuildContext context) {
List<String> actions = [
"Pix",
"Pagar",
"Transferir",
"Depositar",
"Pegar emprestado",
"Recarga de celular",
"Cobrar",
"Doação",
"Transferir internac.",
"Encontrar atalhos",
];
final List<String> actions = [
"Pix",
"Pagar",
"Transferir",
"Depositar",
"Pegar emprestado",
"Recarga de celular",
"Cobrar",
"Doação",
"Transferir internac.",
"Encontrar atalhos",
];

List<IconData> icons = [
Icons.monetization_on_outlined,
Icons.receipt_outlined,
Icons.payments_outlined,
Icons.payments_outlined,
Icons.card_giftcard_outlined,
Icons.smartphone_outlined,
Icons.payments_outlined,
Icons.favorite_border_outlined,
Icons.language_outlined,
Icons.help_outline,
];
final List<IconData> icons = [
Icons.monetization_on_outlined,
Icons.receipt_outlined,
Icons.payments_outlined,
Icons.payments_outlined,
Icons.card_giftcard_outlined,
Icons.smartphone_outlined,
Icons.payments_outlined,
Icons.favorite_border_outlined,
Icons.language_outlined,
Icons.help_outline,
];

@override
Widget build(BuildContext context) {
return Container(
height: 150,
child: ListView.separated(
Expand Down
106 changes: 106 additions & 0 deletions lib/components/WarningCardsListView.dart
@@ -0,0 +1,106 @@
import 'package:flutter/material.dart';

class WarningCardsListView extends StatelessWidget {
WarningCardsListView({Key key}) : super(key: key);

@override
Widget build(BuildContext context) {
final List<RichText> labels = [
RichText(
text: TextSpan(
text: 'Você tem até ',
style: TextStyle(
color: Colors.black,
fontSize: 12,
fontWeight: FontWeight.w300,
height: 1.4,
),
children: <TextSpan>[
TextSpan(
text: 'R\$ 25.000,00',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 12,
),
),
TextSpan(text: ' disponíveis para empréstimo.'),
],
),
),
RichText(
text: TextSpan(
text: 'Não parcelou e se arrependeu? ',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w300,
fontSize: 12,
height: 1.4,
),
children: <TextSpan>[
TextSpan(
text: 'Parcele suas compras no app.',
style: TextStyle(
color: Colors.black,
fontSize: 12,
fontWeight: FontWeight.w300,
),
),
],
),
),
RichText(
text: TextSpan(
text: 'Salve seus amigos da burocracia. ',
style: TextStyle(
color: Colors.black,
fontSize: 12,
height: 1.4,
fontWeight: FontWeight.w300,
),
children: <TextSpan>[
TextSpan(
text: 'Faça um convite para o Nubank.',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w300,
fontSize: 12,
),
),
],
),
),
];

return Container(
height: 70,
child: ListView.separated(
scrollDirection: Axis.horizontal,
padding: EdgeInsets.symmetric(horizontal: 22.0),
itemCount: labels.length,
itemBuilder: (BuildContext context, int index) {
return Container(
width: 290,
child: MaterialButton(
padding: EdgeInsets.only(
left: 22.0,
right: 70,
bottom: 10.0,
),
color: Colors.grey[200],
elevation: 0.0,
highlightElevation: 0.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
onPressed: () {},
child: labels[index],
),
);
},
separatorBuilder: (BuildContext context, int itemIndex) {
return SizedBox(width: 12);
},
),
);
}
}
3 changes: 3 additions & 0 deletions lib/screens/HomeScreen.dart
Expand Up @@ -7,6 +7,7 @@ import 'package:luizdebank/components/EmprestimoButton.dart';
import 'package:luizdebank/components/HealthInsuranceButton.dart';
import 'package:luizdebank/components/HomeHeader.dart';
import 'package:luizdebank/components/MyCardsButton.dart';
import 'package:luizdebank/components/WarningCardsListView.dart';

class HomeScreen extends StatefulWidget {
// routeName implícito "/" em main.dart
Expand Down Expand Up @@ -56,6 +57,8 @@ class _HomeScreenState extends State<HomeScreen> {
ActionsListView(),
MyCardsButton(),
SizedBox(height: 20),
WarningCardsListView(),
SizedBox(height: 20),
CreditCardButton(),
EmprestimoButton(),
HealthInsuranceButton(),
Expand Down

0 comments on commit ce08acb

Please sign in to comment.