11import 'package:easy_localization/easy_localization.dart' ;
22import 'package:flutter/material.dart' ;
33import 'package:font_awesome_flutter/font_awesome_flutter.dart' ;
4+ import 'package:lottie/lottie.dart' ;
5+ import 'package:url_launcher/url_launcher.dart' ;
6+ import 'package:wooapp/config/config.dart' ;
47import 'package:wooapp/config/theme.dart' ;
58import 'package:wooapp/widget/widget_woo_section.dart' ;
69
@@ -18,66 +21,96 @@ class HelpScreen extends StatelessWidget {
1821 ),
1922 ).tr (),
2023 backgroundColor: WooAppTheme .colorToolbarBackground,
24+ elevation: 0 ,
2125 ),
22- backgroundColor: WooAppTheme .colorCommonBackground,
23- body: SafeArea (
24- child: SingleChildScrollView (
25- child: Column (
26- children: [
27- SizedBox (height: 16 ),
28- WooSection (
29- icon: FaIcon (
30- FontAwesomeIcons .headset,
31- color: WooAppTheme .colorCommonSectionForeground,
32- ),
33- text: tr ('support' ),
34- action: () {},
26+ backgroundColor: WooAppTheme .colorToolbarBackground,
27+ body: SafeArea (//help_anim.json
28+ child: Stack (
29+ children: [
30+ Lottie .asset (
31+ 'assets/help_anim.json' ,
32+ width: MediaQuery .of (context).size.width * 1.0 ,
33+ height: MediaQuery .of (context).size.height * 0.4 ,
34+ ),
35+ Container (
36+ child: Column (
37+ mainAxisAlignment: MainAxisAlignment .end,
38+ children: [
39+ Container (
40+ decoration: BoxDecoration (
41+ color: WooAppTheme .colorCommonBackground,
42+ borderRadius: BorderRadius .only (
43+ topLeft: const Radius .circular (20.0 ),
44+ topRight: const Radius .circular (20.0 ),
45+ ),
46+ ),
47+ child: _buildHelpSections (),
48+ ),
49+ ],
3550 ),
36- WooSection (
37- icon: FaIcon (
38- FontAwesomeIcons .question,
39- color: WooAppTheme .colorCommonSectionForeground,
40- ),
41- text: tr ('faq' ),
42- action: () {},
43- ),
44- SizedBox (height: 8 ),
45- WooSection (
46- icon: FaIcon (
47- FontAwesomeIcons .book,
48- color: WooAppTheme .colorCommonSectionForeground,
49- ),
50- text: tr ('privacy_policy' ),
51- action: () {},
52- ),
53- WooSection (
54- icon: FaIcon (
55- FontAwesomeIcons .list,
56- color: WooAppTheme .colorCommonSectionForeground,
57- ),
58- text: tr ('terms_of_use' ),
59- action: () {},
60- ),
61- WooSection (
62- icon: FaIcon (
63- FontAwesomeIcons .circleInfo,
64- color: WooAppTheme .colorCommonSectionForeground,
65- ),
66- text: tr ('about_us' ),
67- action: () {},
68- ),
69- SizedBox (height: 8 ),
70- WooSection (
71- icon: FaIcon (
72- FontAwesomeIcons .star,
73- color: WooAppTheme .colorCommonSectionForeground,
74- ),
75- text: tr ('rate_app' ),
76- action: () {},
77- ),
78- ],
79- ),
51+ ),
52+ ],
8053 ),
8154 ),
8255 );
56+
57+ Widget _buildHelpSections () => Column (
58+ children: [
59+ SizedBox (height: 16 ),
60+ WooSection (
61+ icon: FaIcon (
62+ FontAwesomeIcons .headset,
63+ color: WooAppTheme .colorCommonSectionForeground,
64+ ),
65+ text: tr ('support' ),
66+ action: () => _openUrl (WooAppConfig .helpUrlCustomerSupport),
67+ ),
68+ WooSection (
69+ icon: FaIcon (
70+ FontAwesomeIcons .question,
71+ color: WooAppTheme .colorCommonSectionForeground,
72+ ),
73+ text: tr ('faq' ),
74+ action: () => _openUrl (WooAppConfig .helpUrlFaq),
75+ ),
76+ WooSection (
77+ icon: FaIcon (
78+ FontAwesomeIcons .book,
79+ color: WooAppTheme .colorCommonSectionForeground,
80+ ),
81+ text: tr ('privacy_policy' ),
82+ action: () => _openUrl (WooAppConfig .helpUrlPrivacyPolicy),
83+ ),
84+ WooSection (
85+ icon: FaIcon (
86+ FontAwesomeIcons .list,
87+ color: WooAppTheme .colorCommonSectionForeground,
88+ ),
89+ text: tr ('terms_of_use' ),
90+ action: () => _openUrl (WooAppConfig .helpUrlTermsOfUse),
91+ ),
92+ WooSection (
93+ icon: FaIcon (
94+ FontAwesomeIcons .circleInfo,
95+ color: WooAppTheme .colorCommonSectionForeground,
96+ ),
97+ text: tr ('about_us' ),
98+ action: () => _openUrl (WooAppConfig .helpUrlAbout),
99+ ),
100+ /*WooSection(
101+ icon: FaIcon(
102+ FontAwesomeIcons.star,
103+ color: WooAppTheme.colorCommonSectionForeground,
104+ ),
105+ text: tr('rate_app'),
106+ action: () {},
107+ ),*/
108+ SizedBox (height: 12 ),
109+ ],
110+ );
111+
112+ void _openUrl (String url) => launchUrl (
113+ Uri .parse (url),
114+ mode: LaunchMode .externalApplication,
115+ );
83116}
0 commit comments