FurryChat/lib/views/app_info.dart

72 lines
2.2 KiB
Dart
Raw Normal View History

2020-02-15 08:20:08 +00:00
import 'package:fluffychat/components/adaptive_page_layout.dart';
import 'package:fluffychat/components/matrix.dart';
2020-05-07 05:52:40 +00:00
import 'package:fluffychat/l10n/l10n.dart';
2020-02-15 08:20:08 +00: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 13:58:59 +00:00
var client = Matrix.of(context).client;
2020-02-15 08:20:08 +00:00
return Scaffold(
appBar: AppBar(
2020-05-07 05:52:40 +00:00
title: Text(L10n.of(context).accountInformations),
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-06-10 08:07:01 +00:00
subtitle: Text(client.api.homeserver.toString()),
2020-02-15 08:20:08 +00:00
),
ListTile(
2020-05-13 13:58:59 +00:00
title: Text('Device name:'),
2020-02-15 08:20:08 +00:00
subtitle: Text(client.deviceName),
),
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
),
],
),
],
),
);
}
}