feat: Add license page

This commit is contained in:
Christian Pauly 2020-09-18 12:58:22 +02:00
parent b1fb03e101
commit dcf4c4cd00
5 changed files with 51 additions and 7 deletions

View file

@ -19,7 +19,6 @@ import '../utils/app_route.dart';
class Matrix extends StatefulWidget {
static const String callNamespace = 'chat.fluffy.jitsi_call';
static const String defaultHomeserver = 'tchncs.de';
final Widget child;

View file

@ -0,0 +1,4 @@
abstract class AppConfig {
static const String applicationName = 'FluffyChat';
static const String defaultHomeserver = 'matrix.tchncs.de';
}

View file

@ -2,6 +2,7 @@ import 'dart:math';
import 'package:fluffychat/components/dialogs/simple_dialogs.dart';
import 'package:fluffychat/components/matrix.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/l10n/l10n.dart';
import 'package:fluffychat/utils/app_route.dart';
import 'package:fluffychat/utils/sentry_controller.dart';
@ -12,7 +13,7 @@ class HomeserverPicker extends StatelessWidget {
Future<void> _setHomeserverAction(BuildContext context) async {
final homeserver = await SimpleDialogs(context).enterText(
titleText: L10n.of(context).enterYourHomeserver,
hintText: Matrix.defaultHomeserver,
hintText: AppConfig.defaultHomeserver,
prefixText: 'https://',
keyboardType: TextInputType.url);
if (homeserver?.isEmpty ?? true) return;
@ -83,7 +84,7 @@ class HomeserverPicker extends StatelessWidget {
style: TextStyle(color: Colors.white, fontSize: 16),
),
onPressed: () => _checkHomeserverAction(
Matrix.defaultHomeserver, context),
AppConfig.defaultHomeserver, context),
),
),
),
@ -94,7 +95,7 @@ class HomeserverPicker extends StatelessWidget {
opacity: 0.75,
child: Text(
L10n.of(context).byDefaultYouWillBeConnectedTo(
Matrix.defaultHomeserver),
AppConfig.defaultHomeserver),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,

View file

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:famedlysdk/famedlysdk.dart';
import 'package:fluffychat/components/settings_themes.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/utils/sentry_controller.dart';
import 'package:fluffychat/views/settings_devices.dart';
import 'package:flutter/foundation.dart';
@ -481,8 +482,12 @@ class _SettingsState extends State<Settings> {
ListTile(
trailing: Icon(Icons.code),
title: Text(L10n.of(context).sourceCode),
onTap: () => launch(
'https://gitlab.com/ChristianPauly/fluffychat-flutter'),
onTap: () => showLicensePage(
context: context,
applicationIcon:
Image.asset('assets/logo.png', width: 100, height: 100),
applicationName: AppConfig.applicationName,
),
),
],
),

View file

@ -220,13 +220,41 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
firebase:
dependency: transitive
description:
name: firebase
url: "https://pub.dartlang.org"
source: hosted
version: "7.3.0"
firebase_core:
dependency: transitive
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
firebase_messaging:
dependency: "direct main"
description:
name: firebase_messaging
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.16"
version: "7.0.0"
flutter:
dependency: "direct main"
description: flutter
@ -683,6 +711,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.4"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
random_string:
dependency: "direct main"
description: