mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 09:35:12 +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:convert';
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.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/encryption.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
|
|
||||||
import 'package:fluffychat/widgets/avatar.dart';
|
import 'package:fluffychat/widgets/avatar.dart';
|
||||||
|
|
||||||
class KeyVerificationDialog extends StatefulWidget {
|
class KeyVerificationDialog extends StatefulWidget {
|
||||||
Future<void> show(BuildContext context) => showAdaptiveBottomSheet(
|
Future<void> show(BuildContext context) => showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => this,
|
builder: (context) => this,
|
||||||
isDismissible: false,
|
barrierDismissible: false,
|
||||||
);
|
);
|
||||||
|
|
||||||
final KeyVerification request;
|
final KeyVerification request;
|
||||||
|
@ -342,24 +342,32 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return Scaffold(
|
if ({TargetPlatform.iOS, TargetPlatform.macOS}
|
||||||
appBar: AppBar(
|
.contains(Theme.of(context).platform)) {
|
||||||
leading: const Center(child: CloseButton()),
|
return CupertinoAlertDialog(
|
||||||
title: title,
|
title: title,
|
||||||
),
|
content: SizedBox(
|
||||||
body: ListView(
|
height: 256,
|
||||||
padding: const EdgeInsets.all(12.0),
|
width: 256,
|
||||||
children: [body],
|
child: ListView(
|
||||||
),
|
padding: const EdgeInsets.only(top: 16),
|
||||||
bottomNavigationBar: SafeArea(
|
children: [body],
|
||||||
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