This commit is contained in:
Hillel Coren 2019-08-26 14:17:53 +03:00
parent 4c27a00f7c
commit d47dca3e43
6 changed files with 67 additions and 13 deletions

View File

@ -8,6 +8,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="com.android.vending.BILLING" />
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.

View File

@ -161,6 +161,16 @@ class AppDrawer extends StatelessWidget {
: ListView(
shrinkWrap: true,
children: <Widget>[
//if (isHosted(context) && !isProAccount(context))
if (false)
Material(
color: Colors.green,
child: ListTile(
leading: Icon(FontAwesomeIcons.superpowers),
title: Text(localization.upgrade),
onTap: () => null,
),
),
DrawerTile(
company: company,
icon: FontAwesomeIcons.tachometerAlt,

View File

@ -14,6 +14,7 @@ abstract class LocaleCodeAware {
mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
'upgrade': 'Upgrade',
'please_enter_a_first_name': 'Please enter a first name',
'please_enter_a_last_name': 'Please enter a last name',
'please_agree_to_terms_and_privacy' :
@ -13850,6 +13851,9 @@ mixin LocalizationsProvider on LocaleCodeAware {
String get privacyPolicy =>
_localizedValues[localeCode]['privacy_policy'];
String get upgrade =>
_localizedValues[localeCode]['upgrade'];
String lookup(String key) {
final lookupKey = toSnakeCase(key);
return _localizedValues[localeCode][lookupKey] ??

View File

@ -5,24 +5,33 @@ import 'package:invoiceninja_flutter/redux/app/app_state.dart';
import 'package:invoiceninja_flutter/redux/ui/ui_state.dart';
bool isAndroid(BuildContext context) =>
Theme.of(context).platform == TargetPlatform.android;
Theme
.of(context)
.platform == TargetPlatform.android;
String getMapURL(BuildContext context) => isAndroid(context)
? 'https://maps.google.com/?q='
: 'http://maps.apple.com/?address=';
String getMapURL(BuildContext context) =>
isAndroid(context)
? 'https://maps.google.com/?q='
: 'http://maps.apple.com/?address=';
String getLegacyAppURL(BuildContext context) => isAndroid(context)
? 'https://play.google.com/store/apps/details?id=com.invoiceninja.invoiceninja'
: 'https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1220337560&mt=8';
String getLegacyAppURL(BuildContext context) =>
isAndroid(context)
? 'https://play.google.com/store/apps/details?id=com.invoiceninja.invoiceninja'
: 'https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1220337560&mt=8';
String getPlatform(BuildContext context) =>
Theme.of(context).platform == TargetPlatform.iOS ? 'ios' : 'android';
Theme
.of(context)
.platform == TargetPlatform.iOS ? 'ios' : 'android';
String getAppURL(BuildContext context) =>
isAndroid(context) ? kGoogleStoreUrl : kAppleStoreUrl;
AppLayout calculateLayout(BuildContext context) {
final size = MediaQuery.of(context).size.shortestSide;
final size = MediaQuery
.of(context)
.size
.shortestSide;
if (size < kMobileLayoutWidth) {
return AppLayout.mobile;
} else if (size > kTabletLayoutWidth) {
@ -33,8 +42,12 @@ AppLayout calculateLayout(BuildContext context) {
}
AppLayout getLayout(BuildContext context) =>
StoreProvider.of<AppState>(context).state.uiState.layout ??
AppLayout.mobile;
StoreProvider
.of<AppState>(context)
.state
.uiState
.layout ??
AppLayout.mobile;
bool isMobile(BuildContext context) => getLayout(context) == AppLayout.mobile;
@ -43,4 +56,22 @@ bool isTablet(BuildContext context) => getLayout(context) == AppLayout.tablet;
bool isDesktop(BuildContext context) => getLayout(context) == AppLayout.desktop;
bool isDarkMode(BuildContext context) =>
StoreProvider.of<AppState>(context).state.uiState.enableDarkMode;
StoreProvider
.of<AppState>(context)
.state
.uiState
.enableDarkMode;
bool isSelfHosted(BuildContext context) =>
StoreProvider
.of<AppState>(context)
.state.selectedCompany.isSelfHost;
bool isHosted(BuildContext context) => !isSelfHosted(context);
bool isProAccount(BuildContext context) =>
isSelfHosted(context) || StoreProvider
.of<AppState>(context)
.state
.selectedCompany
.isProPlan;

View File

@ -334,6 +334,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.1+3"
in_app_purchase:
dependency: "direct main"
description:
name: in_app_purchase
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1"
intl:
dependency: "direct main"
description:
@ -361,7 +368,7 @@ packages:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "2.4.0"
json_rpc_2:
dependency: transitive
description:

View File

@ -13,6 +13,7 @@ dependencies:
flutter_redux: ^0.5.2
redux_logging: ^0.3.0
http: ^0.11.3+17
in_app_purchase: ^0.2.1
path_provider: ^0.5.0
shared_preferences: ^0.4.2
font_awesome_flutter: ^8.0.1