Commit 3107e9e1 authored by Dio Maulana's avatar Dio Maulana

fixe update

parent 203de10f
...@@ -44,7 +44,7 @@ android { ...@@ -44,7 +44,7 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.tour_agency" applicationId "com.example.tour_agent"
// You can update the following values to match your application needs. // You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 19 minSdkVersion 19
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.tour_agency"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.tour_agent">
<!-- The INTERNET permission is required for development. Specifically, <!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.tour_agency"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.tour_agent">
<application android:label="tour_travel_agr" android:name="${applicationName}" android:icon="@mipmap/ic_launcher"> <application android:label="tour_travel_agr" android:name="${applicationName}" android:icon="@mipmap/ic_launcher">
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> <activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as <!-- Specifies an Android theme to apply to this Activity as soon as
......
package com.example.tour_agency package com.example.tour_agent
import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.android.FlutterActivity
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.tour_agency"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.tour_agent">
<!-- The INTERNET permission is required for development. Specifically, <!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
......
...@@ -365,6 +365,7 @@ class Api { ...@@ -365,6 +365,7 @@ class Api {
dateLocal(DateTime.now().toLocal().toString()))) dateLocal(DateTime.now().toLocal().toString())))
: getOnlyDate(toInternationFormat(dateTo)), : getOnlyDate(toInternationFormat(dateTo)),
"brand": brandCode, "brand": brandCode,
"brand_code": brandCode,
}; };
String bodies = jsonEncode(data); String bodies = jsonEncode(data);
dynamic jsonObject = await httpRequest( dynamic jsonObject = await httpRequest(
...@@ -446,16 +447,15 @@ class Api { ...@@ -446,16 +447,15 @@ class Api {
} }
} }
static Future<ApiResponse> changeProfile( static Future<ApiResponse> changeProfile(String name, String? photo) async {
String name, String nik, String phone, String? photo) async {
String apiUrl = "$baseUrl${endPoint}profile/edit"; String apiUrl = "$baseUrl${endPoint}profile/edit";
try { try {
Map<String, dynamic> data = { Map<String, dynamic> data = {
"session_id": getSessionId(), "session_id": getSessionId(),
"brand_code": brandCode, "brand_code": brandCode,
"name": name, "name": name,
"nik": nik, "nik": "",
"mobile_phone": phone, "mobile_phone": "",
"photo_base64": photo, "photo_base64": photo,
}; };
String bodies = jsonEncode(data); String bodies = jsonEncode(data);
......
...@@ -8,7 +8,7 @@ import 'package:url_strategy/url_strategy.dart'; ...@@ -8,7 +8,7 @@ import 'package:url_strategy/url_strategy.dart';
late SharedPreferences prefs; late SharedPreferences prefs;
bool debug = true; bool debug = true;
String titleApp = 'Tour & Travel Agency'; String titleApp = 'Tour & Travel Agent';
String brandCode = 'AGR'; String brandCode = 'AGR';
String baseUrl = "https://neo-agr.ravku.com/"; String baseUrl = "https://neo-agr.ravku.com/";
String endPoint = "agency/api/"; String endPoint = "agency/api/";
......
class ReimburseModel { class ReimburseModel {
String date; String date;
String agencyName; String agentName;
String agencyNik; String agentNik;
int transactionCount; int transactionCount;
String transactionAmount; String transactionAmount;
String comissionAmount; String comissionAmount;
...@@ -9,8 +9,8 @@ class ReimburseModel { ...@@ -9,8 +9,8 @@ class ReimburseModel {
ReimburseModel({ ReimburseModel({
required this.date, required this.date,
required this.agencyName, required this.agentName,
required this.agencyNik, required this.agentNik,
required this.transactionCount, required this.transactionCount,
required this.transactionAmount, required this.transactionAmount,
required this.comissionAmount, required this.comissionAmount,
...@@ -20,8 +20,8 @@ class ReimburseModel { ...@@ -20,8 +20,8 @@ class ReimburseModel {
factory ReimburseModel.json(Map<String, dynamic> json) { factory ReimburseModel.json(Map<String, dynamic> json) {
return ReimburseModel( return ReimburseModel(
date: json['date'], date: json['date'],
agencyName: json['agency_name'], agentName: json['agent_name'],
agencyNik: json['agency_nik'], agentNik: json['agent_nik'],
transactionCount: json['transaction_count'], transactionCount: json['transaction_count'],
transactionAmount: json['transaction_amount'], transactionAmount: json['transaction_amount'],
comissionAmount: json['commission_amount'], comissionAmount: json['commission_amount'],
......
...@@ -236,8 +236,7 @@ class _BodyWidgetState extends State<BodyWidget> { ...@@ -236,8 +236,7 @@ class _BodyWidgetState extends State<BodyWidget> {
iconColor: ColorManager.softGreen, iconColor: ColorManager.softGreen,
countText: (transactions == null) countText: (transactions == null)
? null ? null
: parsingAmountBackend( : "Rp ${parsingAmountBackend(transactions!.totalTransaction)}",
"Rp ${transactions?.totalTransaction}"),
countTextColor: ColorManager.green, countTextColor: ColorManager.green,
), ),
], ],
...@@ -286,7 +285,7 @@ class _BodyWidgetState extends State<BodyWidget> { ...@@ -286,7 +285,7 @@ class _BodyWidgetState extends State<BodyWidget> {
title: title:
transactions!.listTransaction[index].brandCode, transactions!.listTransaction[index].brandCode,
subtitle: subtitle:
"Rp ${transactions!.listTransaction[index].total}", "Rp ${parsingAmountBackend(transactions!.listTransaction[index].total)}",
); );
}, },
), ),
...@@ -369,14 +368,16 @@ class WidgetHead extends StatelessWidget { ...@@ -369,14 +368,16 @@ class WidgetHead extends StatelessWidget {
), ),
Row( Row(
children: [ children: [
const Spacer(),
(countText != null) (countText != null)
? Text( ? Expanded(
countText!, child: Text(
style: getSemiBoldStyle( countText!,
color: countTextColor, style: getSemiBoldStyle(
fontSize: 16, color: countTextColor,
fontFamily: FontConstants.openSans, fontSize: 16,
fontFamily: FontConstants.openSans,
),
textAlign: TextAlign.end,
), ),
) )
: Shimmer.fromColors( : Shimmer.fromColors(
......
...@@ -240,7 +240,7 @@ class _BodyWIdgetState extends State<BodyWIdget> { ...@@ -240,7 +240,7 @@ class _BodyWIdgetState extends State<BodyWIdget> {
child: CardSectionHome( child: CardSectionHome(
title: "Profile", title: "Profile",
subtitle: subtitle:
"List Report Harian, mingguan dan Bulanan", "List Report Harian, Mingguan dan Bulanan",
logo: Assets.profileIcon, logo: Assets.profileIcon,
), ),
), ),
......
...@@ -146,6 +146,7 @@ class _EditProfileViewState extends State<EditProfileView> { ...@@ -146,6 +146,7 @@ class _EditProfileViewState extends State<EditProfileView> {
labelText: "NIK", labelText: "NIK",
labelColor: ColorManager.primary, labelColor: ColorManager.primary,
borderSideActive: true, borderSideActive: true,
enabled: false,
hintText: "Nomor Induk Kependudukan", hintText: "Nomor Induk Kependudukan",
marginTop: 12, marginTop: 12,
), ),
...@@ -154,6 +155,7 @@ class _EditProfileViewState extends State<EditProfileView> { ...@@ -154,6 +155,7 @@ class _EditProfileViewState extends State<EditProfileView> {
labelText: "Nomor Handphone", labelText: "Nomor Handphone",
labelColor: ColorManager.primary, labelColor: ColorManager.primary,
borderSideActive: true, borderSideActive: true,
enabled: false,
hintText: "628....", hintText: "628....",
marginTop: 12, marginTop: 12,
inputType: TextInputType.number, inputType: TextInputType.number,
...@@ -169,8 +171,6 @@ class _EditProfileViewState extends State<EditProfileView> { ...@@ -169,8 +171,6 @@ class _EditProfileViewState extends State<EditProfileView> {
); );
Api.changeProfile( Api.changeProfile(
nameController.text, nameController.text,
nikController.text,
hpController.text,
base64Image, base64Image,
).then((apiResponse) { ).then((apiResponse) {
EasyLoading.dismiss(); EasyLoading.dismiss();
......
...@@ -215,20 +215,35 @@ class _BodyWidgetState extends State<BodyWidget> { ...@@ -215,20 +215,35 @@ class _BodyWidgetState extends State<BodyWidget> {
? Container( ? Container(
width: 120, width: 120,
height: 120, height: 120,
padding: (profile!.avatarUrl == "")
? const EdgeInsets.all(20)
: null,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
100, 100,
), ),
image: (profile!.avatarUrl == "") color: (profile!.avatarUrl == "")
? DecorationImage( ? const Color(0xffD9D9D9)
fit: BoxFit.fill, : null,
image: AssetImage(Assets.profileSample), ),
) child: (profile!.avatarUrl == "")
: DecorationImage( ? ClipRRect(
borderRadius: BorderRadius.circular(100),
child: Image(
width: 40,
height: 40,
image: AssetImage(
Assets.profileSample,
),
),
)
: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: Image.network(
profile!.avatarUrl,
fit: BoxFit.fill, fit: BoxFit.fill,
image: NetworkImage(profile!.avatarUrl),
), ),
), ),
) )
: Shimmer.fromColors( : Shimmer.fromColors(
baseColor: ColorManager.baseColorShimmer, baseColor: ColorManager.baseColorShimmer,
......
...@@ -170,6 +170,17 @@ class _RegisterViewState extends State<RegisterView> { ...@@ -170,6 +170,17 @@ class _RegisterViewState extends State<RegisterView> {
); );
return; return;
} }
if (nikController.text.length != 16) {
modalDialogGlobal(
context: context,
size: MediaQuery.of(context).size,
title: "Informasi",
contentBody: "Silakan masukkan NIK yang valid",
buttonText: "Ok",
tapButton: () => Navigator.pop(context),
);
return;
}
if (passwordController.text != if (passwordController.text !=
confirmPasswordController.text) { confirmPasswordController.text) {
// ignore: use_build_context_synchronously // ignore: use_build_context_synchronously
......
...@@ -11,7 +11,6 @@ class Assets { ...@@ -11,7 +11,6 @@ class Assets {
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 editProfileSample = "${rootImage}edit_profile.png"; static String editProfileSample = "${rootImage}edit_profile.png";
static String resetSuccess = "${rootImage}reset_success.png"; static String resetSuccess = "${rootImage}reset_success.png";
...@@ -27,6 +26,7 @@ class Assets { ...@@ -27,6 +26,7 @@ class Assets {
static String calenderIcon = "${rootIcon}calender.png"; static String calenderIcon = "${rootIcon}calender.png";
static String moneyIcon = "${rootIcon}money.png"; static String moneyIcon = "${rootIcon}money.png";
static String transactionIcon = "${rootIcon}transaction.png"; static String transactionIcon = "${rootIcon}transaction.png";
static String profileSample = "${rootIcon}profile_default.png";
static String totalIcon = "${rootIcon}total.png"; static String totalIcon = "${rootIcon}total.png";
static String crossIcon = "${rootIcon}cross.png"; static String crossIcon = "${rootIcon}cross.png";
} }
...@@ -125,7 +125,7 @@ class RouteGenerator { ...@@ -125,7 +125,7 @@ class RouteGenerator {
ErrorWidgetView( ErrorWidgetView(
messageError: Strings.notFoundPage, messageError: Strings.notFoundPage,
), ),
nameRoute: Routes.notFoundRoute, nameRoute: routeSettings.name!,
routeSettings: routeSettings, routeSettings: routeSettings,
); );
} }
......
...@@ -7,7 +7,7 @@ project(runner LANGUAGES CXX) ...@@ -7,7 +7,7 @@ project(runner LANGUAGES CXX)
set(BINARY_NAME "tour_travel_agr") set(BINARY_NAME "tour_travel_agr")
# The unique GTK application identifier for this application. See: # The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID # https://wiki.gnome.org/HowDoI/ChooseApplicationID
set(APPLICATION_ID "com.example.tour_agency") set(APPLICATION_ID "com.example.tour_agent")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake. # versions of CMake.
......
...@@ -20,22 +20,19 @@ ...@@ -20,22 +20,19 @@
<meta content="IE=Edge" http-equiv="X-UA-Compatible" /> <meta content="IE=Edge" http-equiv="X-UA-Compatible" />
<meta <meta
name="description" name="description"
content="Ravintola Tour &amp; Travel Agency For Agrinesia." content="Ravintola Tour &amp; Travel Agent For Agrinesia."
/> />
<!-- iOS meta tags & icons --> <!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta <meta name="apple-mobile-web-app-title" content="Tour &amp; Travel Agent" />
name="apple-mobile-web-app-title"
content="Tour &amp; Travel Agency"
/>
<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="agr_icon.png" /> <link rel="icon" type="image/png" href="agr_icon.png" />
<title>Tour &amp; Travel Agency</title> <title>Tour &amp; Travel Agent</title>
<link rel="manifest" href="manifest.json" /> <link rel="manifest" href="manifest.json" />
<script> <script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment