mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-20 06:08:34 +02:00
* Add Black theme * Fix black theme * Add WixMadefor Font * feat: Enhance theme setup This change: - Adds support for custom themes - Updates theme retrieval logic to ensure the right theme is used based on user preferences(especially for custom themes). * Add black custom colors * Add custom accent colors * feat: Restructure custom colors handling for themes * feat: Integrate new custom colors structure across various components - WIP * feat: Integrate new custom colors structure across various components, black theme now ready for tests * feat: Add new accent color themes and update theme selection UI - Enhanced theme selection UI in display settings to support accent color choices. - Updated theme handling logic to accommodate new accent color variants. * Minor updates to display_settings_page.dart * Update settings_theme_choice.dart * Revert accidental change in display_settings_page.dart * Revert WixMadeFor font, fix SVG colors for CakeImageWidget, and test some color changes * Update Monero Orange * fix: Remove unused custom colors * Test outline * Test spacing and colors * Add padding * Remove outline * Add other accent colors * Update display_settings_view_model.dart * Update names and fix switch case * Add outline and update dark_theme.dart colors * Add gradient to option_tile.dart * Update icons * Update some colors * Switch option_tile.dart to TextButton * Add updated icons * Fix icon resolution * Cleanup old icons + Update pubspec_base.yaml * Remove unused fonts * Update more icons * Update image paths * Remove more icons + update some component colors * Add back DAI icon * Fix errors * feat: Implement OLED mode for BlackTheme * feat: Add OLED mode for BlackTheme and localizations * feat: Implement OLED mode for Black Theme * refactor: Remove unused theme parameters and set up easy access to toggleKnob custom colors * fix: Cleanup UI and overflows * feat: Persist black theme selection if OS theme mode while app is in system mode * fix: OS theme change when app is in background restrict pin screen from proceed * Fix theme picker sizing * Update lib/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> * refactor: Enhance theme access by introducing ThemeX extension for easier retrieval of current theme and custom colors * refactor: Remove currentTheme parameter from GradientBackground widget and adjust across affected widgets * refactor: Remove currentTheme parameter from StandardSwitch and SettingsSwitcherCell, using ThemeX extension for theme access * refactor: Remove currentTheme parameter from various widgets dependent on SettingsSwitcherCell and StandardxSwitcher, using ThemeX extension for theme access * refactor: Remove currentTheme in bottomsheets and related widgets, switching to theme extension * refactor: Remove constructor theme access in OptionTile and related widgets, switching to theme extension * refactor: Switch bottomsheet related widgets to use theme extension instead of constructor access * refactor: Migrate currentTheme access from constructor based to extension base * refactor: Switch theme access from constructor base to extension base [skip ci] * refactor: Migrate more widgets to use extension based theme access and clean up code * refactor: Update theme access across multiple widgets to use the new theme extension * refactor: Clean up theme access in various widgets, moving to extension-based theme usage * refactor: Make theme picker preview responsive * fix: Persist saved black theme accent when app is put in background and brought back * remove unused variables [skip ci] --------- Co-authored-by: Blazebrain <davidadegoke16@gmail.com> Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
159 lines
6.4 KiB
Dart
159 lines
6.4 KiB
Dart
import 'package:cake_wallet/di.dart';
|
|
import 'package:cake_wallet/entities/preferences_key.dart';
|
|
import 'package:cake_wallet/entities/service_status.dart';
|
|
import 'package:cake_wallet/generated/i18n.dart';
|
|
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
|
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
|
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
|
import 'package:cake_wallet/src/widgets/service_status_tile.dart';
|
|
import 'package:cake_wallet/utils/device_info.dart';
|
|
import 'package:cake_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: CakeImageWidget(
|
|
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://status.cakewallet.com/",
|
|
),
|
|
mode: LaunchMode.externalApplication);
|
|
} catch (_) {}
|
|
},
|
|
text: "Status Website",
|
|
color: Theme.of(context).colorScheme.primary,
|
|
textColor: Theme.of(context).colorScheme.onPrimary,
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
: null,
|
|
child: Stack(
|
|
children: [
|
|
CakeImageWidget(
|
|
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,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|