Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fake Data Has To Be Put In Model To Show Proper Loading Effect. #6

Open
engrusmanch opened this issue Oct 18, 2023 · 0 comments
Open

Comments

@engrusmanch
Copy link

`import 'package:dis_mobile_app/core/enums.dart';
import 'package:dis_mobile_app/features/wallet_screen/presentation/pages/add_payment_method_c.dart';
import 'package:flutter/material.dart';
import 'package:redacted/redacted.dart';

class PaymentMethods extends StatelessWidget {
final String? company;
final String? lastFourDigits;
final bool redact;
const PaymentMethods(
{super.key, required this.company, required this.lastFourDigits,required this.redact});

@OverRide
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
border: Border.all(
width: 2, color: Theme.of(context).colorScheme.outlineVariant),
borderRadius: BorderRadius.circular(12)),
child: ListTile(
// contentPadding: EdgeInsets.symmetric(vertical: 16,horizontal: 24),
leading: Image.asset("assets/images/cards/$company.png",
height: 24, width: 38).redacted(context: context,redact: redact),
trailing: IconButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) =>
AddEditPaymentMethod(opType: OperationType.edit)));
},
icon: Icon(
Icons.edit_outlined,
color: Theme.of(context).colorScheme.onSurface,
)).redacted(context: context, redact: redact),
title: Text("**** **** **** $lastFourDigits").redacted(context: context, redact: redact),
titleTextStyle: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: Theme.of(context).colorScheme.onSurface),
));
}
}
`
This is my Payment method widget which was not redacted until i put some fake data Like
List userCards = [
UserCard(id: "0", brand: "visa", last4: "1234", expiryDate: DateTime(1999)),
UserCard(id: "1", brand: "visa", last4: "1234", expiryDate: DateTime(1999)),
UserCard(id: "2", brand: "visa", last4: "1234", expiryDate: DateTime(1999)),
UserCard(id: "3", brand: "visa", last4: "1234", expiryDate: DateTime(1999)),
];
I passed fake data from screen to solve the issue is it mandatory or is there any way out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant