Skip to content

Commit

Permalink
feat: add screens for deleting authenticator (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-alcides authored Aug 27, 2024
1 parent e2b8faf commit 5425726
Show file tree
Hide file tree
Showing 37 changed files with 887 additions and 277 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/icons/icon_wallet_protect_fill.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 9 additions & 8 deletions lib/app/components/card/rounded_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ class RoundedCard extends StatelessWidget {
this.padding,
this.borderColor,
this.backgroundColor,
required this.isOutlined,
});

static double get cellPadding => 12.0.s;

final Widget child;
final EdgeInsets? padding;
final Color? borderColor;
final Color? backgroundColor;
final bool isOutlined;

factory RoundedCard.filled({
required Widget child,
Expand All @@ -25,6 +25,7 @@ class RoundedCard extends StatelessWidget {
child: child,
padding: padding,
backgroundColor: backgroundColor,
isOutlined: false,
);
}

Expand All @@ -39,20 +40,20 @@ class RoundedCard extends StatelessWidget {
padding: padding ?? EdgeInsets.zero,
borderColor: borderColor,
backgroundColor: backgroundColor,
isOutlined: true,
);
}

@override
Widget build(BuildContext context) {
final BorderRadius borderRadius = BorderRadius.circular(16.0.s);
final Color? color = borderColor ?? context.theme.appColors.onTerararyFill;

return Container(
padding: padding ?? EdgeInsets.all(cellPadding),
padding: padding ?? EdgeInsets.all(12.0.s),
decoration: BoxDecoration(
borderRadius: borderRadius,
borderRadius: BorderRadius.circular(16.0.s),
color: backgroundColor ?? context.theme.appColors.tertararyBackground,
border: color != null ? Border.all(color: color) : null,
border: isOutlined
? Border.all(color: borderColor ?? context.theme.appColors.onSecondaryBackground)
: null,
),
child: child,
);
Expand Down
36 changes: 36 additions & 0 deletions lib/app/components/card/warning_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'package:flutter/material.dart';
import 'package:ice/app/components/card/rounded_card.dart';
import 'package:ice/app/components/list_item/list_item.dart';
import 'package:ice/app/extensions/extensions.dart';
import 'package:ice/generated/assets.gen.dart';

class WarningCard extends StatelessWidget {
const WarningCard({
super.key,
required this.text,
});

final String text;

@override
Widget build(BuildContext context) {
return RoundedCard.outlined(
padding: EdgeInsets.symmetric(horizontal: 10.0.s),
child: ListItem(
contentPadding: EdgeInsets.zero,
borderRadius: BorderRadius.all(Radius.circular(16.0.s)),
leading: Assets.images.icons.iconReport.icon(
size: 20.0.s,
color: context.theme.appColors.attentionRed,
),
title: Text(
text,
style: context.theme.appTextThemes.caption.copyWith(
color: context.theme.appColors.attentionRed,
),
maxLines: 3,
),
),
);
}
}
23 changes: 23 additions & 0 deletions lib/app/components/progress_bar/app_progress_bar.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:flutter/material.dart';
import 'package:ice/app/extensions/extensions.dart';

class AppProgressIndicator extends StatelessWidget {
final double progressValue;

const AppProgressIndicator({
super.key,
required this.progressValue,
});

@override
Widget build(BuildContext context) {
return SizedBox(
height: 3.0.s,
child: LinearProgressIndicator(
value: progressValue,
backgroundColor: context.theme.appColors.secondaryBackground,
valueColor: AlwaysStoppedAnimation<Color>(context.theme.appColors.primaryAccent),
),
);
}
}
46 changes: 46 additions & 0 deletions lib/app/components/progress_bar/sliver_app_bar_with_progress.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import 'package:flutter/material.dart';
import 'package:ice/app/components/progress_bar/app_progress_bar.dart';
import 'package:ice/app/extensions/extensions.dart';
import 'package:ice/app/router/components/navigation_app_bar/navigation_app_bar.dart';
import 'package:ice/app/router/components/navigation_app_bar/navigation_close_button.dart';

class SliverAppBarWithProgress extends StatelessWidget {
const SliverAppBarWithProgress({
super.key,
this.progressValue,
required this.title,
required this.onClose,
this.showBackButton = true,
this.showProgress = true,
});

final double? progressValue;
final String? title;
final VoidCallback onClose;
final bool showBackButton;
final bool showProgress;

@override
Widget build(BuildContext context) {
final showProgressIndicator = showProgress && progressValue != null;

return SliverAppBar(
primary: false,
flexibleSpace: Column(
children: [
NavigationAppBar.modal(
title: title != null ? Text(title!) : null,
showBackButton: showBackButton,
actions: [
NavigationCloseButton(onPressed: onClose),
],
),
if (showProgressIndicator) AppProgressIndicator(progressValue: progressValue!),
],
),
automaticallyImplyLeading: false,
toolbarHeight: NavigationAppBar.modalHeaderHeight + (showProgressIndicator ? 3.0.s : 0),
pinned: true,
);
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CopyKeyCard extends HookWidget {

final isCopied = useState(false);

return RoundedCard.outlined(
return RoundedCard.filled(
padding: EdgeInsets.symmetric(vertical: 40.0.s),
child: Column(
children: [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:ice/app/extensions/extensions.dart';
import 'package:ice/app/features/auth/data/models/twofa_type.dart';
import 'package:ice/app/features/auth/views/pages/twofa_codes/twofa_code_input.dart';

class TwoFaCodeInputList extends HookWidget {
final List<TwoFaType> twoFaTypes;

const TwoFaCodeInputList({
super.key,
required this.twoFaTypes,
});

@override
Widget build(BuildContext context) {
final controllers = {
for (final type in twoFaTypes)
type: useTextEditingController.fromValue(TextEditingValue.empty),
};

return Column(
children: twoFaTypes.map((twoFaType) {
return Padding(
padding: EdgeInsets.only(bottom: 22.0.s),
child: TwoFaCodeInput(
controller: controllers[twoFaType]!,
twoFaType: twoFaType,
),
);
}).toList(),
);
}
}
Loading

0 comments on commit 5425726

Please sign in to comment.