2020-02-15 08:20:08 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2020-10-03 11:11:07 +00:00
|
|
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
2020-02-15 08:20:08 +00:00
|
|
|
import 'package:olm/olm.dart' as olm;
|
|
|
|
|
2020-10-15 13:51:24 +00:00
|
|
|
import '../../components/adaptive_page_layout.dart';
|
|
|
|
import '../../components/matrix.dart';
|
|
|
|
import '../../utils/beautify_string_extension.dart';
|
|
|
|
import '../settings.dart';
|
|
|
|
|
2020-02-15 08:20:08 +00:00
|
|
|
class AppInfoView extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AdaptivePageLayout(
|
|
|
|
primaryPage: FocusPage.SECOND,
|
2020-10-14 01:21:28 +00:00
|
|
|
firstScaffold: Settings(),
|
2020-02-15 08:20:08 +00:00
|
|
|
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-09-23 09:59:14 +00:00
|
|
|
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:'),
|
2020-10-04 18:44:44 +00:00
|
|
|
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
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|