|
|
|
@ -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),
|
|
|
|
|
children: [body],
|
|
|
|
|
),
|
|
|
|
|
bottomNavigationBar: SafeArea(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(12.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: buttons,
|
|
|
|
|
content: SizedBox(
|
|
|
|
|
height: 256,
|
|
|
|
|
width: 256,
|
|
|
|
|
child: ListView(
|
|
|
|
|
padding: const EdgeInsets.only(top: 16),
|
|
|
|
|
children: [body],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
actions: buttons,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return AlertDialog(
|
|
|
|
|
title: title,
|
|
|
|
|
content: SizedBox(
|
|
|
|
|
height: 256,
|
|
|
|
|
width: 256,
|
|
|
|
|
child: ListView(
|
|
|
|
|
children: [body],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
actions: buttons,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|