fluffychat/lib/views/app_info.dart

72 lines
2.2 KiB
Dart
Raw Normal View History

2020-02-15 09:20:08 +01:00
import 'package:fluffychat/components/adaptive_page_layout.dart';
import 'package:fluffychat/components/matrix.dart';
2020-05-07 07:52:40 +02:00
import 'package:fluffychat/l10n/l10n.dart';
2020-02-15 09:20:08 +01:00
import 'package:fluffychat/views/chat_list.dart';
import 'package:flutter/material.dart';
import 'package:olm/olm.dart' as olm;
import 'package:fluffychat/utils/beautify_string_extension.dart';
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 15:58:59 +02:00
var client = Matrix.of(context).client;
2020-02-15 09:20:08 +01:00
return Scaffold(
appBar: AppBar(
title: Text(L10n.of(context).accountInformation),
2020-02-15 09:20:08 +01:00
),
body: ListView(
children: <Widget>[
ListTile(
2020-05-13 15:58:59 +02:00
title: Text(L10n.of(context).yourOwnUsername + ':'),
2020-02-15 09:20:08 +01:00
subtitle: Text(client.userID),
),
ListTile(
2020-05-13 15:58:59 +02:00
title: Text('Homeserver:'),
2020-08-16 12:54:43 +02:00
subtitle: Text(client.homeserver.toString()),
2020-02-15 09:20:08 +01:00
),
ListTile(
2020-05-13 15:58:59 +02:00
title: Text('Device name:'),
2020-02-15 09:20:08 +01:00
subtitle: Text(client.deviceName),
),
ListTile(
2020-05-13 15:58:59 +02:00
title: Text('Device ID:'),
2020-02-15 09:20:08 +01:00
subtitle: Text(client.deviceID),
),
ListTile(
2020-05-13 15:58:59 +02:00
title: Text('Encryption enabled:'),
2020-02-15 09:20:08 +01:00
subtitle: Text(client.encryptionEnabled.toString()),
),
if (client.encryptionEnabled)
Column(
children: <Widget>[
ListTile(
2020-05-13 15:58:59 +02:00
title: Text('Your public fingerprint key:'),
2020-02-15 09:20:08 +01:00
subtitle: Text(client.fingerprintKey.beautified),
),
ListTile(
2020-05-13 15:58:59 +02:00
title: Text('Your public identity key:'),
2020-02-15 09:20:08 +01:00
subtitle: Text(client.identityKey.beautified),
),
ListTile(
2020-05-13 15:58:59 +02:00
title: Text('LibOlm version:'),
subtitle: Text(olm.get_library_version().join('.')),
2020-02-15 09:20:08 +01:00
),
],
),
],
),
);
}
}