Show native dialog
This commit is contained in:
parent
df516b981d
commit
446a6772bd
|
|
@ -4,6 +4,7 @@ import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
|
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
|
||||||
import 'package:invoiceninja_flutter/data/web_client.dart';
|
import 'package:invoiceninja_flutter/data/web_client.dart';
|
||||||
import 'package:invoiceninja_flutter/flutter_version.dart';
|
import 'package:invoiceninja_flutter/flutter_version.dart';
|
||||||
|
|
@ -764,9 +765,25 @@ class SidebarFooter extends StatelessWidget {
|
||||||
color: Colors.orange,
|
color: Colors.orange,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
else if (!state.dismissedNativeWarning && false)
|
else if (!state.dismissedNativeWarning)
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () => null,
|
onPressed: () => showMessageDialog(
|
||||||
|
context: context,
|
||||||
|
message: isMobileOS()
|
||||||
|
? localization.recommendMobile
|
||||||
|
: localization.recommendDesktop,
|
||||||
|
onDismiss: () {
|
||||||
|
//
|
||||||
|
},
|
||||||
|
secondaryActions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
child: Text(localization.download.toUpperCase()),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.warning,
|
Icons.warning,
|
||||||
color: Colors.orange,
|
color: Colors.orange,
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ void showMessageDialog({
|
||||||
@required BuildContext context,
|
@required BuildContext context,
|
||||||
@required String message,
|
@required String message,
|
||||||
List<TextButton> secondaryActions,
|
List<TextButton> secondaryActions,
|
||||||
|
Function onDismiss,
|
||||||
}) {
|
}) {
|
||||||
showDialog<MessageDialog>(
|
showDialog<MessageDialog>(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
@ -61,6 +62,7 @@ void showMessageDialog({
|
||||||
return MessageDialog(
|
return MessageDialog(
|
||||||
message,
|
message,
|
||||||
secondaryActions: secondaryActions,
|
secondaryActions: secondaryActions,
|
||||||
|
onDismiss: onDismiss,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
// STARTER: lang key - do not remove comment
|
// STARTER: lang key - do not remove comment
|
||||||
|
'recommend_desktop':
|
||||||
|
'We recommend using the desktop app for the best performance',
|
||||||
|
'recommend_mobile':
|
||||||
|
'We recommend using the mobile app for the best performance',
|
||||||
'disconnected_gateway': 'Successfully disconnected gateway',
|
'disconnected_gateway': 'Successfully disconnected gateway',
|
||||||
'disconnect': 'Disconnect',
|
'disconnect': 'Disconnect',
|
||||||
'add_to_invoices': 'Add to Invoices',
|
'add_to_invoices': 'Add to Invoices',
|
||||||
|
|
@ -62766,6 +62770,14 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
_localizedValues[localeCode]['disconnected_gateway'] ??
|
_localizedValues[localeCode]['disconnected_gateway'] ??
|
||||||
_localizedValues['en']['disconnected_gateway'];
|
_localizedValues['en']['disconnected_gateway'];
|
||||||
|
|
||||||
|
String get recommendDesktop =>
|
||||||
|
_localizedValues[localeCode]['recommend_desktop'] ??
|
||||||
|
_localizedValues['en']['recommend_desktop'];
|
||||||
|
|
||||||
|
String get recommendMobile =>
|
||||||
|
_localizedValues[localeCode]['recommend_mobile'] ??
|
||||||
|
_localizedValues['en']['recommend_mobile'];
|
||||||
|
|
||||||
// STARTER: lang field - do not remove comment
|
// STARTER: lang field - do not remove comment
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue