5 Commits

Author SHA1 Message Date
Stephen
d3e455c371 [Change Pass] 4. revisi pemberian token ke BE 2024-01-21 13:05:58 +07:00
Stephen
6b28794577 Merge branch 'main' into add_change_password 2024-01-19 15:11:39 +07:00
sindhu
c67f771d25 step 30 : update versi 1.1.5 2024-01-19 12:14:11 +07:00
sindhu
2cab59c86c step 29 : add base 64 param in repository insert tx 2024-01-19 12:13:19 +07:00
sindhu
c2f43f9061 step 28 : add usertransaki home dan history 2024-01-19 10:44:49 +07:00
11 changed files with 122 additions and 30 deletions

View File

@@ -1,13 +1,14 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application <application
android:label="PettyCash" android:label="PettyCash"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/launcher_icon" android:icon="@mipmap/launcher_icon"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
> >
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true" android:exported="true"

View File

@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<external-path name="external_storage_directory" path="." /> <external-path name="external_storage_directory" path="." />
<external-path name="external_files" path="."/>
</resources> </resources>

View File

@@ -13,7 +13,7 @@ class Constant {
// static String version = "1.00"; // static String version = "1.00";
// NOTE VERSI HARUS SAMA DENGAN PUBSPEC.YAML // NOTE VERSI HARUS SAMA DENGAN PUBSPEC.YAML
static String version = "1.1.0"; static String version = "1.1.5";
// static String baseUrl = "https://devregonline.pramita.co.id/one-api/xdoc/"; // static String baseUrl = "https://devregonline.pramita.co.id/one-api/xdoc/";

View File

@@ -62,11 +62,13 @@ class AuthRepository extends BaseRepository {
Future<String> changePassword({ Future<String> changePassword({
required String userID, required String userID,
required String token, required String token,
required String tokenx,
required String oldPassword, required String oldPassword,
required String newPassword, required String newPassword,
required String confirmPassword, required String confirmPassword,
}) async { }) async {
final param = { final param = {
"tokenx": tokenx,
"token": token, "token": token,
"M_UserID": userID, "M_UserID": userID,
"old_password": oldPassword, "old_password": oldPassword,

View File

@@ -100,6 +100,7 @@ class TransaksiRepository extends BaseRepository {
'userid': userid, 'userid': userid,
'sender': sender, 'sender': sender,
'companyid': M_CompanyID, 'companyid': M_CompanyID,
'base64File': base64file,
'fileName': fileName, 'fileName': fileName,
'fileSize': fileSize, 'fileSize': fileSize,
'fileEkstension': fileExtension 'fileEkstension': fileExtension

View File

@@ -40,7 +40,6 @@ class ChangePasswordStateDone extends ChangePasswordState {
}) : super(DateTime.now()); }) : super(DateTime.now());
} }
//notifier //notifier
class ChangePasswordNotifier extends StateNotifier<ChangePasswordState> { class ChangePasswordNotifier extends StateNotifier<ChangePasswordState> {
final Ref ref; final Ref ref;
@@ -51,16 +50,21 @@ class ChangePasswordNotifier extends StateNotifier<ChangePasswordState> {
void postChangePassword({ void postChangePassword({
required String userID, required String userID,
required String userToken, required String userToken,
required String userTokenx,
required String oldPassword, required String oldPassword,
required String newPassword, required String newPassword,
required String confirmPassword, required String confirmPassword,
}) async {
}) async {
try { try {
state = ChangePasswordStateLoading(); state = ChangePasswordStateLoading();
final dio = ref.read(dioProvider); final dio = ref.read(dioProvider);
final resp = final resp = await AuthRepository(dio: dio).changePassword(
await AuthRepository(dio: dio).changePassword(userID: userID,token: userToken, oldPassword: oldPassword, newPassword: newPassword, confirmPassword: confirmPassword); userID: userID,
tokenx: userTokenx,
token: userToken,
oldPassword: oldPassword,
newPassword: newPassword,
confirmPassword: confirmPassword);
state = ChangePasswordStateDone(model: resp); state = ChangePasswordStateDone(model: resp);
} catch (e) { } catch (e) {
if (e is BaseRepositoryException) { if (e is BaseRepositoryException) {
@@ -76,4 +80,4 @@ class ChangePasswordNotifier extends StateNotifier<ChangePasswordState> {
final ChangePasswordProvider = final ChangePasswordProvider =
StateNotifierProvider<ChangePasswordNotifier, ChangePasswordState>( StateNotifierProvider<ChangePasswordNotifier, ChangePasswordState>(
(ref) => ChangePasswordNotifier(ref: ref), (ref) => ChangePasswordNotifier(ref: ref),
); );

View File

@@ -23,6 +23,7 @@ class ChangePasswordScreen extends HookConsumerWidget {
//menampung user token jika ada //menampung user token jika ada
final userToken = ref.read(currentUserProvider)?.token ?? ""; final userToken = ref.read(currentUserProvider)?.token ?? "";
final userID = ref.read(currentUserProvider)?.model.M_UserID ?? "0"; final userID = ref.read(currentUserProvider)?.model.M_UserID ?? "0";
final tokenx = ref.read(currentUserProvider)?.token ?? "";
final isLoading = useState(false); final isLoading = useState(false);
final obscureText = useState<bool>(true); final obscureText = useState<bool>(true);
@@ -357,6 +358,7 @@ class ChangePasswordScreen extends HookConsumerWidget {
ref ref
.read(ChangePasswordProvider.notifier) .read(ChangePasswordProvider.notifier)
.postChangePassword( .postChangePassword(
userTokenx: tokenx,
userToken: userToken, userToken: userToken,
userID: userID, userID: userID,
oldPassword: ctrlOldPassword.text, oldPassword: ctrlOldPassword.text,

View File

@@ -430,7 +430,8 @@ class HomeScreen extends HookConsumerWidget {
Align( Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Text(
listTransaksiHome.value[idx].note listTransaksiHome
.value[idx].note
.toString(), .toString(),
style: Constant.body1( style: Constant.body1(
context: context) context: context)
@@ -446,7 +447,7 @@ class HomeScreen extends HookConsumerWidget {
context: context, y: 10), context: context, y: 10),
), ),
// Tanggal Created align right // Tanggal Created and by align right
Row( Row(
mainAxisAlignment: mainAxisAlignment:
@@ -472,6 +473,30 @@ class HomeScreen extends HookConsumerWidget {
fontSize: 14, fontSize: 14,
), ),
), ),
Expanded(
child: Container(
child: Text(
' by : ' +
listTransaksiHome
.value[idx]
.usertransaksi
.toString(),
overflow:
TextOverflow.ellipsis,
style: Constant.body1(
context: context)
.copyWith(
fontWeight:
FontWeight.normal,
fontStyle:
FontStyle.italic,
color: Constant
.pcBtnBackgroundColor,
fontSize: 14,
),
),
),
),
], ],
), ),
], ],

View File

@@ -1362,28 +1362,66 @@ class HistoryTransaksiScreen extends HookConsumerWidget {
), ),
], ],
), ),
// Tanggal Created align right // Tanggal Created dan by align right
Row( Column(
mainAxisAlignment:
MainAxisAlignment.end,
children: [ children: [
Text( Align(
'created : ' + alignment:
formatDateString( Alignment.centerRight,
listSearchHistory child: Row(
.value[idx] mainAxisAlignment:
.tanggalcreated MainAxisAlignment.end,
.toString(), children: [
Text(
'created : ' +
formatDateString(
listSearchHistory
.value[idx]
.tanggalcreated
.toString(),
),
overflow:
TextOverflow.ellipsis,
style: Constant.body1(
context: context)
.copyWith(
fontWeight:
FontWeight.normal,
fontStyle:
FontStyle.italic,
color:
Constant.textBlack,
fontSize: 14,
),
), ),
overflow: TextOverflow.ellipsis, Expanded(
style: Constant.body1( child: Container(
context: context) child: Text(
.copyWith( ' by : ' +
fontWeight: FontWeight.normal, listSearchHistory
fontStyle: FontStyle.italic, .value[idx]
color: Constant.textBlack, .usertransaksi
fontSize: 14, .toString(),
overflow: TextOverflow
.ellipsis,
style: Constant.body1(
context:
context)
.copyWith(
fontWeight:
FontWeight
.normal,
fontStyle: FontStyle
.italic,
color: Constant
.pcBtnBackgroundColor,
fontSize: 14,
),
),
),
),
],
), ),
), ),
], ],

View File

@@ -278,6 +278,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
flutter_share:
dependency: "direct main"
description:
name: flutter_share
sha256: ae12c1cea13b35926a109824ffac601531e40cb94ad53eeae58625eceb3eaaaa
url: "https://pub.dev"
source: hosted
version: "2.0.0"
flutter_svg: flutter_svg:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -901,6 +909,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.3.0" version: "0.3.0"
whatsapp_share:
dependency: "direct main"
description:
name: whatsapp_share
sha256: d1884f302a52d9f400bc3d7d4274b77aad83424e08f425351cea8d13b4cb8649
url: "https://pub.dev"
source: hosted
version: "2.0.2"
win32: win32:
dependency: transitive dependency: transitive
description: description:

View File

@@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.1.0 version: 1.1.5
environment: environment:
sdk: '>=3.0.6 <4.0.0' sdk: '>=3.0.6 <4.0.0'
@@ -58,6 +58,8 @@ dependencies:
photo_view: ^0.14.0 photo_view: ^0.14.0
mime: ^1.0.4 mime: ^1.0.4
path_provider: ^2.1.2 path_provider: ^2.1.2
flutter_share: ^2.0.0
whatsapp_share: ^2.0.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: