-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from Ishad-M-I-M/main
UI improvements
- Loading branch information
Showing
49 changed files
with
542 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+309 KB
(3000%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+390 Bytes
(170%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.15 KB
(190%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.76 KB
(280%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+594 Bytes
(160%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.43 KB
(250%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.94 KB
(420%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.15 KB
(190%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.86 KB
(360%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9.76 KB
(480%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9.76 KB
(480%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+19.1 KB
(610%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
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 modified
BIN
+4.36 KB
(340%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+14.5 KB
(550%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+16.8 KB
(580%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import 'package:bloc/bloc.dart'; | ||
import 'package:meta/meta.dart'; | ||
|
||
import '../../services/secure_storage_service.dart'; | ||
import '../../services/user_contract_service.dart'; | ||
|
||
part 'settings_event.dart'; | ||
|
||
part 'settings_state.dart'; | ||
|
||
class SettingsBloc extends Bloc<SettingsEvent, SettingsState> { | ||
SettingsBloc() : super(Initial()) { | ||
on<LoadEvent>((event, emit) async { | ||
emit(Loading()); | ||
var privateKey = await SecureStorageService.get("private-key") as String; | ||
var contractAddress = | ||
await SecureStorageService.get("contract-address") as String; | ||
|
||
var service = UserContractService(); | ||
var userInfo = await service.getAll(contractAddress, privateKey); | ||
emit(Loaded( | ||
privateKey: privateKey, | ||
contractAddress: contractAddress, | ||
email: userInfo['Email'] as String, | ||
phone: userInfo['Phone'] as String)); | ||
}); | ||
|
||
on<EditEvent>((event, emit) async { | ||
emit(Loading()); | ||
try{ | ||
var service = UserContractService(); | ||
if (event.editedProperty == "email"){ | ||
await service.setEmail(event.email, contractAddress: event.contractAddress, privateKey: event.privateKey); | ||
} | ||
else if(event.editedProperty == "phone"){ | ||
await service.setMobile(event.phone, contractAddress: event.contractAddress, privateKey: event.privateKey); | ||
} | ||
else{ | ||
throw Exception("Unexpected Error"); | ||
} | ||
emit(Loaded(privateKey: event.privateKey, contractAddress: event.contractAddress, email: event.email, phone: event.phone)); | ||
} | ||
catch(e){ | ||
emit(Failed(e.toString())); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
part of 'settings_bloc.dart'; | ||
|
||
@immutable | ||
abstract class SettingsEvent {} | ||
|
||
class LoadEvent extends SettingsEvent{} | ||
|
||
class EditEvent extends SettingsEvent{ | ||
final String editedProperty; | ||
final String privateKey; | ||
final String contractAddress; | ||
final String email; | ||
final String phone; | ||
EditEvent(this.editedProperty, {required this.privateKey, required this.contractAddress, required this.email, required this.phone}); | ||
} | ||
|
||
class VerifyEmail extends SettingsEvent{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
part of 'settings_bloc.dart'; | ||
|
||
@immutable | ||
abstract class SettingsState {} | ||
|
||
class Initial extends SettingsState {} | ||
|
||
class Loading extends SettingsState{} | ||
|
||
class Loaded extends SettingsState{ | ||
final String privateKey; | ||
final String contractAddress; | ||
final String email; | ||
final String phone; | ||
Loaded({required this.privateKey, required this.contractAddress, required this.email, required this.phone}); | ||
} | ||
|
||
class Failed extends SettingsState { | ||
final String message; | ||
Failed(this.message); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.