Skip to content

Commit

Permalink
ID Cards UI implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
GleammerRay committed Aug 28, 2022
1 parent a28af93 commit 7685e5e
Show file tree
Hide file tree
Showing 35 changed files with 1,151 additions and 878 deletions.
2 changes: 1 addition & 1 deletion lib/common/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:universal_io/io.dart';

import 'package:passy/passy_data/passy_data.dart';
import 'package:passy/screens/theme.dart';
import 'package:passy/common/theme.dart';

late PassyData data;

Expand Down
2 changes: 1 addition & 1 deletion lib/common/synchronization_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:passy/screens/log_screen.dart';
import 'package:passy/screens/main_screen.dart';
import 'package:passy/screens/splash_screen.dart';

import '../screens/theme.dart';
import 'theme.dart';

class SynchronizationWrapper {
final BuildContext _context;
Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:flutter/material.dart';
import 'package:passy/screens/edit_note_screen.dart';
import 'package:passy/screens/notes_screen.dart';

import 'screens/theme.dart';
import 'screens/id_cards_screen.dart';
import 'common/theme.dart';
import 'screens/backup_and_restore_screen.dart';
import 'screens/backup_screen.dart';
import 'screens/biometric_auth_screen.dart';
Expand Down Expand Up @@ -52,13 +53,14 @@ class Passy extends StatelessWidget {
ConnectScreen.routeName: (context) => const ConnectScreen(),
EditCustomFieldScreen.routeName: (context) =>
const EditCustomFieldScreen(),
EditIdCardScreen.routeName: (context) => const EditIdCardScreen(),
EditIDCardScreen.routeName: (context) => const EditIDCardScreen(),
EditIdentityScreen.routeName: (context) => const EditIdentityScreen(),
EditNoteScreen.routeName: (context) => const EditNoteScreen(),
EditPasswordScreen.routeName: (context) => const EditPasswordScreen(),
EditPaymentCardScreen.routeName: (context) =>
const EditPaymentCardScreen(),
IDCardScreen.routeName: (context) => const IDCardScreen(),
IDCardsScreen.routeName: (context) => const IDCardsScreen(),
IdentityScreen.routeName: (context) => const IdentityScreen(),
LogScreen.routeName: (context) => const LogScreen(),
LoginScreen.routeName: (context) => const LoginScreen(),
Expand Down
2 changes: 1 addition & 1 deletion lib/passy_data/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:encrypt/encrypt.dart';
import 'package:path/path.dart' as path;
import 'package:universal_io/io.dart';

const String passyVersion = '0.8.0';
const String passyVersion = '0.9.0';
//TODO: split versions after v1.0.0
const String syncVersion = passyVersion;
const String accountVersion = passyVersion;
Expand Down
5 changes: 3 additions & 2 deletions lib/passy_data/id_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class IDCard extends PassyEntry<IDCard> {
String country;

IDCard({
String? key,
List<CustomField>? customFields,
this.additionalInfo = '',
List<String>? tags,
Expand All @@ -35,7 +36,7 @@ class IDCard extends PassyEntry<IDCard> {
}) : pictures = pictures ?? [],
customFields = customFields ?? [],
tags = tags ?? [],
super(DateTime.now().toUtc().toIso8601String());
super(key ?? DateTime.now().toUtc().toIso8601String());

IDCard.fromJson(Map<String, dynamic> json)
: customFields = (json['customFields'] as List?)
Expand Down Expand Up @@ -96,7 +97,7 @@ class IDCard extends PassyEntry<IDCard> {
@override
List toCSV() => [
key,
customFields.map((e) => e.toCSV()),
customFields.map((e) => e.toCSV()).toList(),
additionalInfo,
tags,
nickname,
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/add_account_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/services.dart';
import 'package:passy/common/common.dart';

import 'assets.dart';
import 'theme.dart';
import '../common/theme.dart';
import 'common.dart';
import 'login_screen.dart';
import 'log_screen.dart';
Expand Down
32 changes: 13 additions & 19 deletions lib/screens/backup_and_restore_screen.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:passy/widgets/widgets.dart';

import 'backup_screen.dart';
import 'common.dart';
import 'restore_screen.dart';
import 'theme.dart';
import 'settings_screen.dart';

class BackupAndRestoreScreen extends StatefulWidget {
Expand Down Expand Up @@ -35,24 +35,18 @@ class _BackupAndRestoreScreen extends State<BackupAndRestoreScreen> {
),
body: ListView(
children: [
Padding(
padding: entryPadding,
child: getThreeWidgetButton(
center: const Text('Backup'),
left: const Icon(Icons.ios_share_rounded),
right: const Icon(Icons.arrow_forward_ios_rounded),
onPressed: () => _onBackupPressed(_username),
),
),
Padding(
padding: entryPadding,
child: getThreeWidgetButton(
center: const Text('Restore'),
left: const Icon(Icons.settings_backup_restore_rounded),
right: const Icon(Icons.arrow_forward_ios_rounded),
onPressed: _onRestorePressed,
),
),
PassyPadding(getThreeWidgetButton(
center: const Text('Backup'),
left: const Icon(Icons.ios_share_rounded),
right: const Icon(Icons.arrow_forward_ios_rounded),
onPressed: () => _onBackupPressed(_username),
)),
PassyPadding(getThreeWidgetButton(
center: const Text('Restore'),
left: const Icon(Icons.settings_backup_restore_rounded),
right: const Icon(Icons.arrow_forward_ios_rounded),
onPressed: _onRestorePressed,
)),
],
),
);
Expand Down
24 changes: 11 additions & 13 deletions lib/screens/backup_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:passy/common/common.dart';
import 'package:passy/widgets/widgets.dart';

import 'assets.dart';
import 'common.dart';
import 'theme.dart';
import '../common/theme.dart';

import 'backup_and_restore_screen.dart';

Expand Down Expand Up @@ -39,19 +40,16 @@ class _BackupScreen extends State<BackupScreen> {
centerTitle: true,
),
body: ListView(children: [
Padding(
padding: entryPadding,
child: getThreeWidgetButton(
center: const Text('Passy backup'),
left: SvgPicture.asset(
logoCircleSvg,
width: 25,
color: lightContentColor,
),
right: const Icon(Icons.arrow_forward_ios_rounded),
onPressed: () => _onPassyBackup(_username),
PassyPadding(getThreeWidgetButton(
center: const Text('Passy backup'),
left: SvgPicture.asset(
logoCircleSvg,
width: 25,
color: lightContentColor,
),
),
right: const Icon(Icons.arrow_forward_ios_rounded),
onPressed: () => _onPassyBackup(_username),
)),
]),
);
}
Expand Down
41 changes: 18 additions & 23 deletions lib/screens/biometric_auth_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import 'package:flutter_locker/flutter_locker.dart';
import 'package:passy/common/common.dart';
import 'package:passy/passy_data/biometric_storage_data.dart';
import 'package:passy/passy_data/common.dart';
import 'package:passy/widgets/widgets.dart';

import 'common.dart';
import 'settings_screen.dart';
import 'theme.dart';
import '../common/theme.dart';

class BiometricAuthScreen extends StatefulWidget {
static const routeName = '${SettingsScreen.routeName}/bioAuth';
Expand Down Expand Up @@ -71,31 +72,25 @@ class _BiometricAuthScreen extends State<BiometricAuthScreen> {
),
body: ListView(
children: [
Padding(
padding: entryPadding,
child: getThreeWidgetButton(
center: const Text('Biometric authentication'),
left: const Icon(Icons.fingerprint_rounded),
right: Switch(
value: data.loadedAccount!.bioAuthEnabled,
onChanged: (value) => setBioAuthEnabled(value),
),
onPressed: () =>
setBioAuthEnabled(!data.loadedAccount!.bioAuthEnabled),
PassyPadding(getThreeWidgetButton(
center: const Text('Biometric authentication'),
left: const Icon(Icons.fingerprint_rounded),
right: Switch(
value: data.loadedAccount!.bioAuthEnabled,
onChanged: (value) => setBioAuthEnabled(value),
),
),
onPressed: () =>
setBioAuthEnabled(!data.loadedAccount!.bioAuthEnabled),
)),
if (!data.loadedAccount!.bioAuthEnabled)
Padding(
padding: entryPadding,
child: TextFormField(
controller: TextEditingController(text: _password),
obscureText: true,
decoration: const InputDecoration(
labelText: 'Account password',
),
onChanged: (value) => _password = value,
PassyPadding(TextFormField(
controller: TextEditingController(text: _password),
obscureText: true,
decoration: const InputDecoration(
labelText: 'Account password',
),
),
onChanged: (value) => _password = value,
)),
],
),
);
Expand Down
Loading

0 comments on commit 7685e5e

Please sign in to comment.