Files
hash-wallet/lib/src/widgets/services_updates_widget.dart
T
jwinterm 7e368f92e6 brand: de-cake the app (hash-bag success art, asset + widget renames, filter, icon padding)
Send-success art: replace the Cake birthday cake with a Hash Bags money sack
that has a # on it and erupts #/$/₿ (assets/images/hash_bag.png). Used by the
success page, send-confirm sheet, exchange-trade, and dEURO savings.

Asset renames (files + refs):
- birthday_cake.png            -> hash_bag.png
- restore_cupcake(.png/_dark)  -> restore_hashbag.png
- qr-cake.png                  -> qr-hashbag.png
- arrow_bottom_cake_green.png  -> arrow_bottom_green.png (+ 2.0x/3.0x)

Identifier renames:
- CakeImageWidget -> HashImageWidget (widget + file + 93 refs)
- typography _cakeRegular/_cakeBold/_cakeSemiBold -> _hash*

Transaction filter: drop the Cake Pay "Orders" row and every non-Trocador
trade provider; the swap gate is already Trocador-only, so this just aligns the
filter UI with reality.

Android launcher: add breathing room to the adaptive-foreground # (all
densities, monochrome included); iOS icon unchanged.

About page: swap the Cake easter eggs for Hash Bags ones.

Deferred (needs a build to verify): new-ui .svg.vec filename renames
(cake_squircle_icon, cakewallet-wordmark, cake-setting) — already Hash Bags in
content, only the filenames are cake, and they route through the .vec precompile.
2026-08-07 02:57:29 -04:00

159 lines
6.5 KiB
Dart

import 'package:hash_wallet/di.dart';
import 'package:hash_wallet/entities/preferences_key.dart';
import 'package:hash_wallet/entities/service_status.dart';
import 'package:hash_wallet/generated/i18n.dart';
import 'package:hash_wallet/src/widgets/alert_with_one_action.dart';
import 'package:hash_wallet/src/widgets/hash_image_widget.dart';
import 'package:hash_wallet/src/widgets/primary_button.dart';
import 'package:hash_wallet/src/widgets/service_status_tile.dart';
import 'package:hash_wallet/utils/device_info.dart';
import 'package:hash_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';
class ServicesUpdatesWidget extends StatefulWidget {
final Future<ServicesResponse> servicesResponse;
final bool enabled;
const ServicesUpdatesWidget(this.servicesResponse, {super.key, required this.enabled});
@override
State<ServicesUpdatesWidget> createState() => _ServicesUpdatesWidgetState();
}
class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
bool wasOpened = false;
@override
Widget build(BuildContext context) {
if (!widget.enabled) {
return InkWell(
onTap: () async {
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithOneAction(
alertTitle: S.current.service_health_disabled,
alertContent: S.current.service_health_disabled_message,
buttonText: S.current.ok,
buttonAction: () => Navigator.of(context).pop(),
);
});
},
child: HashImageWidget(
imageUrl: "assets/images/notif.svg",
color: Theme.of(context).colorScheme.primary,
width: DeviceInfo.instance.isDesktop ? 30 : 20,
),
);
}
return Padding(
padding: DeviceInfo.instance.isDesktop
? EdgeInsets.zero
: EdgeInsets.only(left: 16, top: 12, right: 8, bottom: 8),
child: FutureBuilder<ServicesResponse>(
future: widget.servicesResponse,
builder: (context, state) {
return InkWell(
onTap: state.hasData
? () {
// save currentSha when the user see the status
getIt
.get<SharedPreferences>()
.setString(PreferencesKey.serviceStatusShaKey, state.data!.currentSha);
setState(() => wasOpened = true);
showModalBottomSheet(
backgroundColor: Theme.of(context).colorScheme.surface,
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(50),
topRight: Radius.circular(50),
),
),
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height / 2,
minHeight: MediaQuery.of(context).size.height / 4,
),
builder: (context) {
Widget body;
if (state.data!.servicesStatus.isEmpty) {
body = Center(
child: Text(
"Everything is up and running as expected",
style: Theme.of(context).textTheme.bodyMedium,
),
);
} else {
body = SingleChildScrollView(
child: Column(
children: state.data!.servicesStatus
.map((status) => ServiceStatusTile(status))
.toList(),
),
);
}
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Column(
children: [
Expanded(child: body),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 24,
vertical: 20,
),
child: PrimaryButton(
onPressed: () {
try {
launchUrl(
Uri.parse(
"https://github.com/Such-Software/hash-wallet/issues",
),
mode: LaunchMode.externalApplication);
} catch (_) {}
},
text: "Status Website",
color: Theme.of(context).colorScheme.primary,
textColor: Theme.of(context).colorScheme.onPrimary,
),
),
)
],
),
);
},
);
}
: null,
child: Stack(
children: [
HashImageWidget(
imageUrl: "assets/images/notif.svg",
color: Theme.of(context).colorScheme.primary,
width: DeviceInfo.instance.isDesktop ? 30 : 20,
),
if (state.hasData && state.data!.hasUpdates && !wasOpened)
Container(
height: 7,
width: 7,
margin: EdgeInsetsDirectional.only(start: 15),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.errorContainer,
shape: BoxShape.circle,
),
),
],
),
);
},
),
);
}
}