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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2023-05-09 23:59:26 +00:00
|
|
|
import 'dart:io';
|
|
|
|
|
2022-08-26 08:11:35 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2023-02-21 22:28:38 +00:00
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
import 'package:flutter_svg/svg.dart';
|
2024-05-23 00:37:06 +00:00
|
|
|
import '../../add_wallet_views/add_wallet_view/add_wallet_view.dart';
|
|
|
|
import '../../../themes/stack_colors.dart';
|
|
|
|
import '../../../themes/theme_providers.dart';
|
|
|
|
import '../../../utilities/assets.dart';
|
|
|
|
import '../../../utilities/text_styles.dart';
|
|
|
|
import '../../../utilities/util.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
|
2023-02-21 22:28:38 +00:00
|
|
|
class EmptyWallets extends ConsumerWidget {
|
2022-08-26 08:11:35 +00:00
|
|
|
const EmptyWallets({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
2023-02-21 22:28:38 +00:00
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
2022-08-26 08:11:35 +00:00
|
|
|
debugPrint("BUILD: $runtimeType");
|
2022-09-16 16:23:42 +00:00
|
|
|
|
2022-09-19 20:18:31 +00:00
|
|
|
final isDesktop = Util.isDesktop;
|
2022-09-16 16:23:42 +00:00
|
|
|
|
2022-08-26 08:11:35 +00:00
|
|
|
return SafeArea(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
horizontal: 43,
|
|
|
|
),
|
2022-09-16 16:23:42 +00:00
|
|
|
child: ConstrainedBox(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
maxWidth: isDesktop ? 330 : double.infinity,
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
const Spacer(
|
|
|
|
flex: 2,
|
2022-08-26 08:11:35 +00:00
|
|
|
),
|
2023-05-09 23:59:26 +00:00
|
|
|
SvgPicture.file(
|
|
|
|
File(
|
|
|
|
ref.watch(
|
|
|
|
themeProvider.select(
|
|
|
|
(value) => value.assets.stack,
|
|
|
|
),
|
2023-04-25 22:09:45 +00:00
|
|
|
),
|
|
|
|
),
|
2023-03-10 15:50:57 +00:00
|
|
|
width: isDesktop ? 324 : MediaQuery.of(context).size.width / 3,
|
|
|
|
),
|
2022-09-16 16:23:42 +00:00
|
|
|
SizedBox(
|
|
|
|
height: isDesktop ? 30 : 16,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
"You do not have any wallets yet. Start building your crypto Stack!",
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: isDesktop
|
2022-09-22 22:17:21 +00:00
|
|
|
? STextStyles.desktopSubtitleH2(context).copyWith(
|
2022-09-22 23:48:50 +00:00
|
|
|
color: Theme.of(context)
|
|
|
|
.extension<StackColors>()!
|
|
|
|
.textSubtitle1,
|
2022-09-16 16:23:42 +00:00
|
|
|
)
|
2022-09-22 22:17:21 +00:00
|
|
|
: STextStyles.subtitle(context).copyWith(
|
2022-09-22 23:48:50 +00:00
|
|
|
color: Theme.of(context)
|
|
|
|
.extension<StackColors>()!
|
|
|
|
.textSubtitle1,
|
2022-08-26 08:11:35 +00:00
|
|
|
),
|
2022-09-16 16:23:42 +00:00
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: isDesktop ? 30 : 16,
|
|
|
|
),
|
|
|
|
if (isDesktop)
|
|
|
|
const SizedBox(
|
|
|
|
width: 328,
|
|
|
|
height: 70,
|
|
|
|
child: AddWalletButton(
|
|
|
|
isDesktop: true,
|
2022-08-26 08:11:35 +00:00
|
|
|
),
|
|
|
|
),
|
2022-09-16 16:23:42 +00:00
|
|
|
if (!isDesktop)
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: const [
|
|
|
|
AddWalletButton(
|
|
|
|
isDesktop: false,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
const Spacer(
|
|
|
|
flex: 5,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-27 21:25:40 +00:00
|
|
|
class AddWalletButton extends ConsumerWidget {
|
2022-09-16 16:23:42 +00:00
|
|
|
const AddWalletButton({Key? key, required this.isDesktop}) : super(key: key);
|
|
|
|
|
|
|
|
final bool isDesktop;
|
|
|
|
|
|
|
|
@override
|
2023-02-27 21:25:40 +00:00
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
2023-05-09 20:20:29 +00:00
|
|
|
final bool isOLED = ref.watch(themeProvider).themeId == "oled_black";
|
|
|
|
|
2022-09-16 16:23:42 +00:00
|
|
|
return TextButton(
|
2022-09-22 23:48:50 +00:00
|
|
|
style: Theme.of(context)
|
|
|
|
.extension<StackColors>()!
|
2023-01-24 19:29:12 +00:00
|
|
|
.getPrimaryEnabledButtonStyle(context),
|
2022-09-16 16:23:42 +00:00
|
|
|
onPressed: () {
|
2022-10-04 19:53:57 +00:00
|
|
|
if (isDesktop) {
|
|
|
|
Navigator.of(
|
|
|
|
context,
|
|
|
|
rootNavigator: true,
|
|
|
|
).pushNamed(AddWalletView.routeName);
|
|
|
|
} else {
|
|
|
|
Navigator.of(context).pushNamed(AddWalletView.routeName);
|
|
|
|
}
|
2022-09-16 16:23:42 +00:00
|
|
|
},
|
|
|
|
child: Center(
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
horizontal: 16,
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
2023-02-27 21:25:40 +00:00
|
|
|
isOLED
|
|
|
|
? SvgPicture.asset(
|
|
|
|
Assets.svg.plus,
|
|
|
|
color: Theme.of(context)
|
|
|
|
.extension<StackColors>()!
|
|
|
|
.buttonTextPrimary,
|
|
|
|
width: isDesktop ? 18 : null,
|
|
|
|
height: isDesktop ? 18 : null,
|
|
|
|
)
|
|
|
|
: SvgPicture.asset(
|
|
|
|
Assets.svg.plus,
|
|
|
|
width: isDesktop ? 18 : null,
|
|
|
|
height: isDesktop ? 18 : null,
|
|
|
|
),
|
2022-09-16 16:23:42 +00:00
|
|
|
SizedBox(
|
|
|
|
width: isDesktop ? 8 : 5,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
"Add Wallet",
|
|
|
|
style: isDesktop
|
2022-09-22 22:17:21 +00:00
|
|
|
? STextStyles.desktopButtonEnabled(context)
|
|
|
|
: STextStyles.button(context),
|
2022-09-16 16:23:42 +00:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2022-08-26 08:11:35 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|