Skip to content

Commit

Permalink
🚀 pre-release 1.19.106-pre+52
Browse files Browse the repository at this point in the history
➕ email_validator: ^2.0.1
Faq page
@required annotation in launch url
add SizedBox at the bottom of setting page
Bring back the copyright information
set addDefaultShareMenuItem = true CustomTabs
set navigationBarColor to olors.tealAccent CustomTabs
Tell user about copy of a response
[ENV] Delete .firebase and .fvm
  • Loading branch information
iqfareez committed Apr 18, 2021
1 parent b94d6ab commit 465481d
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 27 deletions.
13 changes: 0 additions & 13 deletions .firebase/hosting.YnVpbGRcd2Vi.cache

This file was deleted.

1 change: 0 additions & 1 deletion .fvm/flutter_sdk

This file was deleted.

3 changes: 0 additions & 3 deletions .fvm/fvm_config.json

This file was deleted.

6 changes: 5 additions & 1 deletion lib/utils/launchUrl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ import '../CONSTANTS.dart';

class LaunchUrl {
static void normalLaunchUrl(
{String url, bool usesWebView = false, bool useCustomTabs = false}) {
{@required String url,
bool usesWebView = false,
bool useCustomTabs = false}) {
print('Launching $url');

!useCustomTabs
? _launchURL(url, usesWebView)
: FlutterWebBrowser.openWebPage(
url: url,
customTabsOptions: CustomTabsOptions(
addDefaultShareMenuItem: true,
navigationBarColor: Colors.tealAccent,
toolbarColor: Colors.teal.shade700,
secondaryToolbarColor: Colors.teal));
}
Expand Down
24 changes: 20 additions & 4 deletions lib/views/Settings part/AboutPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:package_info/package_info.dart';
import 'package:provider/provider.dart';
import 'package:timezone/timezone.dart' as tz;
import 'package:waktusolatmalaysia/views/Settings%20part/settingsProvider.dart';
import 'package:waktusolatmalaysia/views/faq.dart';
import '../../CONSTANTS.dart';
import '../../main.dart';
import '../../utils/launchUrl.dart';
Expand Down Expand Up @@ -193,9 +194,7 @@ class AboutAppPage extends StatelessWidget {
textAlign: TextAlign.center,
),
),
SizedBox(
height: 8,
),
SizedBox(height: 8),
Card(
child: ListTile(
title: Text(
Expand Down Expand Up @@ -235,6 +234,22 @@ class AboutAppPage extends StatelessWidget {
},
),
),
Card(
child: ListTile(
title: Text(
'Frequently Asked Questions (FAQ)',
textAlign: TextAlign.center,
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FaqPage(),
),
);
},
),
),
Card(
child: ListTile(
title: Text(
Expand Down Expand Up @@ -282,7 +297,8 @@ class AboutAppPage extends StatelessWidget {
},
),
),
Text('\n\n\n',
SizedBox(height: 15),
Text(appLegalese,
textAlign: TextAlign.center,
style: TextStyle(color: Colors.black54)),
],
Expand Down
5 changes: 5 additions & 0 deletions lib/views/Settings part/SettingsPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class _SettingsPageState extends State<SettingsPage> {
setting.isDeveloperOption
? buildVerboseDebugMode(context)
: Container(),
SizedBox(height: 40)
],
);
},
Expand Down Expand Up @@ -266,6 +267,10 @@ class _SettingsPageState extends State<SettingsPage> {
child: ListTile(
title: Text('Time format'),
trailing: DropdownButton(
icon: Padding(
padding: const EdgeInsets.all(4.0),
child: FaIcon(FontAwesomeIcons.caretDown, size: 13),
),
items: <String>['12 hour', '24 hour']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
Expand Down
51 changes: 51 additions & 0 deletions lib/views/faq.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:waktusolatmalaysia/utils/launchUrl.dart';

class FaqPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final _faqItems = [
FaqItem(
title: 'Show/Hide Imsak, Syuruk & Dhuha time',
url: 'https://bit.ly/3mSUZt8'),
FaqItem(
title: 'How to fix wrong hijri time',
url: 'https://bit.ly/mpthijrioffset')
];
return Scaffold(
appBar: AppBar(
title: Text('FAQs'),
centerTitle: true,
),
//TODO: Add image
//https://firebasestorage.googleapis.com/v0/b/malaysia-waktu-solat.appspot.com/o/In%20app%2Fundraw_Questions_re_1fy7.png?alt=media&token=2e1ca79e-3e63-4677-8e07-7b3e7b33cae2
body: ListView.builder(
itemCount: _faqItems.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(_faqItems[index].title),
subtitle: Text(_faqItems[index].url.substring(8)),
trailing: FaIcon(
FontAwesomeIcons.externalLinkAlt,
size: 18,
),
onTap: () {
LaunchUrl.normalLaunchUrl(
url: _faqItems[index].url, useCustomTabs: true);
},
);
},
),
);
}
}

class FaqItem {
String title;

String url;

/// Url must have https:// at front
FaqItem({@required this.title, @required this.url});
}
18 changes: 14 additions & 4 deletions lib/views/feedbackPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:package_info/package_info.dart';
import '../CONSTANTS.dart' as Constants;
import '../CONSTANTS.dart';
import '../utils/launchUrl.dart';
import 'package:email_validator/email_validator.dart';

class FeedbackPage extends StatefulWidget {
@override
Expand Down Expand Up @@ -50,7 +51,10 @@ class _FeedbackPageState extends State<FeedbackPage> {
},
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(title: Text('Feedback'), centerTitle: true),
appBar: AppBar(
title: Text('Feedback'),
centerTitle: true,
),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expand All @@ -74,11 +78,16 @@ class _FeedbackPageState extends State<FeedbackPage> {
maxLines: 4),
SizedBox(height: 10),
TextFormField(
validator: (value) => value.isNotEmpty
? EmailValidator.validate(value)
? null
: 'Incorrect email format'
: null,
controller: _emailController,
decoration: InputDecoration(
isDense: true,
hintText: 'Your email address (optional)',
helperText: 'We may contact you if needed',
helperText: 'We may reach you if needed',
border: OutlineInputBorder()),
textInputAction: TextInputAction.done,
keyboardType: TextInputType.emailAddress,
Expand Down Expand Up @@ -191,8 +200,9 @@ class _FeedbackPageState extends State<FeedbackPage> {
});
setState(() => _isSendLoading = false);
Fluttertoast.showToast(
msg:
'Sent. Thank you for your valuable feedback.',
msg: _emailController.text.isEmpty
? 'Thank you for your valuable feedback.'
: 'Thank you for your valuable feedback. A copy of your response will be sent to your email',
backgroundColor: Colors.green,
toastLength: Toast.LENGTH_LONG)
.then((value) => Navigator.pop(context));
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
email_validator:
dependency: "direct main"
description:
name: email_validator
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
fake_async:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: App waktu solat seluruh Malaysia

publish_to: "none" # Remove this line if you wish to publish to pub.dev

version: 1.18.98+51
version: 1.19.106-pre+52

environment:
sdk: ">=2.7.0 <3.0.0"
Expand Down Expand Up @@ -42,6 +42,7 @@ dependencies:
cloud_firestore: ^1.0.3
firebase_core: ^1.0.2
# firebase_remote_config: ^0.9.0-dev.2
email_validator: ^2.0.1

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 465481d

Please sign in to comment.