add number verification

This commit is contained in:
Sorunome 2020-05-18 11:48:25 +02:00
parent e71c99d36c
commit 6558139f11
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
4 changed files with 21 additions and 8 deletions

View File

@ -18,9 +18,9 @@ class HomeserverPicker extends StatelessWidget {
}
void _checkHomeserverAction(String homeserver, BuildContext context) async {
if (!homeserver.startsWith('https://')) {
homeserver = 'https://$homeserver';
}
// if (!homeserver.startsWith('https://')) {
// homeserver = 'https://$homeserver';
// }
final success = await SimpleDialogs(context).tryRequestWithLoadingDialog(
Matrix.of(context).client.checkServer(homeserver));
if (success != false) {

View File

@ -42,8 +42,21 @@ class _KeyVerificationPageState extends State<KeyVerificationPage> {
case KeyVerificationState.waitingAccept:
return Text('Waiting for partner to accept the request...');
case KeyVerificationState.askSas:
final emojis = widget.request.sasEmojis;
final emojiWidgets = emojis.map((e) => Text(e.emoji, style: TextStyle(fontSize: 20))).toList();
var emojiWidgets = <Widget>[];
// maybe add a button to switch between the two and only determine default
// view for if "moji" is a present sasType or not?
if (widget.request.sasTypes.contains('emoji')) {
emojiWidgets = widget.request.sasEmojis.map((e) => Text(e.emoji, style: TextStyle(fontSize: 20))).toList();
} else {
final numbers = widget.request.sasNumbers;
emojiWidgets = <Widget>[
Text(numbers[0].toString(), style: TextStyle(fontSize: 40)),
Text('-', style: TextStyle(fontSize: 40)),
Text(numbers[1].toString(), style: TextStyle(fontSize: 40)),
Text('-', style: TextStyle(fontSize: 40)),
Text(numbers[2].toString(), style: TextStyle(fontSize: 40)),
];
}
return Column(
children: <Widget>[
Row(

View File

@ -133,8 +133,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "3b9be3546a87def69c10675f2d66e4697ab7dc1b"
resolved-ref: "3b9be3546a87def69c10675f2d66e4697ab7dc1b"
ref: "50889f9f30d6d083c3c5cf8b669418d82343e5ff"
resolved-ref: "50889f9f30d6d083c3c5cf8b669418d82343e5ff"
url: "https://gitlab.com/famedly/famedlysdk.git"
source: git
version: "0.0.1"

View File

@ -27,7 +27,7 @@ dependencies:
famedlysdk:
git:
url: https://gitlab.com/famedly/famedlysdk.git
ref: 3b9be3546a87def69c10675f2d66e4697ab7dc1b
ref: 50889f9f30d6d083c3c5cf8b669418d82343e5ff
localstorage: ^3.0.1+4
bubble: ^1.1.9+1