Skip to content

Commit

Permalink
Recursively call the account creation api for the set username (#2344)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjawadDeveloper2 authored Apr 1, 2024
1 parent ef21f2a commit 946f466
Show file tree
Hide file tree
Showing 64 changed files with 1,280 additions and 1,179 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
"go.lintTool": "golangci-lint",
"go.inferGopath": false,
"git.ignoreLimitWarning": true,
"dart.lineLength": 120,
}
4 changes: 2 additions & 2 deletions dart_sdk/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 31
compileSdkVersion 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -45,7 +45,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.pylons.example"
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
10 changes: 7 additions & 3 deletions dart_sdk/lib/src/ui/pylons_loading_animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ class PylonsLoadingAnimation {
context: context,
barrierDismissible: true,
barrierColor: Colors.white.withOpacity(0),
builder: (ctx) => WillPopScope(
onWillPop: () async => false,
builder: (ctx) => PopScope(
canPop: false,
child: AlertDialog(
elevation: 0,
backgroundColor: Colors.transparent,
content: SizedBox(height: _height, width: _width, child: Image.asset('assets/loading.gif', package: 'pylons_sdk',)),
content: SizedBox(
height: _height,
width: _width,
child: Image.asset('assets/loading.gif', package: 'pylons_sdk'),
),
),
),
);
Expand Down
1 change: 0 additions & 1 deletion easel/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ analyzer:
avoid_setters_without_getters: ignore
import_of_legacy_library_into_null_safe: error
avoid_single_cascade_in_expression_statements: ignore
null_aware_in_logical_operator: error
missing_required_param: error
# implicit_dynamic_map_literal: ignore
prefer_single_quotes: ignore
Expand Down
4 changes: 2 additions & 2 deletions easel/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ apply plugin: 'com.google.firebase.crashlytics'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33
compileSdkVersion 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -47,7 +47,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "tech.pylons.easel"
minSdkVersion 21
targetSdkVersion 32
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName

Expand Down
4 changes: 2 additions & 2 deletions easel/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.9.22'
repositories {
google()
mavenCentral()
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion easel/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class MyApp extends StatelessWidget {
builder: (context, widget) {
ScreenUtil.init(context);
return MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
data: MediaQuery.of(context).copyWith(textScaler: TextScaler.noScaling),
child: widget!,
);
},
Expand Down
44 changes: 22 additions & 22 deletions easel/lib/repository/repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ class RepositoryImp implements Repository {
log(sdkResponse.toString(), name: 'pylons_sdk');

return Right(sdkResponse);
} on Exception catch (_) {
crashlyticsHelper.recordFatalError(error: _.toString());
} on Exception catch (exception) {
crashlyticsHelper.recordFatalError(error: exception.toString());
return Left(CookBookNotFoundFailure(LocaleKeys.cookbook_not_found.tr()));
}
}
Expand Down Expand Up @@ -261,8 +261,8 @@ class RepositoryImp implements Repository {
try {
final int id = await localDataSource.saveNft(nft);
return Right(id);
} on Exception catch (_) {
crashlyticsHelper.recordFatalError(error: _.toString());
} on Exception catch (exception) {
crashlyticsHelper.recordFatalError(error: exception.toString());
return Left(CacheFailure(LocaleKeys.save_error.tr()));
}
}
Expand All @@ -276,8 +276,8 @@ class RepositoryImp implements Repository {
return Left(CacheFailure(LocaleKeys.upload_error.tr()));
}
return Right(result);
} on Exception catch (_) {
crashlyticsHelper.recordFatalError(error: _.toString());
} on Exception catch (exception) {
crashlyticsHelper.recordFatalError(error: exception.toString());
return Left(CacheFailure(LocaleKeys.upload_error.tr()));
}
}
Expand All @@ -291,8 +291,8 @@ class RepositoryImp implements Repository {
return Left(CacheFailure(LocaleKeys.upload_error.tr()));
}
return Right(result);
} on Exception catch (_) {
crashlyticsHelper.recordFatalError(error: _.toString());
} on Exception catch (exception) {
crashlyticsHelper.recordFatalError(error: exception.toString());
return Left(CacheFailure(LocaleKeys.upload_error.tr()));
}
}
Expand All @@ -303,8 +303,8 @@ class RepositoryImp implements Repository {
final bool result = await localDataSource.updateNftFromPrice(saveNft);

return Right(result);
} on Exception catch (_) {
crashlyticsHelper.recordFatalError(error: _.toString());
} on Exception catch (exception) {
crashlyticsHelper.recordFatalError(error: exception.toString());
return Left(CacheFailure(LocaleKeys.upload_error.tr()));
}
}
Expand All @@ -319,8 +319,8 @@ class RepositoryImp implements Repository {
final storageResponseModel = await remoteDataSource.uploadFile(file: file, uploadProgressCallback: onUploadProgressCallback);

return Right(storageResponseModel);
} on Exception catch (_) {
crashlyticsHelper.recordFatalError(error: _.toString());
} on Exception catch (exception) {
crashlyticsHelper.recordFatalError(error: exception.toString());
return Left(CacheFailure(LocaleKeys.update_failed.tr()));
}
}
Expand All @@ -331,8 +331,8 @@ class RepositoryImp implements Repository {
final response = await localDataSource.getNfts();

return Right(response);
} on Exception catch (_) {
crashlyticsHelper.recordFatalError(error: _.toString());
} on Exception catch (exception) {
crashlyticsHelper.recordFatalError(error: exception.toString());
return Left(CacheFailure(LocaleKeys.something_wrong.tr()));
}
}
Expand All @@ -342,8 +342,8 @@ class RepositoryImp implements Repository {
try {
final bool result = await localDataSource.deleteNft(id);
return Right(result);
} on Exception catch (_) {
crashlyticsHelper.recordFatalError(error: _.toString());
} on Exception catch (exception) {
crashlyticsHelper.recordFatalError(error: exception.toString());
return Left(CacheFailure(LocaleKeys.something_wrong.tr()));
}
}
Expand All @@ -356,8 +356,8 @@ class RepositoryImp implements Repository {
return Left(CacheFailure(LocaleKeys.something_wrong.tr()));
}
return Right(data);
} on Exception catch (_) {
crashlyticsHelper.recordFatalError(error: _.toString());
} on Exception catch (exception) {
crashlyticsHelper.recordFatalError(error: exception.toString());
return Left(CacheFailure(LocaleKeys.something_wrong.tr()));
}
}
Expand All @@ -368,8 +368,8 @@ class RepositoryImp implements Repository {
final PickedFileModel pickedFileModel = await fileUtilsHelper.pickFile(format);

return Right(pickedFileModel);
} on Exception catch (_) {
crashlyticsHelper.recordFatalError(error: _.toString());
} on Exception catch (exception) {
crashlyticsHelper.recordFatalError(error: exception.toString());
return Left(PickingFileFailure(message: LocaleKeys.picking_file_error.tr()));
}
}
Expand Down Expand Up @@ -399,8 +399,8 @@ class RepositoryImp implements Repository {
try {
final file = await fileUtilsHelper.launchMyUrl(url: url);
return Right(file);
} catch (_) {
crashlyticsHelper.recordFatalError(error: _.toString());
} catch (exception) {
crashlyticsHelper.recordFatalError(error: exception.toString());
return Left(UrlLaunchingFileFailure(message: LocaleKeys.url_launching_error.tr()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DeleteDialog {
barrierColor: Colors.black38,
barrierDismissible: false,
context: contextt,
builder: (_) {
builder: (context) {
return Dialog(
elevation: 0,
insetPadding: EdgeInsets.symmetric(horizontal: isTablet ? 45.w : 15.w),
Expand Down Expand Up @@ -75,7 +75,7 @@ class DeleteDialog {
fontWeight: FontWeight.w300,
clipperType: ClipperType.bottomLeftTopRight,
onPressed: () async {
Navigator.of(_).pop();
Navigator.of(context).pop();
creatorHubViewModel.deleteNft(nft.id);
},
cuttingHeight: 12.h,
Expand All @@ -90,7 +90,7 @@ class DeleteDialog {
bgColor: EaselAppTheme.kWhite.withOpacity(0.3),
textColor: EaselAppTheme.kWhite,
onPressed: () {
Navigator.of(_).pop();
Navigator.of(context).pop();
},
cuttingHeight: 12.h,
fontWeight: FontWeight.w300,
Expand Down
2 changes: 2 additions & 0 deletions easel/lib/screens/creator_hub/widgets/draft_list_tile.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: use_build_context_synchronously

import 'package:cached_network_image/cached_network_image.dart';
import 'package:easel_flutter/easel_provider.dart';
import 'package:easel_flutter/main.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ class _DraftDetailDialogState extends State<_DraftDetailDialog> {
Widget build(BuildContext context) {
final EaselProvider easelProvider = context.watch<EaselProvider>();

return WillPopScope(
onWillPop: () async => false,
return PopScope(
canPop: false,
child: Dialog(
backgroundColor: EaselAppTheme.kTransparent,
insetPadding: EdgeInsets.symmetric(horizontal: isTablet ? 65.w : 21.w),
Expand Down
8 changes: 3 additions & 5 deletions easel/lib/screens/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@ class HomeScreenState extends State<HomeScreen> {

@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
onBackPressed();
return false;
},
return PopScope(
canPop: false,
onPopInvoked: (didPop) => onBackPressed(),
child: ColoredBox(
color: EaselAppTheme.kWhite,
child: SafeArea(
Expand Down
Loading

0 comments on commit 946f466

Please sign in to comment.