Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
Tour Travel Agency AGR
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dio Maulana
Tour Travel Agency AGR
Commits
6a1a5ccf
Commit
6a1a5ccf
authored
Jun 12, 2023
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all views done
parent
1ff45874
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
698 additions
and
114 deletions
+698
-114
all_api.dart
lib/api/all_api.dart
+182
-0
verification_otp.dart
lib/helper/argument_route/verification_otp.dart
+9
-0
profile_model.dart
lib/models/profile_model.dart
+19
-0
reimburse_mode.dart
lib/models/reimburse_mode.dart
+31
-0
transaction_model.dart
lib/models/transaction_model.dart
+51
-0
forgot_password.dart
lib/page/forgot_password/forgot_password.dart
+12
-4
login.dart
lib/page/login/login.dart
+22
-3
otp_verification.dart
lib/page/otp_verification/otp_verification.dart
+104
-43
edit_profile.dart
lib/page/profile/edit_profile/edit_profile.dart
+17
-17
register.dart
lib/page/register/register.dart
+47
-2
reset_password.dart
lib/page/reset_password/reset_password.dart
+27
-1
reset_success.dart
lib/page/reset_password/reset_success.dart
+119
-0
assets.dart
lib/resource/assets.dart
+2
-0
font.dart
lib/resource/font.dart
+1
-0
routes.dart
lib/resource/routes.dart
+36
-43
strings.dart
lib/resource/strings.dart
+16
-0
GeneratedPluginRegistrant.swift
macos/Flutter/GeneratedPluginRegistrant.swift
+2
-0
agr_icon.png
web/agr_icon.png
+0
-0
index.html
web/index.html
+1
-1
No files found.
lib/api/all_api.dart
0 → 100644
View file @
6a1a5ccf
import
'dart:convert'
;
import
'package:tour_travel_agr/api/response_api.dart'
;
import
'package:tour_travel_agr/helper/prefs.dart'
;
import
'package:tour_travel_agr/main.dart'
;
import
'package:tour_travel_agr/resource/strings.dart'
;
class
Api
{
static
Future
<
ApiResponse
>
login
(
String
mobilePhone
,
String
password
,
)
async
{
String
apiUrl
=
"
$baseUrl${endPoint}
login"
;
try
{
Map
<
String
,
dynamic
>
data
=
{
"mobile_phone"
:
mobilePhone
,
"password"
:
password
,
"app_version"
:
getAppVersion
(),
};
String
bodies
=
jsonEncode
(
data
);
dynamic
jsonObject
=
await
httpRequest
(
typePost
,
apiUrl
,
"login"
,
bodies:
bodies
,
);
if
(
jsonObject
==
false
)
{
return
ApiResponse
(
error:
true
,
msg:
Strings
.
cantConnectToServer
);
}
else
{
if
(
jsonObject
[
'status'
]
==
'ok'
)
{
setSessionId
(
jsonObject
[
'data'
][
'session_id'
]);
return
ApiResponse
(
error:
false
,
msg:
"Success login"
);
}
else
{
return
ApiResponse
(
error:
true
,
msg:
jsonObject
[
'msg'
],
);
}
}
}
catch
(
e
)
{
return
ApiResponse
(
error:
true
,
msg:
Strings
.
serverError
);
}
}
static
Future
<
ApiResponse
>
register
(
String
name
,
String
nik
,
String
mobile
,
String
password
,
String
cPassword
)
async
{
String
apiUrl
=
"
$baseUrl${endPoint}
registration"
;
try
{
Map
<
String
,
dynamic
>
data
=
{
"name"
:
name
,
"nik"
:
nik
,
"mobile_phoen"
:
mobile
,
"password"
:
password
,
"confirm_password"
:
cPassword
,
};
String
bodies
=
jsonEncode
(
data
);
dynamic
jsonObject
=
await
httpRequest
(
typePost
,
apiUrl
,
"register"
,
bodies:
bodies
,
);
if
(
jsonObject
==
false
)
{
return
ApiResponse
(
error:
true
,
msg:
Strings
.
cantConnectToServer
);
}
else
{
if
(
jsonObject
[
'status'
]
==
'ok'
)
{
Map
<
String
,
dynamic
>
returnData
=
{
"register_id"
:
jsonObject
[
'data'
][
'register_id'
],
};
return
ApiResponse
(
error:
false
,
msg:
"registration success"
,
data:
returnData
,
);
}
else
{
return
ApiResponse
(
error:
true
,
msg:
jsonObject
[
'msg'
]);
}
}
}
catch
(
e
)
{
return
ApiResponse
(
error:
true
,
msg:
Strings
.
serverError
);
}
}
static
Future
<
ApiResponse
>
forgotPassword
(
String
phone
)
async
{
String
apiUrl
=
"
$baseUrl${endPoint}
forgot_password"
;
try
{
Map
<
String
,
dynamic
>
data
=
{
"mobile_phone"
:
phone
,
};
String
bodies
=
jsonEncode
(
data
);
dynamic
jsonObject
=
httpRequest
(
typePost
,
apiUrl
,
"forgotPassword"
,
bodies:
bodies
,
);
if
(
jsonObject
==
false
)
{
return
ApiResponse
(
error:
true
,
msg:
Strings
.
cantConnectToServer
);
}
else
{
if
(
jsonObject
[
'status'
]
==
'ok'
)
{
return
ApiResponse
(
error:
false
,
msg:
jsonObject
[
'msg'
],
);
}
else
{
return
ApiResponse
(
error:
true
,
msg:
jsonObject
[
'msg'
],
);
}
}
}
catch
(
e
)
{
return
ApiResponse
(
error:
false
,
msg:
Strings
.
serverError
);
}
}
static
Future
<
ApiResponse
>
resendOtpVerification
(
String
registerId
)
async
{
String
apiUrl
=
"
$baseUrl${endPoint}
resend_otp_registration"
;
try
{
Map
<
String
,
dynamic
>
data
=
{
"registration_id"
:
registerId
,
};
String
bodies
=
jsonEncode
(
data
);
dynamic
jsonObject
=
await
httpRequest
(
typePost
,
apiUrl
,
"resendOtpVerification"
,
bodies:
bodies
,
);
if
(
jsonObject
==
false
)
{
return
ApiResponse
(
error:
true
,
msg:
Strings
.
cantConnectToServer
);
}
else
{
if
(
jsonObject
[
'status'
]
==
'ok'
)
{
return
ApiResponse
(
error:
false
,
msg:
"Success"
);
}
else
{
return
ApiResponse
(
error:
true
,
msg:
jsonObject
[
'msg'
],
);
}
}
}
catch
(
e
)
{
return
ApiResponse
(
error:
true
,
msg:
Strings
.
serverError
);
}
}
static
Future
<
ApiResponse
>
resetPassword
(
String
id
,
String
password
,
String
cPassword
)
async
{
String
apiUrl
=
"
$baseUrl${endPoint}
reset_password"
;
try
{
Map
<
String
,
dynamic
>
data
=
{
"param_id"
:
id
,
"password"
:
password
,
"password_confirmation"
:
cPassword
,
};
String
bodies
=
jsonEncode
(
data
);
dynamic
jsonObject
=
await
httpRequest
(
typePost
,
apiUrl
,
"resetPassword"
,
bodies:
bodies
,
);
if
(
jsonObject
==
false
)
{
return
ApiResponse
(
error:
true
,
msg:
Strings
.
cantConnectToServer
);
}
else
{
if
(
jsonObject
[
'status'
]
==
'ok'
)
{
return
ApiResponse
(
error:
false
,
msg:
"Success"
);
}
else
{
return
ApiResponse
(
error:
true
,
msg:
jsonObject
[
'msg'
],
);
}
}
}
catch
(
e
)
{
return
ApiResponse
(
error:
true
,
msg:
Strings
.
serverError
);
}
}
}
lib/helper/argument_route/verification_otp.dart
0 → 100644
View file @
6a1a5ccf
class
VerificationArguments
{
String
id
;
String
phone
;
VerificationArguments
({
required
this
.
id
,
required
this
.
phone
,
});
}
lib/models/profile_model.dart
0 → 100644
View file @
6a1a5ccf
class
ProfileModel
{
String
fullName
;
String
mobilePhone
;
String
nik
;
ProfileModel
({
required
this
.
fullName
,
required
this
.
mobilePhone
,
required
this
.
nik
,
});
factory
ProfileModel
.
json
(
Map
<
String
,
dynamic
>
json
)
{
return
ProfileModel
(
fullName:
json
[
'full_name'
],
mobilePhone:
json
[
'mobile_phone'
],
nik:
json
[
'nik'
],
);
}
}
lib/models/reimburse_mode.dart
0 → 100644
View file @
6a1a5ccf
class
ReimburseModel
{
String
date
;
String
agencyName
;
String
agencyNik
;
int
transactionCount
;
String
transactionAmount
;
String
comissionAmount
;
String
time
;
ReimburseModel
({
required
this
.
date
,
required
this
.
agencyName
,
required
this
.
agencyNik
,
required
this
.
transactionCount
,
required
this
.
transactionAmount
,
required
this
.
comissionAmount
,
required
this
.
time
,
});
factory
ReimburseModel
.
json
(
Map
<
String
,
dynamic
>
json
)
{
return
ReimburseModel
(
date:
json
[
'date'
],
agencyName:
json
[
'agency_name'
],
agencyNik:
json
[
'agency_nik'
],
transactionCount:
json
[
'transaction_count'
],
transactionAmount:
json
[
'transaction_amount'
],
comissionAmount:
json
[
'commission_amount'
],
time:
json
[
'time'
],
);
}
}
lib/models/transaction_model.dart
0 → 100644
View file @
6a1a5ccf
class
TransactionModel
{
int
transactionCount
;
String
totalTransaction
;
List
<
ListTransactionModel
>
listTransaction
;
TransactionModel
({
required
this
.
transactionCount
,
required
this
.
totalTransaction
,
required
this
.
listTransaction
,
});
factory
TransactionModel
.
json
(
Map
<
String
,
dynamic
>
json
)
{
return
TransactionModel
(
transactionCount:
json
[
'count_transaction'
],
totalTransaction:
json
[
'total_transaction'
],
listTransaction:
json
[
'transactions'
],
);
}
}
class
ListTransactionModel
{
String
id
;
String
brandId
;
String
brandCode
;
String
branchId
;
String
branchCode
;
String
bussinesDate
;
String
total
;
ListTransactionModel
({
required
this
.
id
,
required
this
.
brandId
,
required
this
.
brandCode
,
required
this
.
branchId
,
required
this
.
branchCode
,
required
this
.
bussinesDate
,
required
this
.
total
,
});
factory
ListTransactionModel
.
json
(
Map
<
String
,
dynamic
>
json
)
{
return
ListTransactionModel
(
id:
json
[
'id'
],
brandId:
json
[
'brand_id'
],
brandCode:
json
[
'brand_code'
],
branchId:
json
[
'branch_id'
],
branchCode:
json
[
'branch_code'
],
bussinesDate:
json
[
'business_date'
],
total:
json
[
'total'
],
);
}
}
lib/page/forgot_password/forgot_password.dart
View file @
6a1a5ccf
// ignore_for_file: avoid_unnecessary_containers
// ignore_for_file: avoid_unnecessary_containers
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:tour_travel_agr/api/all_api.dart'
;
import
'package:tour_travel_agr/helper/components_widget/custom_appbar.dart'
;
import
'package:tour_travel_agr/helper/components_widget/custom_appbar.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_button.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_button.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_text_field.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_text_field.dart'
;
import
'package:tour_travel_agr/helper/modal_dialog.dart'
;
import
'package:tour_travel_agr/helper/widget_responsive.dart'
;
import
'package:tour_travel_agr/helper/widget_responsive.dart'
;
import
'package:tour_travel_agr/resource/assets.dart'
;
import
'package:tour_travel_agr/resource/assets.dart'
;
import
'package:tour_travel_agr/resource/colors.dart'
;
import
'package:tour_travel_agr/resource/colors.dart'
;
import
'package:tour_travel_agr/resource/routes.dart'
;
import
'package:tour_travel_agr/resource/size.dart'
;
import
'package:tour_travel_agr/resource/size.dart'
;
import
'package:tour_travel_agr/resource/style.dart'
;
import
'package:tour_travel_agr/resource/style.dart'
;
...
@@ -146,10 +147,17 @@ class _ForgotPasswordViewState extends State<ForgotPasswordView> {
...
@@ -146,10 +147,17 @@ class _ForgotPasswordViewState extends State<ForgotPasswordView> {
text:
"Submit"
,
text:
"Submit"
,
colorButton:
(!
buttonActive
)
?
Colors
.
grey
:
null
,
colorButton:
(!
buttonActive
)
?
Colors
.
grey
:
null
,
onTap:
()
{
onTap:
()
{
// TODO: dosomething here
if
(
buttonActive
)
{
if
(
buttonActive
)
{
Navigator
.
pushNamed
(
Api
.
forgotPassword
(
whatsappController
.
text
)
context
,
Routes
.
resetPasswordRoute
);
.
then
((
response
)
{
modalDialogGlobal
(
context:
context
,
title:
(
response
.
error
)
?
"Gagal"
:
"Berhasil"
,
contentBody:
response
.
msg
,
buttonText:
"Ok"
,
tapButton:
()
=>
Navigator
.
pop
(
context
),
);
});
}
}
},
},
)
)
...
...
lib/page/login/login.dart
View file @
6a1a5ccf
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:tour_travel_agr/api/all_api.dart'
;
import
'package:tour_travel_agr/helper/components_widget/password_input.dart'
;
import
'package:tour_travel_agr/helper/components_widget/password_input.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_button.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_button.dart'
;
import
'package:tour_travel_agr/helper/modal_dialog.dart'
;
import
'package:tour_travel_agr/helper/widget_responsive.dart'
;
import
'package:tour_travel_agr/helper/widget_responsive.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_text_field.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_text_field.dart'
;
import
'package:tour_travel_agr/resource/assets.dart'
;
import
'package:tour_travel_agr/resource/assets.dart'
;
...
@@ -157,9 +159,26 @@ class _BodyWidgetState extends State<BodyWidget> {
...
@@ -157,9 +159,26 @@ class _BodyWidgetState extends State<BodyWidget> {
:
Colors
.
grey
,
:
Colors
.
grey
,
onTap:
()
{
onTap:
()
{
if
(
buttonLoginActive
)
{
if
(
buttonLoginActive
)
{
// TODO:dosomething here
Api
.
login
(
Navigator
.
pushNamedAndRemoveUntil
(
widget
.
whatsappController
.
text
,
context
,
Routes
.
homeRoute
,
(
route
)
=>
false
);
widget
.
passwordController
.
text
,
).
then
((
apiResponse
)
{
if
(
apiResponse
.
error
)
{
modalDialogGlobal
(
context:
context
,
size:
MediaQuery
.
of
(
context
).
size
,
title:
"Gagal"
,
contentBody:
apiResponse
.
msg
,
buttonText:
'Ok'
,
tapButton:
()
{
Navigator
.
pop
(
context
);
},
);
}
else
{
Navigator
.
pushNamedAndRemoveUntil
(
context
,
Routes
.
homeRoute
,
(
route
)
=>
false
);
}
});
}
}
},
},
),
),
...
...
lib/page/otp_verification/otp_verification.dart
View file @
6a1a5ccf
// ignore_for_file: sized_box_for_whitespace, avoid_unnecessary_containers
// ignore_for_file: sized_box_for_whitespace, avoid_unnecessary_containers
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_easyloading/flutter_easyloading.dart'
;
import
'package:tour_travel_agr/api/all_api.dart'
;
import
'package:tour_travel_agr/helper/components_widget/custom_appbar.dart'
;
import
'package:tour_travel_agr/helper/components_widget/custom_appbar.dart'
;
import
'package:tour_travel_agr/helper/modal_dialog.dart'
;
import
'package:tour_travel_agr/helper/widget_responsive.dart'
;
import
'package:tour_travel_agr/helper/widget_responsive.dart'
;
import
'package:tour_travel_agr/resource/assets.dart'
;
import
'package:tour_travel_agr/resource/assets.dart'
;
import
'package:tour_travel_agr/resource/colors.dart'
;
import
'package:tour_travel_agr/resource/colors.dart'
;
import
'package:tour_travel_agr/resource/font.dart'
;
import
'package:tour_travel_agr/resource/font.dart'
;
import
'package:tour_travel_agr/resource/routes.dart'
;
import
'package:tour_travel_agr/resource/size.dart'
;
import
'package:tour_travel_agr/resource/size.dart'
;
import
'package:tour_travel_agr/resource/strings.dart'
;
import
'package:tour_travel_agr/resource/style.dart'
;
import
'package:tour_travel_agr/resource/style.dart'
;
class
OtpVerificationView
extends
StatefulWidget
{
class
OtpVerificationView
extends
StatefulWidget
{
const
OtpVerificationView
({
super
.
key
});
const
OtpVerificationView
({
super
.
key
,
required
this
.
id
,
required
this
.
phone
,
});
final
String
id
;
final
String
phone
;
@override
@override
State
<
OtpVerificationView
>
createState
()
=>
_OtpVerificationViewState
();
State
<
OtpVerificationView
>
createState
()
=>
_OtpVerificationViewState
();
...
@@ -95,7 +107,7 @@ class _OtpVerificationViewState extends State<OtpVerificationView> {
...
@@ -95,7 +107,7 @@ class _OtpVerificationViewState extends State<OtpVerificationView> {
top:
AppMargin
.
m4
,
top:
AppMargin
.
m4
,
),
),
child:
Text
(
child:
Text
(
"An 4 digit code has been sent to
+91 9995380399
"
,
"An 4 digit code has been sent to
${widget.phone}
"
,
style:
getMediumStyle
(
style:
getMediumStyle
(
color:
ColorManager
.
grey
,
color:
ColorManager
.
grey
,
),
),
...
@@ -159,67 +171,116 @@ class _OtpVerificationViewState extends State<OtpVerificationView> {
...
@@ -159,67 +171,116 @@ class _OtpVerificationViewState extends State<OtpVerificationView> {
fillColor:
Colors
.
grey
.
withOpacity
(
0.8
),
fillColor:
Colors
.
grey
.
withOpacity
(
0.8
),
),
),
controller:
controller
,
controller:
controller
,
onChanged:
(
value
)
{
onChanged:
(
value
)
async
{
setState
(()
{
finalText
=
finalText
=
"
${otp1Controller.text}${otp2Controller.text}${otp3Controller.text}${otp4Controller.text}
"
;
"
${otp1Controller.text}${otp2Controller.text}${otp3Controller.text}${otp4Controller.text}
"
;
if
(
finalText
.
length
>=
4
)
{
if
(
finalText
.
length
>=
4
)
{
await
EasyLoading
.
show
(
setState
(()
{
status:
Strings
.
pleaseWait
,
disabledInput
=
true
;
maskType:
EasyLoadingMaskType
.
none
,
});
);
FocusScope
.
of
(
context
).
unfocus
();
setState
(()
{
// TODO: KALAU DAH LENGKAP NGAPAIN
disabledInput
=
true
;
});
}
else
{
// ignore: use_build_context_synchronously
if
(
controller
.
text
.
isNotEmpty
)
{
FocusScope
.
of
(
context
).
unfocus
();
FocusScope
.
of
(
context
).
nextFocus
();
Api
.
resendOtpVerification
(
widget
.
id
).
then
((
apiResponse
)
{
EasyLoading
.
dismiss
();
if
(
apiResponse
.
error
)
{
setState
(()
{
disabledInput
=
false
;
modalDialogGlobal
(
context:
context
,
title:
"Gagal"
,
contentBody:
apiResponse
.
msg
,
buttonText:
'Ok'
,
tapButton:
()
=>
Navigator
.
pop
(
context
),
);
});
return
;
}
else
{
modalDialogGlobal
(
context:
context
,
title:
"Success"
,
contentBody:
"Registration success"
,
buttonText:
'Login'
,
tapButton:
()
{
Navigator
.
pushNamedAndRemoveUntil
(
context
,
Routes
.
loginRoute
,
(
route
)
=>
false
,
);
},
);
}
}
});
}
else
{
setState
(()
{});
if
(
controller
.
text
.
isNotEmpty
)
{
FocusScope
.
of
(
context
).
nextFocus
();
}
}
}
);
}
},
},
),
),
);
);
}
}
}
}
class
CountDownTimeOtp
extends
State
less
Widget
{
class
CountDownTimeOtp
extends
State
ful
Widget
{
const
CountDownTimeOtp
({
const
CountDownTimeOtp
({
Key
?
key
,
Key
?
key
,
})
:
super
(
key:
key
);
})
:
super
(
key:
key
);
@override
State
<
CountDownTimeOtp
>
createState
()
=>
_CountDownTimeOtpState
();
}
class
_CountDownTimeOtpState
extends
State
<
CountDownTimeOtp
>
{
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Container
(
return
Container
(
margin:
EdgeInsets
.
only
(
margin:
EdgeInsets
.
only
(
top:
AppMargin
.
m6
,
top:
AppMargin
.
m6
,
),
),
child:
Row
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
Text
(
Row
(
"00 :"
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
style:
getRegularStyle
(
children:
[
color:
ColorManager
.
primary
,
Text
(
fontSize:
20
,
"00 :"
,
fontFamily:
FontConstants
.
mulish
,
style:
getRegularStyle
(
),
color:
ColorManager
.
primary
,
),
fontSize:
20
,
Text
(
fontFamily:
FontConstants
.
mulish
,
" 02 :"
,
),
style:
getRegularStyle
(
),
color:
ColorManager
.
primary
,
Text
(
fontSize:
20
,
" 02 :"
,
fontFamily:
FontConstants
.
mulish
,
style:
getRegularStyle
(
),
color:
ColorManager
.
primary
,
fontSize:
20
,
fontFamily:
FontConstants
.
mulish
,
),
),
Text
(
" 59"
,
style:
getRegularStyle
(
color:
ColorManager
.
primary
,
fontSize:
20
,
fontFamily:
FontConstants
.
mulish
,
),
)
],
),
),
Text
(
// Text(
" 59"
,
// "Resend otp",
style:
getRegularStyle
(
// style: getRegularStyle(
color:
ColorManager
.
primary
,
// color: ColorManager.primary,
fontSize:
20
,
// fontSize: FontSize.s16,
fontFamily:
FontConstants
.
mulish
,
// ),
),
// ),
)
],
],
),
),
);
);
...
...
lib/page/profile/edit_profile/edit_profile.dart
View file @
6a1a5ccf
//
import 'package:file_picker/file_picker.dart';
import
'package:file_picker/file_picker.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:tour_travel_agr/helper/components_widget/custom_appbar.dart'
;
import
'package:tour_travel_agr/helper/components_widget/custom_appbar.dart'
;
...
@@ -53,23 +53,23 @@ class _EditProfileViewState extends State<EditProfileView> {
...
@@ -53,23 +53,23 @@ class _EditProfileViewState extends State<EditProfileView> {
GestureDetector
(
GestureDetector
(
onTap:
()
async
{
onTap:
()
async
{
// TODO: aktifin kalau udah dinaikin versiondartnya
// TODO: aktifin kalau udah dinaikin versiondartnya
//
FilePickerResult? result =
FilePickerResult
?
result
=
//
await FilePicker.platform.pickFiles();
await
FilePicker
.
platform
.
pickFiles
();
//
if (result != null) {
if
(
result
!=
null
)
{
//
PlatformFile file = result.files.first;
PlatformFile
file
=
result
.
files
.
first
;
//
// print(file.name);
// print(file.name);
//
// print(file.bytes);
// print(file.bytes);
//
// print(file.size);
// print(file.size);
//
// print(file.extension);
// print(file.extension);
//
// print(file);
// print(file);
//
setState(() {
setState
(()
{
//
byteImage = file.bytes;
byteImage
=
file
.
bytes
;
//
});
});
//
// print(file.path);
// print(file.path);
//
} else {
}
else
{
//
// User canceled the picker
// User canceled the picker
//
}
}
},
},
child:
Container
(
child:
Container
(
margin:
EdgeInsets
.
only
(
margin:
EdgeInsets
.
only
(
...
...
lib/page/register/register.dart
View file @
6a1a5ccf
// ignore_for_file: sized_box_for_whitespace
// ignore_for_file: sized_box_for_whitespace
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:tour_travel_agr/api/all_api.dart'
;
import
'package:tour_travel_agr/helper/argument_route/verification_otp.dart'
;
import
'package:tour_travel_agr/helper/components_widget/custom_appbar.dart'
;
import
'package:tour_travel_agr/helper/components_widget/custom_appbar.dart'
;
import
'package:tour_travel_agr/helper/components_widget/password_input.dart'
;
import
'package:tour_travel_agr/helper/components_widget/password_input.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_button.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_button.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_text_field.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_text_field.dart'
;
import
'package:tour_travel_agr/helper/modal_dialog.dart'
;
import
'package:tour_travel_agr/helper/widget_responsive.dart'
;
import
'package:tour_travel_agr/helper/widget_responsive.dart'
;
import
'package:tour_travel_agr/resource/colors.dart'
;
import
'package:tour_travel_agr/resource/colors.dart'
;
import
'package:tour_travel_agr/resource/routes.dart'
;
import
'package:tour_travel_agr/resource/routes.dart'
;
...
@@ -151,9 +154,51 @@ class _RegisterViewState extends State<RegisterView> {
...
@@ -151,9 +154,51 @@ class _RegisterViewState extends State<RegisterView> {
:
Colors
.
grey
,
:
Colors
.
grey
,
onTap:
()
{
onTap:
()
{
if
(
buttonRregisterActive
)
{
if
(
buttonRregisterActive
)
{
// TODO:dosomething here
// if (passwordController.text !=
// confirmPasswordController.text) {
// modalDialogGlobal(
// context: context,
// size: MediaQuery.of(context).size,
// title: "Gagal",
// contentBody: "Password tidak sama",
// buttonText: "Ok",
// tapButton: () => Navigator.pop(context),
// );
// }
// Api.register(
// nameController.text,
// nikController.text,
// noHpController.text,
// passwordController.text,
// confirmPasswordController.text,
// ).then((apiResponse) {
// if (apiResponse.error) {
// modalDialogGlobal(
// context: context,
// size: MediaQuery.of(context).size,
// title: "Gagal",
// contentBody: apiResponse.msg,
// buttonText: "Ok",
// tapButton: () => Navigator.pop(context),
// );
// return;
// }
// Navigator.pushNamed(
// context,
// Routes.verificationRoute,
// arguments: apiResponse.data['register_id'],
// );
// });
Navigator
.
pushNamed
(
Navigator
.
pushNamed
(
context
,
Routes
.
verificationRoute
);
context
,
Routes
.
verificationRoute
,
arguments:
VerificationArguments
(
id:
"ASAS"
,
phone:
noHpController
.
text
,
),
);
}
}
},
},
),
),
...
...
lib/page/reset_password/reset_password.dart
View file @
6a1a5ccf
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:tour_travel_agr/api/all_api.dart'
;
import
'package:tour_travel_agr/helper/components_widget/custom_appbar.dart'
;
import
'package:tour_travel_agr/helper/components_widget/custom_appbar.dart'
;
import
'package:tour_travel_agr/helper/components_widget/password_input.dart'
;
import
'package:tour_travel_agr/helper/components_widget/password_input.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_button.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_button.dart'
;
import
'package:tour_travel_agr/helper/modal_dialog.dart'
;
import
'package:tour_travel_agr/helper/widget_responsive.dart'
;
import
'package:tour_travel_agr/helper/widget_responsive.dart'
;
import
'package:tour_travel_agr/resource/assets.dart'
;
import
'package:tour_travel_agr/resource/assets.dart'
;
import
'package:tour_travel_agr/resource/colors.dart'
;
import
'package:tour_travel_agr/resource/colors.dart'
;
import
'package:tour_travel_agr/resource/routes.dart'
;
import
'package:tour_travel_agr/resource/size.dart'
;
import
'package:tour_travel_agr/resource/size.dart'
;
import
'package:tour_travel_agr/resource/style.dart'
;
import
'package:tour_travel_agr/resource/style.dart'
;
...
@@ -132,7 +135,30 @@ class _ResetPasswordViewState extends State<ResetPasswordView> {
...
@@ -132,7 +135,30 @@ class _ResetPasswordViewState extends State<ResetPasswordView> {
colorButton:
(!
buttonActive
)
?
Colors
.
grey
:
null
,
colorButton:
(!
buttonActive
)
?
Colors
.
grey
:
null
,
onTap:
()
{
onTap:
()
{
if
(
buttonActive
)
{
if
(
buttonActive
)
{
// TODO: do something here
Api
.
resetPassword
(
widget
.
idPath
,
passwordController
.
text
,
newPasswordController
.
text
,
).
then
(
(
apiResponse
)
{
if
(
apiResponse
.
error
)
{
modalDialogGlobal
(
context:
context
,
title:
"Gagal"
,
contentBody:
apiResponse
.
msg
,
buttonText:
'Ok'
,
tapButton:
()
=>
Navigator
.
pop
(
context
),
);
return
;
}
Navigator
.
pushNamedAndRemoveUntil
(
context
,
Routes
.
resetPasswordSuccess
,
(
route
)
=>
false
,
);
},
);
}
}
},
},
)
)
...
...
lib/page/reset_password/reset_success.dart
0 → 100644
View file @
6a1a5ccf
import
'package:flutter/material.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_button.dart'
;
import
'package:tour_travel_agr/helper/widget_responsive.dart'
;
import
'package:tour_travel_agr/resource/assets.dart'
;
import
'package:tour_travel_agr/resource/colors.dart'
;
import
'package:tour_travel_agr/resource/font.dart'
;
import
'package:tour_travel_agr/resource/routes.dart'
;
import
'package:tour_travel_agr/resource/size.dart'
;
import
'package:tour_travel_agr/resource/style.dart'
;
class
ResetPasswrodSuccessView
extends
StatelessWidget
{
const
ResetPasswrodSuccessView
({
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
backgroundColor:
ColorManager
.
backgroundColor
,
body:
ScreenResponsive
(
widget:
const
BodyWidget
(),
widthScreen:
MediaQuery
.
of
(
context
).
size
.
width
,
),
);
}
}
class
BodyWidget
extends
StatelessWidget
{
const
BodyWidget
({
super
.
key
,
});
@override
Widget
build
(
BuildContext
context
)
{
return
Stack
(
children:
[
Positioned
(
top:
0
,
left:
0
,
child:
Image
(
height:
200
,
image:
AssetImage
(
Assets
.
elipse
,
),
),
),
Container
(
padding:
EdgeInsets
.
only
(
top:
AppPadding
.
safeAreaTop
(
context
)
+
40
,
),
child:
Column
(
children:
[
Stack
(
children:
[
Positioned
(
top:
0
,
right:
0
,
child:
Image
(
width:
200
,
image:
AssetImage
(
Assets
.
elipseRight
,
),
),
),
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
AppPadding
.
p20
,
),
child:
Image
(
image:
AssetImage
(
Assets
.
resetSuccess
,
),
width:
double
.
infinity
,
height:
342
,
),
),
],
),
SizedBox
(
height:
AppMargin
.
m12
,
),
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
AppPadding
.
p20
,
),
child:
Text
(
'''Reset Password
Success'''
,
style:
getSemiBoldStyle
(
color:
Colors
.
black
,
fontSize:
32
,
fontFamily:
FontConstants
.
inter
,
),
textAlign:
TextAlign
.
center
,
),
),
const
SizedBox
(
height:
70
,
),
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
AppPadding
.
p20
,
),
child:
CustomButton
(
text:
"Back to Login"
,
onTap:
()
{
Navigator
.
pushNamedAndRemoveUntil
(
context
,
Routes
.
loginRoute
,
(
route
)
=>
false
,
);
},
),
)
],
),
),
],
);
}
}
lib/resource/assets.dart
View file @
6a1a5ccf
...
@@ -6,12 +6,14 @@ class Assets {
...
@@ -6,12 +6,14 @@ class Assets {
static
String
logoWhite
=
"
${rootImage}
logo_white.png"
;
static
String
logoWhite
=
"
${rootImage}
logo_white.png"
;
static
String
logoGreen
=
"
${rootImage}
logo_green.png"
;
static
String
logoGreen
=
"
${rootImage}
logo_green.png"
;
static
String
elipse
=
"
${rootImage}
elipse.png"
;
static
String
elipse
=
"
${rootImage}
elipse.png"
;
static
String
elipseRight
=
"
${rootImage}
elipse_right.png"
;
static
String
verificationHeadImage
=
"
${rootImage}
otp_verification.png"
;
static
String
verificationHeadImage
=
"
${rootImage}
otp_verification.png"
;
static
String
forgotPassword
=
"
${rootImage}
forgot_password.png"
;
static
String
forgotPassword
=
"
${rootImage}
forgot_password.png"
;
static
String
resetPassword
=
"
${rootImage}
reset_password.png"
;
static
String
resetPassword
=
"
${rootImage}
reset_password.png"
;
static
String
homeBanner
=
"
${rootImage}
home_banner.png"
;
static
String
homeBanner
=
"
${rootImage}
home_banner.png"
;
static
String
profileSample
=
"
${rootImage}
profile.jpg"
;
static
String
profileSample
=
"
${rootImage}
profile.jpg"
;
static
String
editProfileSample
=
"
${rootImage}
edit_profile.png"
;
static
String
editProfileSample
=
"
${rootImage}
edit_profile.png"
;
static
String
resetSuccess
=
"
${rootImage}
reset_success.png"
;
// icons
// icons
static
String
reimburseIcon
=
"
${rootIcon}
reimburse.png"
;
static
String
reimburseIcon
=
"
${rootIcon}
reimburse.png"
;
...
...
lib/resource/font.dart
View file @
6a1a5ccf
...
@@ -25,4 +25,5 @@ class FontSize {
...
@@ -25,4 +25,5 @@ class FontSize {
static
const
double
s18
=
18.0
;
static
const
double
s18
=
18.0
;
static
const
double
s20
=
20.0
;
static
const
double
s20
=
20.0
;
static
const
double
s22
=
22.0
;
static
const
double
s22
=
22.0
;
static
const
double
s24
=
24.0
;
}
}
lib/resource/routes.dart
View file @
6a1a5ccf
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:tour_travel_agr/helper/argument_route/verification_otp.dart'
;
import
'package:tour_travel_agr/main.dart'
;
import
'package:tour_travel_agr/main.dart'
;
import
'package:tour_travel_agr/page/history/history.dart'
;
import
'package:tour_travel_agr/page/history/history.dart'
;
import
'package:tour_travel_agr/page/profile/change_password/change_password.dart'
;
import
'package:tour_travel_agr/page/profile/change_password/change_password.dart'
;
...
@@ -12,6 +13,7 @@ import 'package:tour_travel_agr/page/profile/profile.dart';
...
@@ -12,6 +13,7 @@ import 'package:tour_travel_agr/page/profile/profile.dart';
import
'package:tour_travel_agr/page/register/register.dart'
;
import
'package:tour_travel_agr/page/register/register.dart'
;
import
'package:tour_travel_agr/page/reimbursement/reimbursement.dart'
;
import
'package:tour_travel_agr/page/reimbursement/reimbursement.dart'
;
import
'package:tour_travel_agr/page/reset_password/reset_password.dart'
;
import
'package:tour_travel_agr/page/reset_password/reset_password.dart'
;
import
'package:tour_travel_agr/page/reset_password/reset_success.dart'
;
import
'package:tour_travel_agr/page/splash/splash.dart'
;
import
'package:tour_travel_agr/page/splash/splash.dart'
;
class
Routes
{
class
Routes
{
...
@@ -27,6 +29,7 @@ class Routes {
...
@@ -27,6 +29,7 @@ class Routes {
static
const
String
editProfileRoute
=
"/edit-profile"
;
static
const
String
editProfileRoute
=
"/edit-profile"
;
static
const
String
reimburseRoute
=
"/reimbursement"
;
static
const
String
reimburseRoute
=
"/reimbursement"
;
static
const
String
historyRoute
=
"/history"
;
static
const
String
historyRoute
=
"/history"
;
static
const
String
resetPasswordSuccess
=
"/reset-success"
;
}
}
class
RouteGenerator
{
class
RouteGenerator
{
...
@@ -40,8 +43,16 @@ class RouteGenerator {
...
@@ -40,8 +43,16 @@ class RouteGenerator {
return
pageRouteCustom
(
const
RegisterView
(),
return
pageRouteCustom
(
const
RegisterView
(),
nameRoute:
Routes
.
registerRoute
);
nameRoute:
Routes
.
registerRoute
);
}
else
if
(
routeSettings
.
name
==
Routes
.
verificationRoute
)
{
}
else
if
(
routeSettings
.
name
==
Routes
.
verificationRoute
)
{
return
pageRouteCustom
(
const
OtpVerificationView
(),
VerificationArguments
args
=
nameRoute:
Routes
.
verificationRoute
);
routeSettings
.
arguments
as
VerificationArguments
;
return
pageRouteCustom
(
OtpVerificationView
(
id:
args
.
id
,
phone:
args
.
phone
,
),
nameRoute:
Routes
.
verificationRoute
,
routeSettings:
routeSettings
,
);
}
else
if
(
routeSettings
.
name
==
Routes
.
forgotPasswordRoute
)
{
}
else
if
(
routeSettings
.
name
==
Routes
.
forgotPasswordRoute
)
{
return
pageRouteCustom
(
const
ForgotPasswordView
(),
return
pageRouteCustom
(
const
ForgotPasswordView
(),
nameRoute:
Routes
.
forgotPasswordRoute
);
nameRoute:
Routes
.
forgotPasswordRoute
);
...
@@ -74,47 +85,12 @@ class RouteGenerator {
...
@@ -74,47 +85,12 @@ class RouteGenerator {
}
else
if
(
routeSettings
.
name
==
Routes
.
historyRoute
)
{
}
else
if
(
routeSettings
.
name
==
Routes
.
historyRoute
)
{
return
pageRouteCustom
(
const
HistoryView
(),
return
pageRouteCustom
(
const
HistoryView
(),
nameRoute:
Routes
.
historyRoute
);
nameRoute:
Routes
.
historyRoute
);
}
else
if
(
routeSettings
.
name
==
Routes
.
resetPasswordSuccess
)
{
return
pageRouteCustom
(
const
ResetPasswrodSuccessView
(),
nameRoute:
Routes
.
resetPasswordSuccess
);
}
else
{
}
else
{
return
unDefinedRoute
();
return
unDefinedRoute
();
}
}
// switch (routeSettings.name) {
// case Routes.splashRoute:
// return pageRouteCustom(const SplashView(),
// nameRoute: Routes.splashRoute);
// case Routes.loginRoute:
// return pageRouteCustom(LoginView(), nameRoute: Routes.loginRoute);
// case Routes.registerRoute:
// return pageRouteCustom(const RegisterView(),
// nameRoute: Routes.registerRoute);
// case Routes.verificationRoute:
// return pageRouteCustom(const OtpVerificationView(),
// nameRoute: Routes.verificationRoute);
// case Routes.forgotPasswordRoute:
// return pageRouteCustom(const ForgotPasswordView(),
// nameRoute: Routes.forgotPasswordRoute);
// case Routes.resetPasswordRoute:
// return pageRouteCustom(const ResetPasswordView(),
// nameRoute: Routes.resetPasswordRoute);
// case Routes.homeRoute:
// return pageRouteCustom(const HomeView(), nameRoute: Routes.homeRoute);
// case Routes.profileRoute:
// return pageRouteCustom(const ProfileView(),
// nameRoute: Routes.profileRoute);
// case Routes.changePasswordRoute:
// return pageRouteCustom(const ChangePasswordView(),
// nameRoute: Routes.changePasswordRoute);
// case Routes.editProfileRoute:
// return pageRouteCustom(const EditProfileView(),
// nameRoute: Routes.editProfileRoute);
// case Routes.reimburseRoute:
// return pageRouteCustom(const ReimbursementView(),
// nameRoute: Routes.reimburseRoute);
// case Routes.historyRoute:
// return pageRouteCustom(const HistoryView(),
// nameRoute: Routes.historyRoute);
// default:
// return unDefinedRoute();
// }
}
}
static
void
setTitle
(
String
title
)
{
static
void
setTitle
(
String
title
)
{
...
@@ -123,9 +99,26 @@ class RouteGenerator {
...
@@ -123,9 +99,26 @@ class RouteGenerator {
);
);
}
}
static
PageRouteBuilder
<
dynamic
>
pageRouteCustom
(
Widget
target
,
static
PageRouteBuilder
<
dynamic
>
pageRouteCustom
(
{
required
String
nameRoute
,
String
title
=
""
})
{
Widget
target
,
{
// setTitle(title);
required
String
nameRoute
,
String
title
=
""
,
RouteSettings
?
routeSettings
,
})
{
if
(
nameRoute
==
Routes
.
verificationRoute
)
{
VerificationArguments
args
=
routeSettings
!.
arguments
as
VerificationArguments
;
return
PageRouteBuilder
(
pageBuilder:
(
context
,
a
,
b
)
=>
OtpVerificationView
(
id:
args
.
id
,
phone:
args
.
phone
,
),
transitionDuration:
Duration
.
zero
,
reverseTransitionDuration:
Duration
.
zero
,
settings:
RouteSettings
(
name:
nameRoute
.
replaceFirst
(
"/"
,
""
)),
);
}
return
PageRouteBuilder
(
return
PageRouteBuilder
(
pageBuilder:
(
context
,
a
,
b
)
=>
target
,
pageBuilder:
(
context
,
a
,
b
)
=>
target
,
transitionDuration:
Duration
.
zero
,
transitionDuration:
Duration
.
zero
,
...
...
lib/resource/strings.dart
0 → 100644
View file @
6a1a5ccf
class
Strings
{
static
String
cameraNotActive
=
"Silakan aktifkan permission kamera pada pengaturan browser anda"
;
static
String
locationNotActive
=
"Silakan aktifkan permission lokasi pada pengaturan browser anda"
;
static
String
noOutletArround
(
String
distance
)
{
return
"Tidak ada outlet yang ditemukan dalam radius
$distance
Km"
;
}
static
String
errorGetShiftList
=
"Tidak dapat terhubung ke server, shift tidak ditemukan"
;
static
String
cantConnectToServer
=
"Can't connect to server, refresh page"
;
static
String
serverError
=
"Something wrong with our server, refresh page"
;
static
String
succesGetData
=
"Success get data"
;
static
String
pleaseWait
=
"Please wait..."
;
}
macos/Flutter/GeneratedPluginRegistrant.swift
View file @
6a1a5ccf
...
@@ -5,8 +5,10 @@
...
@@ -5,8 +5,10 @@
import
FlutterMacOS
import
FlutterMacOS
import
Foundation
import
Foundation
import
package_info_plus
import
shared_preferences_foundation
import
shared_preferences_foundation
func
RegisterGeneratedPlugins
(
registry
:
FlutterPluginRegistry
)
{
func
RegisterGeneratedPlugins
(
registry
:
FlutterPluginRegistry
)
{
FLTPackageInfoPlusPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"FLTPackageInfoPlusPlugin"
))
SharedPreferencesPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"SharedPreferencesPlugin"
))
SharedPreferencesPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"SharedPreferencesPlugin"
))
}
}
web/agr_icon.png
0 → 100644
View file @
6a1a5ccf
4.33 KB
web/index.html
View file @
6a1a5ccf
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<link
rel=
"apple-touch-icon"
href=
"icons/Icon-192.png"
/>
<link
rel=
"apple-touch-icon"
href=
"icons/Icon-192.png"
/>
<!-- Favicon -->
<!-- Favicon -->
<link
rel=
"icon"
type=
"image/png"
href=
"
fav
icon.png"
/>
<link
rel=
"icon"
type=
"image/png"
href=
"
agr_
icon.png"
/>
<title>
Tour
&
Travel Agency
</title>
<title>
Tour
&
Travel Agency
</title>
<link
rel=
"manifest"
href=
"manifest.json"
/>
<link
rel=
"manifest"
href=
"manifest.json"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment