mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 13:05:11 +00:00
design: Make key verification an adaptive dialog
This commit is contained in:
parent
5665cac15c
commit
5dfa4c132d
1 changed files with 25 additions and 17 deletions
|
@ -1,6 +1,7 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
|
@ -10,14 +11,13 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
|
|||
import 'package:matrix/encryption.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
|
||||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
|
||||
class KeyVerificationDialog extends StatefulWidget {
|
||||
Future<void> show(BuildContext context) => showAdaptiveBottomSheet(
|
||||
Future<void> show(BuildContext context) => showDialog(
|
||||
context: context,
|
||||
builder: (context) => this,
|
||||
isDismissible: false,
|
||||
barrierDismissible: false,
|
||||
);
|
||||
|
||||
final KeyVerification request;
|
||||
|
@ -342,24 +342,32 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
);
|
||||
break;
|
||||
}
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: const Center(child: CloseButton()),
|
||||
if ({TargetPlatform.iOS, TargetPlatform.macOS}
|
||||
.contains(Theme.of(context).platform)) {
|
||||
return CupertinoAlertDialog(
|
||||
title: title,
|
||||
),
|
||||
body: ListView(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
content: SizedBox(
|
||||
height: 256,
|
||||
width: 256,
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.only(top: 16),
|
||||
children: [body],
|
||||
),
|
||||
bottomNavigationBar: SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: buttons,
|
||||
),
|
||||
),
|
||||
actions: buttons,
|
||||
);
|
||||
}
|
||||
|
||||
return AlertDialog(
|
||||
title: title,
|
||||
content: SizedBox(
|
||||
height: 256,
|
||||
width: 256,
|
||||
child: ListView(
|
||||
children: [body],
|
||||
),
|
||||
),
|
||||
actions: buttons,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue