2020-10-14 01:21:28 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|
|
|
|
2020-10-15 13:51:24 +00:00
|
|
|
import '../../components/adaptive_page_layout.dart';
|
|
|
|
import '../../components/matrix.dart';
|
|
|
|
import '../settings.dart';
|
2020-10-14 01:21:28 +00:00
|
|
|
|
|
|
|
class HomeserverSettingsView extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AdaptivePageLayout(
|
|
|
|
primaryPage: FocusPage.SECOND,
|
|
|
|
firstScaffold: Settings(currentSetting: SettingsViews.homeserver),
|
|
|
|
secondScaffold: HomeserverSettings(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class HomeserverSettings extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
_HomeserverSettingsState createState() => _HomeserverSettingsState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _HomeserverSettingsState extends State<HomeserverSettings> {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
var client = Matrix.of(context).client;
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(title: Text(L10n.of(context).homeserver)),
|
|
|
|
body: ListView(
|
|
|
|
children: [
|
|
|
|
ListTile(
|
|
|
|
title: Text(L10n.of(context).yourOwnUsername + ':'),
|
|
|
|
subtitle: Text(client.userID),
|
|
|
|
),
|
|
|
|
ListTile(
|
|
|
|
title: Text('Homeserver:'),
|
|
|
|
subtitle: Text(client.homeserver.toString()),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|