Skip to content

Commit

Permalink
Merge pull request #1708 from ardriveapp/PE-5955-metamask-login-follo…
Browse files Browse the repository at this point in the history
…w-up

PE-5955: Metamask Login Followup
  • Loading branch information
kunstmusik authored Apr 17, 2024
2 parents 38f3d03 + e8646ac commit fea5265
Show file tree
Hide file tree
Showing 132 changed files with 1,047 additions and 757 deletions.
3 changes: 1 addition & 2 deletions .fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"flutterSdkVersion": "3.13.6",
"flavors": {}
"flutterSdkVersion": "3.19.6"
}
4 changes: 4 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"flutter": "3.19.6",
"flavors": {}
}
7 changes: 5 additions & 2 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,13 @@ jobs:
ruby-version: '3.1'

# Install JDK
- uses: actions/setup-java@v3
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'
cache: 'gradle'
check-latest: true

# Set Flutter version from fvm
- uses: kuhnroyal/flutter-fvm-config-action@v1
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ app.*.map.json
# scan temporary files
**/fastlane/test_output

# fvm
/.fvm/flutter_sdk

# direnv
.direnv

# FVM Version Cache
.fvm/
9 changes: 6 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
},
"bloc.newBlocTemplate": "equatable",
"bloc.newCubitTemplate": "equatable",
"dart.additionalAnalyzerFileExtensions": ["drift"],
"dart.additionalAnalyzerFileExtensions": [
"drift"
],
"cSpell.words": [
"bento",
"Hkdf",
"hmac",
"sublist",
"Widgetbook"
]
}
],
"dart.flutterSdkPath": ".fvm/versions/3.19.6"
}
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33
compileSdkVersion 34

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -43,7 +43,7 @@ android {
defaultConfig {
applicationId "io.ardrive.app"
minSdkVersion 26
targetSdkVersion 33
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = "1.9.10"
ext.kotlin_version = "1.9.23"
repositories {
google()
jcenter()
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4096M
android.useAndroidX=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion assets/config/prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"stripePublishableKey": "pk_live_51JUAtwC8apPOWkDLMQqNF9sPpfneNSPnwX8YZ8y1FNDl6v94hZIwzgFSYl27bWE4Oos8CLquunUswKrKcaDhDO6m002Yj9AeKj",
"enablePins": true,
"useNewUploader": true,
"enableMetamaskLogin": false
"enableMetamaskLogin": true
}
4 changes: 2 additions & 2 deletions lib/app_shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class AppShell extends StatefulWidget {
final Widget page;

const AppShell({
Key? key,
super.key,
required this.page,
}) : super(key: key);
});

@override
AppShellState createState() => AppShellState();
Expand Down
4 changes: 2 additions & 2 deletions lib/authentication/components/biometric_toggle.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: use_build_context_synchronously

import 'package:ardrive/services/authentication/biometric_authentication.dart';
import 'package:ardrive/services/authentication/biometric_permission_dialog.dart';
import 'package:ardrive/utils/app_localizations_wrapper.dart';
Expand Down Expand Up @@ -93,15 +95,13 @@ class _BiometricToggleState extends State<BiometricToggle> {
setState(() {
_isEnabled = true;
});
// ignore: use_build_context_synchronously
context.read<BiometricAuthentication>().enable();
widget.onEnableBiometric?.call();
return;
}
} catch (e) {
widget.onError?.call();
if (e is BiometricException) {
// ignore: use_build_context_synchronously
showBiometricExceptionDialogForException(
context,
e,
Expand Down
4 changes: 2 additions & 2 deletions lib/authentication/components/breakpoint_layout_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class BreakpointLayoutBuilder extends StatelessWidget {
final WidgetBuilder phone;

const BreakpointLayoutBuilder({
Key? key,
super.key,
this.largeDesktop,
this.smallDesktop,
this.tablet,
required this.phone,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ class FadeThroughTransitionSwitcher extends StatelessWidget {
const FadeThroughTransitionSwitcher({
required this.fillColor,
required this.child,
Key? key,
}) : super(key: key);
super.key,
});

final Widget child;
final Color fillColor;
Expand Down
2 changes: 1 addition & 1 deletion lib/authentication/components/lined_text_divider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
class LinedTextDivider extends StatelessWidget {
final String text;

const LinedTextDivider({Key? key, this.text = 'or'}) : super(key: key);
const LinedTextDivider({super.key, this.text = 'or'});

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/authentication/components/login_copy_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ class LoginCopyButton extends StatefulWidget {
final Color? copyMessageColor;

const LoginCopyButton({
Key? key,
super.key,
required this.text,
this.size = 20,
this.showCopyText = true,
this.child,
this.positionY = 40,
this.positionX = 20,
this.copyMessageColor,
}) : super(key: key);
});

@override
// ignore: library_private_types_in_public_api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class MaxDeviceSizesConstrainedBox extends StatelessWidget {
final Widget child;

const MaxDeviceSizesConstrainedBox({
Key? key,
super.key,
this.maxHeightPercent = 0.8,
this.defaultMaxWidth = _defaultLoginCardMaxWidth,
this.defaultMaxHeight = _defaultLoginCardMaxHeight,
required this.child,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
2 changes: 2 additions & 0 deletions lib/authentication/login/views/modals/common.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: deprecated_member_use

import 'package:ardrive/authentication/components/button.dart';
import 'package:ardrive/authentication/components/login_modal.dart';
import 'package:ardrive/misc/resources.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import 'package:flutter_bloc/flutter_bloc.dart';

class EnterYourPasswordWidget extends StatefulWidget {
const EnterYourPasswordWidget({
Key? key,
super.key,
required this.loginBloc,
this.wallet,
this.derivedEthWallet,
required this.showWalletCreated,
required this.alreadyLoggedIn,
required this.checkingPassword,
required this.passwordFailed,
}) : super(key: key);
});

final Wallet? wallet;
final EthereumProviderWallet? derivedEthWallet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import 'package:bip39/bip39.dart' as bip39;
import 'package:flutter/material.dart';

class ImportWalletModal extends StatefulWidget {
const ImportWalletModal({Key? key, required this.loginBloc})
: super(key: key);
const ImportWalletModal({super.key, required this.loginBloc});

final LoginBloc loginBloc;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ import 'package:flutter_bloc/flutter_bloc.dart';

class SecureYourWalletWidget extends StatefulWidget {
const SecureYourWalletWidget(
{Key? key,
{super.key,
required this.loginBloc,
required this.wallet,
this.derivedEthWallet,
this.mnemonic,
required this.showTutorials,
required this.showWalletCreated})
: super(key: key);
required this.showWalletCreated});

final Wallet wallet;
final EthereumProviderWallet? derivedEthWallet;
Expand Down
15 changes: 8 additions & 7 deletions lib/authentication/login/views/tiles/tiles_view.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ignore_for_file: library_private_types_in_public_api
// ignore_for_file: library_private_types_in_public_api, deprecated_member_use

import 'package:ardrive/authentication/components/breakpoint_layout_builder.dart';
import 'package:ardrive/misc/misc.dart';
Expand All @@ -12,8 +12,8 @@ import 'package:flutter_svg/svg.dart';

class TilesView extends StatelessWidget {
const TilesView({
Key? key,
}) : super(key: key);
super.key,
});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -160,6 +160,7 @@ class TilesView extends StatelessWidget {
class _MilitaryGradeEncryption extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: replace with ArDriveTheme .isLight method
final isLightMode = ArDriveTheme.of(context).themeData.name == 'light';
return ClipRRect(
borderRadius: const BorderRadius.only(
Expand Down Expand Up @@ -504,10 +505,10 @@ class CarouselWithGroups extends StatefulWidget {
final Function() onEndHover;

const CarouselWithGroups({
Key? key,
super.key,
required this.onHover,
required this.onEndHover,
}) : super(key: key);
});

@override
_CarouselWithGroupsState createState() => _CarouselWithGroupsState();
Expand Down Expand Up @@ -623,13 +624,13 @@ class CustomIndicator extends StatefulWidget {
final Function(int) onClickDot;

const CustomIndicator({
Key? key,
super.key,
required this.index,
required this.currentPage,
required this.onPageAnimationEnd,
required this.onClickDot,
this.duration = const Duration(seconds: 10),
}) : super(key: key);
});

@override
_CustomIndicatorState createState() => _CustomIndicatorState();
Expand Down
5 changes: 3 additions & 2 deletions lib/authentication/login/views/wallet_created_view.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: deprecated_member_use

import 'dart:ui';

import 'package:ardrive/authentication/components/breakpoint_layout_builder.dart';
Expand All @@ -15,8 +17,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';

class WalletCreatedView extends StatefulWidget {
const WalletCreatedView({Key? key, this.mnemonic, required this.wallet})
: super(key: key);
const WalletCreatedView({super.key, this.mnemonic, required this.wallet});

final String? mnemonic;
final Wallet wallet;
Expand Down
3 changes: 1 addition & 2 deletions lib/blocs/data_export/data_export_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ class DataExportCubit extends Cubit<DataExportState> {
/// FIXME: context is not available here. Internationalization cannot be applied
/// name: appLocalizationsOf(context).exportFromCSV(driveId, DateTime.now().toString()),
final fileName = 'Export from $driveId ${DateTime.now().toString()}.csv';
final dataBytes =
utf8.encode((await getFilesInDriveAsCSV(driveId))) as Uint8List;
final dataBytes = utf8.encode((await getFilesInDriveAsCSV(driveId)));
emit(
DataExportSuccess(
bytes: dataBytes,
Expand Down
11 changes: 0 additions & 11 deletions lib/blocs/drive_detail/drive_detail_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,6 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
return availableRowsPerPage;
}

void setRowsPerPage(int rowsPerPage) {
switch (state.runtimeType) {
case DriveDetailLoadSuccess:
emit(
(state as DriveDetailLoadSuccess).copyWith(
rowsPerPage: rowsPerPage,
),
);
}
}

Future<void> selectDataItem(ArDriveDataTableItem item) async {
var state = this.state as DriveDetailLoadSuccess;

Expand Down
3 changes: 1 addition & 2 deletions lib/blocs/drives/drives_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ class DrivesLoadSuccess extends DrivesState {

class DrivesLoadedWithNoDrivesFound extends DrivesLoadSuccess {
DrivesLoadedWithNoDrivesFound({
required bool canCreateNewDrive,
required super.canCreateNewDrive,
}) : super(
selectedDriveId: null,
userDrives: [],
sharedDrives: [],
drivesWithAlerts: [],
canCreateNewDrive: canCreateNewDrive,
);
}
4 changes: 2 additions & 2 deletions lib/blocs/feedback_survey/feedback_survey_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class FeedbackSurveyCubit extends Cubit<FeedbackSurveyState> {
bool _hasAlreadyBeenOpened = false;

FeedbackSurveyCubit(
FeedbackSurveyState initialState, {
super.initialState, {
/// takes a KeyValueStore for testing purposes
KeyValueStore? store,
}) : super(initialState) {
}) {
_maybeStore ??= store;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/blocs/file_download/file_download_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ part 'shared_file_download_cubit.dart';
/// [FileDownloadCubit] is the abstract superclass for [Cubit]s that include
/// logic for download user files.
abstract class FileDownloadCubit extends Cubit<FileDownloadState> {
FileDownloadCubit(FileDownloadState state) : super(state);
FileDownloadCubit(super.state);

FutureOr<void> abortDownload() {}
}
Loading

0 comments on commit fea5265

Please sign in to comment.