2023-01-26 18:08:12 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
2023-02-27 16:01:06 +00:00
|
|
|
import 'package:stackwallet/pages/token_view/token_view.dart';
|
|
|
|
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
|
|
|
import 'package:stackwallet/utilities/text_styles.dart';
|
|
|
|
import 'package:stackwallet/widgets/rounded_container.dart';
|
2023-01-26 18:08:12 +00:00
|
|
|
|
2023-02-27 16:01:06 +00:00
|
|
|
class TokenSummary extends ConsumerWidget {
|
2023-01-26 18:08:12 +00:00
|
|
|
const TokenSummary({
|
|
|
|
Key? key,
|
|
|
|
required this.walletId,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
final String walletId;
|
|
|
|
|
|
|
|
@override
|
2023-02-27 16:01:06 +00:00
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
|
return RoundedContainer(
|
|
|
|
color: const Color(0xFFE9EAFF), // todo: fix color
|
|
|
|
// color: Theme.of(context).extension<StackColors>()!.,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
ref.watch(
|
|
|
|
walletsChangeNotifierProvider.select(
|
|
|
|
(value) => value.getManager(walletId).walletName,
|
2023-01-26 18:08:12 +00:00
|
|
|
),
|
|
|
|
),
|
2023-02-27 16:01:06 +00:00
|
|
|
style: STextStyles.label(context),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
ref.watch(tokenServiceProvider.select((value) => value!.balance
|
|
|
|
.getTotal()
|
|
|
|
.toStringAsFixed(ref.watch(tokenServiceProvider
|
|
|
|
.select((value) => value!.token.decimals))))),
|
|
|
|
style: STextStyles.label(context),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
ref.watch(
|
|
|
|
walletsChangeNotifierProvider.select(
|
|
|
|
(value) => value.getManager(walletId).walletName,
|
2023-01-26 18:08:12 +00:00
|
|
|
),
|
|
|
|
),
|
2023-02-27 16:01:06 +00:00
|
|
|
style: STextStyles.label(context),
|
|
|
|
),
|
|
|
|
],
|
2023-01-26 18:08:12 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|