mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
feat: update support page design (#2579)
This commit is contained in:
@@ -2,10 +2,11 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/widgets/option_tile.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:cake_wallet/utils/device_info.dart';
|
||||
import 'package:cake_wallet/view_model/support_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class SupportPage extends BasePage {
|
||||
SupportPage(this.supportViewModel);
|
||||
@@ -18,56 +19,46 @@ class SupportPage extends BasePage {
|
||||
@override
|
||||
AppBarStyle get appBarStyle => AppBarStyle.regular;
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) {
|
||||
final iconColor = Theme.of(context).colorScheme.primary;
|
||||
String get _imageSupportChat => currentTheme.isDark
|
||||
? 'assets/images/support_chat_dark.svg'
|
||||
: 'assets/images/support_chat.svg';
|
||||
|
||||
return Container(
|
||||
child: Center(
|
||||
String get _imageSupportDocs => currentTheme.isDark
|
||||
? 'assets/images/support_docs_dark.svg'
|
||||
: 'assets/images/support_docs.svg';
|
||||
|
||||
String get _imageSupportLinks => currentTheme.isDark
|
||||
? 'assets/images/support_links_dark.svg'
|
||||
: 'assets/images/support_links.svg';
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) => Center(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
padding: const EdgeInsets.only(left: 24, right: 24),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: OptionTile(
|
||||
icon: Icon(
|
||||
Icons.support_agent,
|
||||
color: iconColor,
|
||||
size: 50,
|
||||
),
|
||||
image: SvgPicture.asset(_imageSupportChat, width: 55, height: 55),
|
||||
title: S.of(context).support_title_live_chat,
|
||||
description: S.of(context).support_description_live_chat,
|
||||
onPressed: () {
|
||||
if (DeviceInfo.instance.isDesktop) {
|
||||
_launchUrl(supportViewModel.fetchUrl());
|
||||
} else {
|
||||
Navigator.pushNamed(context, Routes.supportLiveChat);
|
||||
}
|
||||
},
|
||||
onPressed: () => _onPressedSupportChat(context),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: OptionTile(
|
||||
icon: Icon(
|
||||
Icons.find_in_page,
|
||||
color: iconColor,
|
||||
size: 50,
|
||||
),
|
||||
image: SvgPicture.asset(_imageSupportDocs, width: 55, height: 55),
|
||||
title: S.of(context).support_title_guides,
|
||||
description: S.of(context).support_description_guides,
|
||||
onPressed: () => _launchUrl(supportViewModel.docsUrl),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: OptionTile(
|
||||
icon: Icon(
|
||||
Icons.contact_support,
|
||||
color: iconColor,
|
||||
size: 50,
|
||||
),
|
||||
image: SvgPicture.asset(_imageSupportLinks, width: 55, height: 55),
|
||||
title: S.of(context).support_title_other_links,
|
||||
description: S.of(context).support_description_other_links,
|
||||
onPressed: () => Navigator.pushNamed(context, Routes.supportOtherLinks),
|
||||
@@ -76,8 +67,14 @@ class SupportPage extends BasePage {
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
|
||||
void _onPressedSupportChat(BuildContext context) {
|
||||
if (DeviceInfo.instance.isDesktop) {
|
||||
_launchUrl(supportViewModel.fetchUrl());
|
||||
} else {
|
||||
Navigator.pushNamed(context, Routes.supportLiveChat);
|
||||
}
|
||||
}
|
||||
|
||||
void _launchUrl(String url) async {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/themes/core/theme_extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class OptionTile extends StatelessWidget {
|
||||
const OptionTile({
|
||||
@@ -13,7 +13,7 @@ class OptionTile extends StatelessWidget {
|
||||
}) : assert(image != null || icon != null);
|
||||
|
||||
final VoidCallback onPressed;
|
||||
final Image? image;
|
||||
final Widget? image;
|
||||
final Icon? icon;
|
||||
final String title;
|
||||
final String description;
|
||||
@@ -65,13 +65,18 @@ class OptionTile extends StatelessWidget {
|
||||
),
|
||||
if (tag != null)
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
padding: EdgeInsets.symmetric(horizontal: 5),
|
||||
margin: EdgeInsets.only(left: 5),
|
||||
child: Text(tag!))
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(style: BorderStyle.none),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
padding: EdgeInsets.symmetric(horizontal: 5),
|
||||
margin: EdgeInsets.only(left: 5),
|
||||
child: Text(
|
||||
tag!,
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.onPrimary),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
|
||||
Reference in New Issue
Block a user