Integrations
This commit is contained in:
parent
5ab8c084d8
commit
69a10840eb
|
|
@ -0,0 +1,41 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class LearnMore extends StatelessWidget {
|
||||
const LearnMore({
|
||||
@required this.child,
|
||||
@required this.url,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
final String url;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final localization = AppLocalization.of(context);
|
||||
|
||||
if (url.isEmpty) {
|
||||
return child;
|
||||
}
|
||||
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: child,
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
FlatButton(
|
||||
child: Text(localization.learnMore),
|
||||
onPressed: () async {
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url, forceSafariVC: false, forceWebView: false);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/foundation.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/forms/learn_more.dart';
|
||||
import 'package:invoiceninja_flutter/ui/settings/integrations_vm.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/edit_scaffold.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
|
|
@ -57,9 +58,7 @@ class _IntegrationSettingsState extends State<IntegrationSettings> {
|
|||
super.didChangeDependencies();
|
||||
}
|
||||
|
||||
void _onChanged() {
|
||||
|
||||
}
|
||||
void _onChanged() {}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -73,15 +72,21 @@ class _IntegrationSettingsState extends State<IntegrationSettings> {
|
|||
children: <Widget>[
|
||||
FormCard(
|
||||
children: <Widget>[
|
||||
DecoratedFormField(
|
||||
label: 'Slack',
|
||||
hint: localization.slackWebhookUrl,
|
||||
controller: _slackWebhookController,
|
||||
LearnMore(
|
||||
url: 'https://my.slack.com/services/new/incoming-webhook/',
|
||||
child: DecoratedFormField(
|
||||
label: 'Slack',
|
||||
hint: localization.slackWebhookUrl,
|
||||
controller: _slackWebhookController,
|
||||
),
|
||||
),
|
||||
DecoratedFormField(
|
||||
label: 'Google Analytics',
|
||||
hint: localization.analyticsKey,
|
||||
controller: _googleAnalyticsController,
|
||||
LearnMore(
|
||||
url: 'https://support.google.com/analytics/answer/1037249',
|
||||
child: DecoratedFormField(
|
||||
label: 'Google Analytics',
|
||||
hint: localization.trackingId,
|
||||
controller: _googleAnalyticsController,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
1970
lib/utils/i18n.dart
1970
lib/utils/i18n.dart
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue