FurryChat/lib/views/app_info.dart

74 lines
2.3 KiB
Dart
Raw Normal View History

2020-10-06 19:59:36 +00:00
import 'package:furrychat/components/adaptive_page_layout.dart';
import 'package:furrychat/components/matrix.dart';
import 'package:furrychat/utils/beautify_string_extension.dart';
import 'package:furrychat/views/chat_list.dart';
2020-02-15 08:20:08 +00:00
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
2020-02-15 08:20:08 +00:00
import 'package:olm/olm.dart' as olm;
class AppInfoView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AdaptivePageLayout(
primaryPage: FocusPage.SECOND,
firstScaffold: ChatList(),
secondScaffold: AppInfo(),
);
}
}
class AppInfo extends StatelessWidget {
@override
Widget build(BuildContext context) {
2020-05-13 13:58:59 +00:00
var client = Matrix.of(context).client;
2020-02-15 08:20:08 +00:00
return Scaffold(
appBar: AppBar(
title: Text(L10n.of(context).accountInformation),
2020-02-15 08:20:08 +00:00
),
body: ListView(
children: <Widget>[
ListTile(
2020-05-13 13:58:59 +00:00
title: Text(L10n.of(context).yourOwnUsername + ':'),
2020-02-15 08:20:08 +00:00
subtitle: Text(client.userID),
),
ListTile(
2020-05-13 13:58:59 +00:00
title: Text('Homeserver:'),
2020-08-16 10:54:43 +00:00
subtitle: Text(client.homeserver.toString()),
2020-02-15 08:20:08 +00:00
),
ListTile(
2020-05-13 13:58:59 +00:00
title: Text('Device name:'),
subtitle: Text(client.userDeviceKeys[client.userID]
?.deviceKeys[client.deviceID]?.deviceDisplayName ??
L10n.of(context).unknownDevice),
2020-02-15 08:20:08 +00:00
),
ListTile(
2020-05-13 13:58:59 +00:00
title: Text('Device ID:'),
2020-02-15 08:20:08 +00:00
subtitle: Text(client.deviceID),
),
ListTile(
2020-05-13 13:58:59 +00:00
title: Text('Encryption enabled:'),
2020-02-15 08:20:08 +00:00
subtitle: Text(client.encryptionEnabled.toString()),
),
if (client.encryptionEnabled)
Column(
children: <Widget>[
ListTile(
2020-05-13 13:58:59 +00:00
title: Text('Your public fingerprint key:'),
2020-02-15 08:20:08 +00:00
subtitle: Text(client.fingerprintKey.beautified),
),
ListTile(
2020-05-13 13:58:59 +00:00
title: Text('Your public identity key:'),
2020-02-15 08:20:08 +00:00
subtitle: Text(client.identityKey.beautified),
),
ListTile(
2020-05-13 13:58:59 +00:00
title: Text('LibOlm version:'),
subtitle: Text(olm.get_library_version().join('.')),
2020-02-15 08:20:08 +00:00
),
],
),
],
),
);
}
}