Files
hash-wallet/lib/new-ui/pages/about_page.dart
T
tuxsudoandGitHub 3815fc30c6 New Settings (#3065)
* Update display_settings_page.dart

* Update settings_choices_cell.dart

* Update settings_theme_choice.dart

* Convert display_settings_page.dart to NewListSection

* Cleanup [skip ci]

* Minor

* Minor [skip ci]

* Add SizedBox to scroll view

* Upgrade receive_top_bar.dart with gradient and optional child content

* Adjust animations

* Add modal_page_wrapper.dart

* Add option to hide AppBar for BasePage [skip ci]

* New settings all final (#3067)

* Conflict

* ModalPageWrapper improved abstraction

* display_settings_page.dart minor update

* connection_sync_page.dart redesign

* Conflict

* manage_nodes_page.dart initial redesign

* other settings initial

* Conflict

* add optional subtitle to standard_list.dart

* add connection_sync_view_model.dart

* Add missing images

* Conflict

* Update list item widgets

* Conflict

* Conflict

* Conflict

* minor updates

* Conflict

* Fixes + move Mweb to privacy page

* Conflict

* Remove observer from modal_page_wrapper.dart

* Conflict

* Conflict

* Refactor settings_page.dart with suggestions

* Suggestion fixes

* Conflicts + fix About page

* Fix sync bar conflict

* Update Connections page title [skip ci]

* Trigger CI

* Fix Lightning and Payjoin log export

* Update MWEB node page

* Add FeatureFlag to AutomaticNodeSwitching

* Fix address text on privacy_page.dart

* Move WalletConnect from connection_sync_page.dart to settings_page.dart

* Add WalletConnect icon

* Fix settings icons

* Make text strings use S.of(context) and fix About string in settings_page.dart

* Display settings page fixes

* modal_page_wrapper.dart minor suggestions

* Missingimage

* Add spacing to list_item_selector_widget.dart

* Fix error on manage_nodes_page.dart
2026-03-14 14:15:42 +01:00

155 lines
6.3 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'dart:math';
import 'package:cake_wallet/entities/new_ui_entities/list_item/list_item_regular_row.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/new-ui/widgets/modal_page_wrapper.dart';
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
import 'package:cake_wallet/src/widgets/new_list_row/new_list_section.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
// written by people who happened to read my slack message in 2025
// whoever works on this codebase in the future, feel free to add your own mark here
const List<String> aboutPageEasterEggs = [
"Designed in (S)pain",
"Proudly managing over 🤷‍♂️ XMR",
"The cake is not a lie 🍰",
"I don’t play soccer because I enjoy the sport. I’m just doing it for kicks.",
"Markets in red? Big deal.\nWhat color is the grass outside?",
"Conquered Web3, now working on Web6-7",
"Proud owner of none of your funds\n(we are not impressed)",
"*writing down my seedphrase*\ncake cake cake cake cake cake cake ca...",
"Don't forget to actually use your crypto to pay for stuff in the real world 🙂",
"A chain of blocks? That's preposterous!",
"IOU a hug <3",
"Warning: up to 4.8% programmed by cats",
"We love collecting your data <3\nWe're just really incompetent at it"
];
class AboutPage extends StatefulWidget {
const AboutPage({super.key, required this.appVersion});
final String appVersion;
@override
State<AboutPage> createState() => _AboutPageState();
}
class _AboutPageState extends State<AboutPage> {
static const int easterEggTreshold = 5;
String _bottomText = S.current.payment_made_easy;
int _easterEggCounter = 0;
void _easterEgg() {
_easterEggCounter++;
if(_easterEggCounter == easterEggTreshold) {
setState(() {
_bottomText = aboutPageEasterEggs.elementAt(Random().nextInt(aboutPageEasterEggs.length));
});
}
}
@override
Widget build(BuildContext context) {
return ModalPageWrapper(
topBar: ModalTopBar(
title: S.of(context).about,
leadingIcon: Icon(Icons.arrow_back_ios_new),
onLeadingPressed: Navigator.of(context).pop,
),
content: Container(
color: Theme.of(context).colorScheme.surface,
child: Column(children: [
Column(
children: [
Column(
spacing: 16,
children: [
SizedBox(),
GestureDetector(
onTap: _easterEgg,
child: CakeImageWidget(
imageUrl: "assets/new-ui/cake_squircle_icon.svg",
width: 128,
height: 128,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 8,
children: [
Text(
"Cake Wallet",
style: TextStyle(fontSize: 32, fontWeight: FontWeight.w500),
),
Text(widget.appVersion,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurfaceVariant))
],
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: Wrap(
children: [
Text(
_bottomText,
textAlign: TextAlign.center,
style: TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant),
),
],
),
),
],
),
SizedBox(height: 32),
NewListSections(sections: {
"": [
ListItemRegularRow(
keyValue: "official website",
label: "Official Website",
onTap: () => launchUrl(Uri.https("cakewallet.com")),
trailingIconPath: "assets/new-ui/link_arrow.svg",
foregroundColor: Theme.of(context).colorScheme.primary,
trailingIconSize: 10),
ListItemRegularRow(
keyValue: "docs",
label: "Cake Docs",
onTap: () => launchUrl(Uri.https("docs.cakewallet.com")),
trailingIconPath: "assets/new-ui/link_arrow.svg",
foregroundColor: Theme.of(context).colorScheme.primary,
trailingIconSize: 10)
],
"2": [
ListItemRegularRow(
keyValue: "gh",
label: "GitHub",
onTap: () => launchUrl(Uri.https("github.com", "cake-tech")),
trailingIconPath: "assets/new-ui/link_arrow.svg",
foregroundColor: Theme.of(context).colorScheme.primary,
trailingIconSize: 10),
ListItemRegularRow(
keyValue: "twitter",
label: "X (Twitter)",
onTap: () => launchUrl(Uri.https("twitter.com", "cakewallet")),
trailingIconPath: "assets/new-ui/link_arrow.svg",
foregroundColor: Theme.of(context).colorScheme.primary,
trailingIconSize: 10),
ListItemRegularRow(
keyValue: "tg",
label: "Telegram",
onTap: () => launchUrl(Uri.https("t.me", "cakewallet")),
trailingIconPath: "assets/new-ui/link_arrow.svg",
foregroundColor: Theme.of(context).colorScheme.primary,
trailingIconSize: 10)
]
})
],
)
])),
);
}
}