fix: Bootstrap hint

This commit is contained in:
Christian Pauly 2021-02-27 09:10:08 +01:00
commit 78839fdc65
3 changed files with 74 additions and 35 deletions

View file

@ -378,6 +378,34 @@ class _SettingsState extends State<Settings> {
.textTheme
.headline6
.color)),
actions: [
FutureBuilder(
future: crossSigningCachedFuture,
builder: (context, snapshot) {
final needsBootstrap = Matrix.of(context)
.client
.encryption
.crossSigning
.enabled ==
false ||
snapshot.data == false;
final isUnknownSession =
Matrix.of(context).client.isUnknownSession;
final displayHeader = needsBootstrap || isUnknownSession;
if (!displayHeader) return Container();
return TextButton.icon(
icon: Icon(Icons.cloud, color: Colors.red),
label: Text(
L10n.of(context).chatBackup,
style: TextStyle(color: Colors.red),
),
onPressed: () async {
await BootstrapDialog().show(context);
AdaptivePageLayout.of(context).popUntilIsFirst();
},
);
}),
],
backgroundColor: Theme.of(context).appBarTheme.color,
flexibleSpace: FlexibleSpaceBar(
background: ContentBanner(profile?.avatarUrl,