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 { void _checkHomeserverAction(String homeserver, BuildContext context) async {
if (!homeserver.startsWith('https://')) { // if (!homeserver.startsWith('https://')) {
homeserver = 'https://$homeserver'; // homeserver = 'https://$homeserver';
} // }
final success = await SimpleDialogs(context).tryRequestWithLoadingDialog( final success = await SimpleDialogs(context).tryRequestWithLoadingDialog(
Matrix.of(context).client.checkServer(homeserver)); Matrix.of(context).client.checkServer(homeserver));
if (success != false) { if (success != false) {

View File

@ -42,8 +42,21 @@ class _KeyVerificationPageState extends State<KeyVerificationPage> {
case KeyVerificationState.waitingAccept: case KeyVerificationState.waitingAccept:
return Text('Waiting for partner to accept the request...'); return Text('Waiting for partner to accept the request...');
case KeyVerificationState.askSas: case KeyVerificationState.askSas:
final emojis = widget.request.sasEmojis; var emojiWidgets = <Widget>[];
final emojiWidgets = emojis.map((e) => Text(e.emoji, style: TextStyle(fontSize: 20))).toList(); // 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( return Column(
children: <Widget>[ children: <Widget>[
Row( Row(

View File

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

View File

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