feat: Add license page
This commit is contained in:
parent
ff809d42d0
commit
a11185cc55
5 changed files with 51 additions and 7 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
4
lib/config/app_config.dart
Normal file
4
lib/config/app_config.dart
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
abstract class AppConfig {
|
||||
static const String applicationName = 'FluffyChat';
|
||||
static const String defaultHomeserver = 'matrix.tchncs.de';
|
||||
}
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue