Skip to content

Commit

Permalink
Merge pull request #178 from atsign-foundation/rsdk
Browse files Browse the repository at this point in the history
Add dependency overrides
  • Loading branch information
sitaram-kalluri authored Sep 1, 2021
2 parents 98d6123 + cd79dbb commit 763de47
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 19 deletions.
12 changes: 12 additions & 0 deletions at_chat_flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ dependencies:
cupertino_icons: ^1.0.3
at_onboarding_flutter: ^2.1.1

dependency_overrides:
at_client_mobile:
git:
url: https://github.com/atsign-foundation/at_client_sdk.git
path: at_client_mobile
ref: trunk

at_client:
git:
url: https://github.com/atsign-foundation/at_client_sdk.git
path: at_client
ref: trunk

dev_dependencies:
flutter_test:
Expand Down
15 changes: 14 additions & 1 deletion at_chat_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,20 @@ dependencies:
at_lookup: ^2.0.3
pedantic: ^1.11.0
#Picker
file_picker: ^4.0.0
file_picker: ^3.0.2+2

dependency_overrides:
at_client_mobile:
git:
url: https://github.com/atsign-foundation/at_client_sdk.git
path: at_client_mobile
ref: trunk

at_client:
git:
url: https://github.com/atsign-foundation/at_client_sdk.git
path: at_client
ref: trunk

dev_dependencies:
flutter_test:
Expand Down
12 changes: 12 additions & 0 deletions at_location_flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ dependencies:
at_lookup: ^2.0.1
at_utils: ^2.0.1

dependency_overrides:
at_client_mobile:
git:
url: https://github.com/atsign-foundation/at_client_sdk.git
path: at_client_mobile
ref: trunk

at_client:
git:
url: https://github.com/atsign-foundation/at_client_sdk.git
path: at_client
ref: trunk
dev_dependencies:
flutter_test:
sdk: flutter
Expand Down
13 changes: 13 additions & 0 deletions at_location_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ dependencies:
at_common_flutter: ^2.0.2
pedantic: ^1.11.0

dependency_overrides:
at_client_mobile:
git:
url: https://github.com/atsign-foundation/at_client_sdk.git
path: at_client_mobile
ref: trunk

at_client:
git:
url: https://github.com/atsign-foundation/at_client_sdk.git
path: at_client
ref: trunk

dev_dependencies:
flutter_test:
sdk: flutter
Expand Down
17 changes: 7 additions & 10 deletions at_onboarding_flutter/lib/screens/pair_atsign.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'dart:convert';

import 'dart:async';

import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';

Expand All @@ -22,12 +20,12 @@ import 'package:at_onboarding_flutter/widgets/custom_button.dart';
import 'package:at_onboarding_flutter/widgets/custom_dialog.dart';
import 'package:at_onboarding_flutter/widgets/custom_strings.dart';
import 'package:at_server_status/at_server_status.dart';
import 'package:at_utils/at_logger.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter_qr_reader/flutter_qr_reader.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:path_provider/path_provider.dart' as path_provider;
import 'package:at_utils/at_logger.dart';
import 'package:permission_handler/permission_handler.dart';

class PairAtsignWidget extends StatefulWidget {
final OnboardingStatus? onboardStatus;
Expand Down Expand Up @@ -101,8 +99,7 @@ class _PairAtsignWidgetState extends State<PairAtsignWidget> {
setState(() {
loading = true;
});
bool isExist =
await (_onboardingService.isExistingAtsign(atsign) as FutureOr<bool>);
bool isExist = await _onboardingService.isExistingAtsign(atsign);
if (isExist) {
setState(() {
loading = false;
Expand Down Expand Up @@ -286,7 +283,7 @@ class _PairAtsignWidgetState extends State<PairAtsignWidget> {
loading = true;
});
for (PlatformFile pickedFile in result?.files ?? <PlatformFile>[]) {
String path = pickedFile.path!;
String path = pickedFile.path;
File selectedFile = File(path);
int length = selectedFile.lengthSync();
if (length < 10) {
Expand Down Expand Up @@ -636,7 +633,7 @@ class _PairAtsignWidgetState extends State<PairAtsignWidget> {
_atsignStatus = atsignStatus ?? AtSignStatus.error;
switch (_atsignStatus) {
case AtSignStatus.teapot:
if (isExist!) {
if (isExist) {
await _showAlertDialog(CustomStrings().pairedAtsign(atsign),
getClose: true, onClose: _getAtsignForm);
break;
Expand Down Expand Up @@ -669,7 +666,7 @@ class _PairAtsignWidgetState extends State<PairAtsignWidget> {

break;
case AtSignStatus.activated:
if (isExist!) {
if (isExist) {
await _showAlertDialog(CustomStrings().pairedAtsign(atsign),
getClose: true, onClose: _getAtsignForm);
break;
Expand Down
17 changes: 9 additions & 8 deletions at_onboarding_flutter/lib/services/onboarding_service.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'dart:async';

import 'package:at_client_mobile/at_client_mobile.dart';
import 'package:at_onboarding_flutter/utils/app_constants.dart';
import 'package:at_onboarding_flutter/utils/response_status.dart';
import 'package:at_server_status/at_server_status.dart';
import 'package:flutter/material.dart';
import 'package:at_utils/at_logger.dart';
import 'package:flutter/material.dart';

class OnboardingService {
static final OnboardingService _singleton = OnboardingService._internal();
Expand Down Expand Up @@ -114,15 +115,15 @@ class OnboardingService {
if (cramSecret != null) {
_atClientPreference.privateKey = null;
}
await atClientService
bool isAuthenticated = await atClientService
.authenticate(atsign, _atClientPreference,
jsonData: jsonData, decryptKey: decryptKey, status: status)
.then((bool value) async {
_atsign = atsign;
jsonData: jsonData, decryptKey: decryptKey, status: status);
if(isAuthenticated){
_atsign = atsign;
atClientServiceMap.putIfAbsent(_atsign, () => atClientService);
c.complete(ResponseStatus.AUTH_SUCCESS);
await _sync(_atsign);
});
}
} catch (e) {
_logger.severe('error in authenticating => ${e.toString()}');
if (e == ResponseStatus.TIME_OUT) {
Expand Down Expand Up @@ -167,9 +168,9 @@ class OnboardingService {
return atsign;
}

Future<bool?> isExistingAtsign(String? atsign) async {
Future<bool> isExistingAtsign(String? atsign) async {
if (atsign == null) {
return null;
return false;
}
atsign = formatAtSign(atsign);
List<String>? atSignsList = await getAtsignList();
Expand Down

0 comments on commit 763de47

Please sign in to comment.