2023-05-26 21:21:16 +00:00
|
|
|
/*
|
|
|
|
* This file is part of Stack Wallet.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2023 Cypher Stack
|
|
|
|
* All Rights Reserved.
|
|
|
|
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
|
|
|
* Generated by Cypher Stack on 2023-05-26
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-12-21 18:03:23 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2024-05-23 00:37:06 +00:00
|
|
|
import 'paynym_card.dart';
|
|
|
|
import '../../../themes/stack_colors.dart';
|
|
|
|
import '../../../utilities/featured_paynyms.dart';
|
|
|
|
import '../../../utilities/util.dart';
|
|
|
|
import '../../../widgets/conditional_parent.dart';
|
|
|
|
import '../../../widgets/rounded_white_container.dart';
|
2022-12-21 18:03:23 +00:00
|
|
|
|
|
|
|
class FeaturedPaynymsWidget extends StatelessWidget {
|
2022-12-21 23:02:14 +00:00
|
|
|
const FeaturedPaynymsWidget({
|
|
|
|
Key? key,
|
|
|
|
required this.walletId,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
final String walletId;
|
2022-12-21 18:03:23 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final entries = FeaturedPaynyms.featured.entries.toList(growable: false);
|
2023-01-04 18:44:35 +00:00
|
|
|
final isDesktop = Util.isDesktop;
|
2022-12-21 18:03:23 +00:00
|
|
|
|
2023-01-04 18:44:35 +00:00
|
|
|
return ConditionalParent(
|
|
|
|
condition: !isDesktop,
|
|
|
|
builder: (child) => RoundedWhiteContainer(
|
|
|
|
padding: const EdgeInsets.all(0),
|
|
|
|
child: child,
|
|
|
|
),
|
2022-12-21 18:03:23 +00:00
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
for (int i = 0; i < entries.length; i++)
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
if (i > 0)
|
2023-01-04 18:44:35 +00:00
|
|
|
isDesktop
|
|
|
|
? const SizedBox(
|
|
|
|
height: 10,
|
|
|
|
)
|
|
|
|
: Container(
|
|
|
|
color: Theme.of(context)
|
|
|
|
.extension<StackColors>()!
|
|
|
|
.backgroundAppBar,
|
|
|
|
height: 1,
|
|
|
|
),
|
2023-01-04 20:57:29 +00:00
|
|
|
ConditionalParent(
|
|
|
|
condition: isDesktop,
|
|
|
|
builder: (child) => RoundedWhiteContainer(
|
|
|
|
padding: const EdgeInsets.all(0),
|
|
|
|
borderColor: Theme.of(context)
|
|
|
|
.extension<StackColors>()!
|
|
|
|
.backgroundAppBar,
|
|
|
|
child: child,
|
|
|
|
),
|
|
|
|
child: PaynymCard(
|
|
|
|
walletId: walletId,
|
|
|
|
label: entries[i].key,
|
|
|
|
paymentCodeString: entries[i].value,
|
|
|
|
),
|
2022-12-21 18:03:23 +00:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|