diff --git a/android/fastlane/report.xml b/android/fastlane/report.xml index 3de715e..f93850e 100644 --- a/android/fastlane/report.xml +++ b/android/fastlane/report.xml @@ -5,27 +5,27 @@ - + - + - + - + - + diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e50f0d3..8f50738 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -32,6 +32,13 @@ PODS: - GoogleUtilities/UserDefaults (~> 7.8) - nanopb (< 2.30910.0, >= 2.30908.0) - Flutter (1.0.0) + - flutter_inappwebview (0.0.1): + - Flutter + - flutter_inappwebview/Core (= 0.0.1) + - OrderedSet (~> 5.0) + - flutter_inappwebview/Core (0.0.1): + - Flutter + - OrderedSet (~> 5.0) - flutter_local_notifications (0.0.1): - Flutter - flutter_secure_storage (6.0.0): @@ -67,6 +74,7 @@ PODS: - nanopb/encode (= 2.30909.1) - nanopb/decode (2.30909.1) - nanopb/encode (2.30909.1) + - OrderedSet (5.0.0) - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS @@ -79,6 +87,7 @@ DEPENDENCIES: - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - Flutter (from `Flutter`) + - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) @@ -96,6 +105,7 @@ SPEC REPOS: - GoogleDataTransport - GoogleUtilities - nanopb + - OrderedSet - PromisesObjC - Toast @@ -106,6 +116,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/firebase_messaging/ios" Flutter: :path: Flutter + flutter_inappwebview: + :path: ".symlinks/plugins/flutter_inappwebview/ios" flutter_local_notifications: :path: ".symlinks/plugins/flutter_local_notifications/ios" flutter_secure_storage: @@ -128,6 +140,7 @@ SPEC CHECKSUMS: FirebaseInstallations: 9387bf15abfc69a714f54e54f74a251264fdb79b FirebaseMessaging: 80b4a086d20ed4fd385a702f4bfa920e14f5064d Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + flutter_inappwebview: 3d32228f1304635e7c028b0d4252937730bbc6cf flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743 flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265 @@ -135,6 +148,7 @@ SPEC CHECKSUMS: GoogleUtilities: 202e7a9f5128accd11160fb9c19612de1911aa19 image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5 + OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 diff --git a/ios/Runner.app.dSYM.zip b/ios/Runner.app.dSYM.zip index 2cc9615..e52b7fd 100644 Binary files a/ios/Runner.app.dSYM.zip and b/ios/Runner.app.dSYM.zip differ diff --git a/ios/Runner.ipa b/ios/Runner.ipa index 6c0daa1..ce4df3d 100644 Binary files a/ios/Runner.ipa and b/ios/Runner.ipa differ diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 04e9665..05c7e2a 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -476,7 +476,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 643M65W7HH; ENABLE_BITCODE = NO; @@ -505,7 +505,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_TEAM = 643M65W7HH; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; @@ -524,7 +524,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_TEAM = 643M65W7HH; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; @@ -541,7 +541,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_TEAM = 643M65W7HH; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; @@ -669,7 +669,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 643M65W7HH; ENABLE_BITCODE = NO; @@ -703,7 +703,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 643M65W7HH; ENABLE_BITCODE = NO; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 337c0d7..de1c06c 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -29,7 +29,7 @@ CFBundleSignature ???? CFBundleVersion - 8 + 11 LSRequiresIPhoneOS UIApplicationSupportsIndirectInputEvents diff --git a/ios/fastlane/report.xml b/ios/fastlane/report.xml index aa7550b..4186cad 100644 --- a/ios/fastlane/report.xml +++ b/ios/fastlane/report.xml @@ -5,72 +5,72 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/lib/Model/model/booking/resource_model.dart b/lib/Model/model/booking/resource_model.dart index bfc3488..7741336 100644 --- a/lib/Model/model/booking/resource_model.dart +++ b/lib/Model/model/booking/resource_model.dart @@ -285,7 +285,7 @@ class AdminResourceBookingHistory { String responsibilityName; String responsibilityPhone; String? description; - String imgUrl; + String? imgUrl; List productList; AdminResourceBookingHistory({ diff --git a/lib/Model/model/booking/resource_model.g.dart b/lib/Model/model/booking/resource_model.g.dart index 3475a39..8fb6fbf 100644 --- a/lib/Model/model/booking/resource_model.g.dart +++ b/lib/Model/model/booking/resource_model.g.dart @@ -317,7 +317,7 @@ AdminResourceBookingHistory _$AdminResourceBookingHistoryFromJson( responsibilityName: json['responsibilityName'] as String, responsibilityPhone: json['responsibilityPhone'] as String, description: json['description'] as String?, - imgUrl: json['imgUrl'] as String, + imgUrl: json['imgUrl'] as String?, productList: (json['productList'] as List) .map((e) => ResourcesList.fromJson(e as Map)) .toList(), diff --git a/lib/Model/network/api_manager.dart b/lib/Model/network/api_manager.dart index 2a0adb9..3faf589 100644 --- a/lib/Model/network/api_manager.dart +++ b/lib/Model/network/api_manager.dart @@ -29,7 +29,7 @@ class APIManager { ) async { setToken(); // print('${await storage.read(key: accessTokenKey)}'); - // print('${defaultOptions.headers}'); + print('${defaultOptions.headers}'); if (options != null && options.headers != null) { defaultOptions.headers!.addAll(options.headers!); @@ -129,6 +129,7 @@ class APIManager { void deleteToken() { storage.delete(key: refreshTokenKey); storage.delete(key: accessTokenKey); + isAdmin = false; } Future checkToken() async { diff --git a/lib/Presenter/booking/car_service.dart b/lib/Presenter/booking/car_service.dart index 1919036..da9e9e5 100644 --- a/lib/Presenter/booking/car_service.dart +++ b/lib/Presenter/booking/car_service.dart @@ -9,7 +9,7 @@ import '../../Model/network/api_manager.dart'; class CarService { final carURL = '/cars'; final carBookingHistoryURL = '/bookings/cars'; - final carAdminBookingHistoryURL = '/admin/bookings/cars'; + final carAdminBookingHistoryURL = '/admin/bookings/cars&size'; DateTime? startDate; DateTime? startTime; @@ -30,14 +30,15 @@ class CarService { String endTimeStr = ''; if (startDate != null && startTime != null) { - startTimeStr = '${DateFormat('yyyy-MM-dd').format(startDate!)} ${DateFormat('HH:mm').format(startTime!)}'; + startTimeStr = + '${DateFormat('yyyy-MM-dd').format(startDate!)} ${DateFormat('HH:mm').format(startTime!)}'; } if (endDate != null && endTime != null) { - endTimeStr = '${DateFormat('yyyy-MM-dd').format(endDate!)} ${DateFormat('HH:mm').format(endTime!)}'; + endTimeStr = + '${DateFormat('yyyy-MM-dd').format(endDate!)} ${DateFormat('HH:mm').format(endTime!)}'; } - final response = await APIManager().request( RequestType.get, carURL, @@ -149,16 +150,13 @@ class CarService { } /// 예약된 날짜, 시간의 예약 내역 조회 - Future getBookedDetailInfo(int resourceId, DateTime selectedDate, int selectedTime) async { + Future getBookedDetailInfo( + int resourceId, DateTime selectedDate, int selectedTime) async { String date = DateFormat('yyyy-MM-dd').format(selectedDate); String time = (selectedTime < 10) ? '0$selectedTime' : '$selectedTime'; - final response = await APIManager().request( - RequestType.get, - '$carURL/$resourceId/booking', - null, - {'dateTime': '$date $time'}, - null); + final response = await APIManager().request(RequestType.get, + '$carURL/$resourceId/booking', null, {'dateTime': '$date $time'}, null); return response; } @@ -166,12 +164,8 @@ class CarService { Future getBookedInfoList(int carId, DateTime selectedDate) async { String date = DateFormat('yyyy-MM-dd').format(selectedDate); - final response = await APIManager().request( - RequestType.get, - '$carURL/$carId/booking-info', - null, - {'date': date}, - null); + final response = await APIManager().request(RequestType.get, + '$carURL/$carId/booking-info', null, {'date': date}, null); return response; } @@ -182,25 +176,31 @@ class CarService { RequestType.get, '$carURL/$carId/booking-time', null, - {'date': selectedDate,}, + { + 'date': selectedDate, + }, null); return response; } - Future getBookedDateList(int carId, DateTime selectedMonth, DateTime? selectedDay) async { + Future getBookedDateList( + int carId, DateTime selectedMonth, DateTime? selectedDay) async { String selectedMonthStr = DateFormat('yyyy-MM').format(selectedMonth); final response = await APIManager().request( RequestType.get, '$carURL/$carId/booking-state', null, - {'month': selectedMonthStr,}, + { + 'month': selectedMonthStr, + }, null); return response; } /// 차량 예약 - Future bookCar(int carId, DateTime startDate, DateTime endDate, String memo) async { + Future bookCar( + int carId, DateTime startDate, DateTime endDate, String memo) async { String startDateStr = DateFormat('yyyy-MM-dd HH').format(startDate); String endDateStr = DateFormat('yyyy-MM-dd HH').format(endDate); @@ -211,8 +211,8 @@ class CarService { ); try { - final response = await APIManager().request(RequestType.post, - '$carURL/$carId', null, null, body.toJson()); + final response = await APIManager().request( + RequestType.post, '$carURL/$carId', null, null, body.toJson()); if (response != null) { final data = GeneralModel.fromJson(response); @@ -224,7 +224,7 @@ class CarService { final response = e.response; if (response != null) { final error = - GeneralModel.fromJson(response.data as Map); + GeneralModel.fromJson(response.data as Map); return error.message; } } diff --git a/lib/Presenter/booking/resource_service.dart b/lib/Presenter/booking/resource_service.dart index d5efc7d..3ef2572 100644 --- a/lib/Presenter/booking/resource_service.dart +++ b/lib/Presenter/booking/resource_service.dart @@ -30,11 +30,13 @@ class ResourceService { String endTimeStr = ''; if (startDate != null && startTime != null) { - startTimeStr = '${DateFormat('yyyy-MM-dd').format(startDate!)} ${DateFormat('HH:mm').format(startTime!)}'; + startTimeStr = + '${DateFormat('yyyy-MM-dd').format(startDate!)} ${DateFormat('HH:mm').format(startTime!)}'; } if (endDate != null && endTime != null) { - endTimeStr = '${DateFormat('yyyy-MM-dd').format(endDate!)} ${DateFormat('HH:mm').format(endTime!)}'; + endTimeStr = + '${DateFormat('yyyy-MM-dd').format(endDate!)} ${DateFormat('HH:mm').format(endTime!)}'; } final response = await APIManager().request( @@ -72,19 +74,24 @@ class ResourceService { RequestType.get, '$resourceURL/$resourceId/booking-time', null, - {'date': selectedDate,}, + { + 'date': selectedDate, + }, null); return response; } - Future getBookedDateList(int resourceId, DateTime selectedMonth, DateTime? selectedDay) async { + Future getBookedDateList( + int resourceId, DateTime selectedMonth, DateTime? selectedDay) async { String selectedMonthStr = DateFormat('yyyy-MM').format(selectedMonth); final response = await APIManager().request( RequestType.get, '$resourceURL/$resourceId/booking-state', null, - {'month': selectedMonthStr,}, + { + 'month': selectedMonthStr, + }, null); return response; } @@ -105,7 +112,8 @@ class ResourceService { } /// 예약된 날짜, 시간의 예약 내역 조회 - Future getBookedDetailInfo(int resourceId, DateTime selectedDate, int selectedTime) async { + Future getBookedDetailInfo( + int resourceId, DateTime selectedDate, int selectedTime) async { String date = DateFormat('yyyy-MM-dd').format(selectedDate); String time = (selectedTime < 10) ? '0$selectedTime' : '$selectedTime'; @@ -119,15 +127,12 @@ class ResourceService { } /// 예약된 날짜의 모든 예약 내역 조회 - Future getBookedInfoList(int resourceId, DateTime selectedDate) async { + Future getBookedInfoList( + int resourceId, DateTime selectedDate) async { String date = DateFormat('yyyy-MM-dd').format(selectedDate); - final response = await APIManager().request( - RequestType.get, - '$resourceURL/$resourceId/booking-info', - null, - {'date': date}, - null); + final response = await APIManager().request(RequestType.get, + '$resourceURL/$resourceId/booking-info', null, {'date': date}, null); return response; } @@ -164,8 +169,9 @@ class ResourceService { // 장비 예약 목록 조회 Future getResourceBookingHistoryList(bool isAdmin) async { - String url = - isAdmin ? resourceAdminBookingHistoryURL : resourceBookingHistoryURL; + String url = isAdmin + ? "$resourceAdminBookingHistoryURL?23size=200" + : "$resourceBookingHistoryURL?size=200"; final response = await APIManager().request(RequestType.get, url, null, null, null); return response; diff --git a/lib/View/booking/component/admin_booking_history_cell.dart b/lib/View/booking/component/admin_booking_history_cell.dart index 62d4861..166b68f 100644 --- a/lib/View/booking/component/admin_booking_history_cell.dart +++ b/lib/View/booking/component/admin_booking_history_cell.dart @@ -110,7 +110,7 @@ class _AdminBookingHistoryCellState extends State { width: 28, ), Text( - widget.goal ?? '미기입', + widget.goal == null ? '미기입' : widget.goal!, style: contentStyle, textAlign: TextAlign.justify, ) diff --git a/lib/View/booking/screen/booking_screen.dart b/lib/View/booking/screen/booking_screen.dart index b5c07a6..2d96242 100644 --- a/lib/View/booking/screen/booking_screen.dart +++ b/lib/View/booking/screen/booking_screen.dart @@ -14,7 +14,7 @@ import '../component/custom_search_bar.dart'; import '../component/office_item.dart'; import '../component/resource_item.dart'; -enum BookingType { office, resource, car } +enum BookingType { office, resource, car } class BookingScreen extends StatefulWidget { const BookingScreen({Key? key}) : super(key: key); @@ -23,8 +23,8 @@ class BookingScreen extends StatefulWidget { State createState() => BookingScreenState(); } -class BookingScreenState extends State with SingleTickerProviderStateMixin { - +class BookingScreenState extends State + with SingleTickerProviderStateMixin { static const category = ['회의실', '장비', '차량']; BookingType currentType = BookingType.office; @@ -39,6 +39,7 @@ class BookingScreenState extends State with SingleTickerProviderS super.initState(); controller = TabController(length: 3, vsync: this); controller.addListener(tabListener); + isLoading = true; } @override @@ -76,19 +77,20 @@ class BookingScreenState extends State with SingleTickerProviderS child: Column( children: [ renderTabBar(), - CustomSearchBar(type: currentType,), + CustomSearchBar( + type: currentType, + ), Expanded( child: TabBarView( controller: controller, - children: - category.map((e) => renderItems(e)).toList(), + children: category.map((e) => renderItems(e)).toList(), ), ) ], ), ); } - + Widget renderTabBar() { const TextStyle selectedTextStyle = TextStyle( fontSize: 14, @@ -103,74 +105,88 @@ class BookingScreenState extends State with SingleTickerProviderS return SizedBox( height: 38, child: TabBar( - controller: controller, - isScrollable: true, - indicatorColor: purple, - indicatorWeight: 3.0, - indicatorPadding: const EdgeInsets.only(left: 10, right: 10), - labelColor: purple, - labelStyle: selectedTextStyle, - unselectedLabelColor: Colors.grey, - unselectedLabelStyle: unSelectedTextStyle, - tabs: [ - renderTabItem(category[0]), - renderTabItem(category[1]), - renderTabItem(category[2]), - ] - ), + controller: controller, + isScrollable: true, + indicatorColor: purple, + indicatorWeight: 3.0, + indicatorPadding: const EdgeInsets.only(left: 10, right: 10), + labelColor: purple, + labelStyle: selectedTextStyle, + unselectedLabelColor: Colors.grey, + unselectedLabelStyle: unSelectedTextStyle, + tabs: [ + renderTabItem(category[0]), + renderTabItem(category[1]), + renderTabItem(category[2]), + ]), ); } Widget renderTabItem(String title) { return SizedBox( - width: (MediaQuery.of(context).size.width - 100) / 3 , - child: Tab(icon: Text(title),), + width: (MediaQuery.of(context).size.width - 100) / 3, + child: Tab( + icon: Text(title), + ), ); } - + Widget renderItems(String categoryName) { return FutureBuilder( - future: fetchData(), - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.hasError || snapshot.data == null) { - return const Center( - child: Text('정보를 불러오지 못 하였습니다.', style: TextStyle(fontSize: 16, color: purple),), - ); - } - else { - if (isLoading) { - return const Center(child: CircularProgressIndicator(color: purple,),); + future: fetchData(), + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.hasError || snapshot.data == null) { + return const Center( + child: Text( + '정보를 불러오지 못 하였습니다.', + style: TextStyle(fontSize: 16, color: purple), + ), + ); + } else { + if (isLoading) { + return const Center( + child: CircularProgressIndicator( + color: purple, + ), + ); + } + data = configureData(snapshot.data); + return Container( + height: getItemHeight() * data.data.content.length, + color: Colors.white, + child: (data.data.content.length == 0) + ? const Center( + child: Text( + '결과 정보가 없습니다.', + style: TextStyle(fontSize: 16, color: purple), + ), + ) + : ListView.builder( + scrollDirection: Axis.vertical, + itemCount: data.data.content.length, + itemBuilder: (BuildContext context, int index) { + return renderItem(data, index); + }, + ), + ); } - data = configureData(snapshot.data); - return Container( - height: getItemHeight() * data.data.content.length, - color: Colors.white, - child: (data.data.content.length == 0) - ? const Center( - child: Text('결과 정보가 없습니다.', style: TextStyle(fontSize: 16, color: purple),), - ) - : ListView.builder( - scrollDirection: Axis.vertical, - itemCount: data.data.content.length, - itemBuilder: (BuildContext context, int index) { - return renderItem(data, index); - }, - ), - ); - } - - } - ); + }); } Widget renderItem(GeneralModel data, int itemIndex) { switch (currentType) { case BookingType.office: - return OfficeItem(data: (data as OfficeResponseModel).data.content[itemIndex],); + return OfficeItem( + data: (data as OfficeResponseModel).data.content[itemIndex], + ); case BookingType.resource: - return ResourceItem(data: (data as ResourceResponseModel).data.content[itemIndex],); + return ResourceItem( + data: (data as ResourceResponseModel).data.content[itemIndex], + ); case BookingType.car: - return CarItem(data: (data as CarResponseModel).data.content[itemIndex],); + return CarItem( + data: (data as CarResponseModel).data.content[itemIndex], + ); } } @@ -179,9 +195,12 @@ class BookingScreenState extends State with SingleTickerProviderS setState(() { FocusScope.of(context).unfocus(); switch (controller.index) { - case 0: currentType = BookingType.office; - case 1: currentType = BookingType.resource; - case 2: currentType = BookingType.car; + case 0: + currentType = BookingType.office; + case 1: + currentType = BookingType.resource; + case 2: + currentType = BookingType.car; } OfficeService().keyword = ''; ResourceService().keyword = ''; @@ -191,9 +210,12 @@ class BookingScreenState extends State with SingleTickerProviderS double getItemHeight() { switch (currentType) { - case BookingType.office: return 292.0; - case BookingType.resource: return 232.0; - case BookingType.car: return 232.0; + case BookingType.office: + return 292.0; + case BookingType.resource: + return 232.0; + case BookingType.car: + return 232.0; } } @@ -211,9 +233,12 @@ class BookingScreenState extends State with SingleTickerProviderS void searchItems(String keyword) { setState(() { switch (currentType) { - case BookingType.office: OfficeService().keyword = keyword; - case BookingType.resource: ResourceService().keyword = keyword; - case BookingType.car: CarService().keyword = keyword; + case BookingType.office: + OfficeService().keyword = keyword; + case BookingType.resource: + ResourceService().keyword = keyword; + case BookingType.car: + CarService().keyword = keyword; } }); } diff --git a/lib/View/equipment/component/equipment_cell.dart b/lib/View/equipment/component/equipment_cell.dart index b6898e1..10ee5d8 100644 --- a/lib/View/equipment/component/equipment_cell.dart +++ b/lib/View/equipment/component/equipment_cell.dart @@ -45,7 +45,7 @@ class _EquipmentCellState extends State { ) ], ), - margin: const EdgeInsets.only(top: 10), + margin: const EdgeInsets.only(left: 20, right: 20, bottom: 10), child: Row( children: [ Container( diff --git a/lib/View/equipment/screen/equipment_add_screen.dart b/lib/View/equipment/screen/equipment_add_screen.dart index 9408884..55878e7 100644 --- a/lib/View/equipment/screen/equipment_add_screen.dart +++ b/lib/View/equipment/screen/equipment_add_screen.dart @@ -93,7 +93,7 @@ class _EquipmentAddScreen extends State { appBar: SubAppBar( titleText: widget.equipment == null ? '신규 비품 추가' : "비품 수정", ), - body: futureBody(), + body: SingleChildScrollView(child: futureBody()), bottomNavigationBar: PurpleBottomButton( title: widget.equipment == null ? '추가' : "수정", onPressed: checkEssential, @@ -530,7 +530,14 @@ class _EquipmentAddScreen extends State { Future result = EquipmentService().addEquipment( _selectedCategory!, description, imgKey, location, name, quantity); result.then((value) => { - if (value == true) {moveToPop()} else {showAlert(value)} + if (value == true) + { + Future.delayed(const Duration(milliseconds: 100), () { + moveToPop(); + }) + } + else + {showAlert(value)} }); } else { Future result = EquipmentService().editEquipment( @@ -543,7 +550,11 @@ class _EquipmentAddScreen extends State { quantity); result.then((value) => { if (value == true) - {Navigator.of(context).pop(), Navigator.of(context).pop()} + { + Future.delayed(const Duration(milliseconds: 100), () { + moveToPop(); + }) + } else {showAlert(value)} }); diff --git a/lib/View/equipment/screen/equipment_screen.dart b/lib/View/equipment/screen/equipment_screen.dart index 5d24d7d..5b50baa 100644 --- a/lib/View/equipment/screen/equipment_screen.dart +++ b/lib/View/equipment/screen/equipment_screen.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:frontend/Model/model/equipment/equipment_list_model.dart'; +import 'package:frontend/Model/model/general_model.dart'; import 'package:frontend/Presenter/equipment/equipment_service.dart'; import 'package:frontend/View/colors.dart'; import 'package:frontend/View/common/component/main_app_bar.dart'; @@ -23,6 +24,8 @@ class EquipmentScreenState extends State @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: Colors.white, + resizeToAvoidBottomInset: false, appBar: const MainAppBar(), body: futureBody(), floatingActionButton: FloatingActionButton( @@ -41,6 +44,10 @@ class EquipmentScreenState extends State return FutureBuilder( future: fetchData(), builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState != ConnectionState.done) { + return const CircularProgressIndicator(); + } + if (snapshot.hasError) { return noDataBody(); } @@ -67,61 +74,71 @@ class EquipmentScreenState extends State } Widget renderBody(List equipmentList) { - return Column( - children: [ - Container( - margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 10), - width: MediaQuery.of(context).size.width, - height: 36, - decoration: const BoxDecoration( - color: Color(0xFFF5F5F5), - borderRadius: BorderRadius.all(Radius.circular(8))), - child: Row( - children: [ - const Padding( - padding: EdgeInsets.symmetric(horizontal: 8.0), - child: Icon( - CupertinoIcons.search, - color: Colors.black, - ), - ), - Flexible( - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 6), - child: TextFormField( - cursorColor: purple, - controller: condController, - decoration: const InputDecoration( - hintText: "비품 검색", - hintStyle: - TextStyle(fontSize: 13, color: Color(0xFFC9C9C9)), - border: InputBorder.none, + return SizedBox( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + child: Column( + children: [ + Container( + margin: const EdgeInsets.only(top: 10, left: 20, right: 20), + width: MediaQuery.of(context).size.width, + height: 36, + decoration: const BoxDecoration( + color: Color(0xFFF5F5F5), + borderRadius: BorderRadius.all(Radius.circular(8))), + child: Row( + children: [ + const Padding( + padding: EdgeInsets.symmetric(horizontal: 8.0), + child: Icon( + CupertinoIcons.search, + color: Colors.black, ), - onChanged: (value) { - setState(() {}); - }, ), - )), - ], - ), - ), - Container( - height: MediaQuery.of(context).size.height * 0.7, - color: Colors.white, - child: equipmentList.isEmpty - ? noDataBody() - : ListView.builder( - padding: const EdgeInsets.only(left: 20, right: 20, top: 7), - scrollDirection: Axis.vertical, - itemCount: equipmentList.length, - itemBuilder: (BuildContext context, int index) { - return GestureDetector( - onTap: () => showDetail(equipmentList[index]), - child: EquipmentCell(equipment: equipmentList[index]), - ); + Flexible( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 6), + child: TextFormField( + cursorColor: purple, + controller: condController, + decoration: const InputDecoration( + hintText: "비품 검색", + hintStyle: + TextStyle(fontSize: 13, color: Color(0xFFC9C9C9)), + border: InputBorder.none, + ), + onChanged: (value) { + setState(() {}); }, - )) - ], + ), + )), + ], + ), + ), + Expanded( + child: Container( + margin: const EdgeInsets.only(top: 7), + height: equipmentList.isEmpty + ? MediaQuery.of(context).size.height + : (MediaQuery.of(context).size.height - + (AppBar().preferredSize.height + + MediaQuery.of(context).padding.top)), + color: Colors.white, + child: equipmentList.isEmpty + ? noDataBody() + : ListView.builder( + scrollDirection: Axis.vertical, + itemCount: equipmentList.length, + itemBuilder: (BuildContext context, int index) { + return GestureDetector( + onTap: () => showDetail(equipmentList[index]), + child: EquipmentCell( + equipment: equipmentList[index]), + ); + }, + ))) + ], + ), ); } @@ -430,12 +447,11 @@ class EquipmentScreenState extends State ], ), ); - }).then((value) { - setState(() {}); - }); + }); } void showDeleteSheet(EquipmentModel equipment) { + Navigator.of(context).pop(); showModalBottomSheet( context: context, shape: RoundedRectangleBorder( @@ -508,7 +524,9 @@ class EquipmentScreenState extends State ), ); }).then((value) { - setState(() {}); + setState(() { + reloadData(); + }); }); } @@ -534,6 +552,7 @@ class EquipmentScreenState extends State } void editEquipment(EquipmentModel equipment) { + Navigator.of(context).pop(); Navigator.of(context) .push(MaterialPageRoute( builder: (_) => EquipmentAddScreen(equipment: equipment))) @@ -545,12 +564,9 @@ class EquipmentScreenState extends State void deleteEquipment(EquipmentModel equipment) { Future result = EquipmentService().deleteEquipment(equipment.equipmentId); - result.then((value) => { - if (value == true) - {Navigator.of(context).pop(), Navigator.of(context).pop()} - else - {Fluttertoast.showToast(msg: value)} - }); + + Navigator.of(context).pop(); + setState(() {}); } void popNavi() { diff --git a/lib/View/login/screen/login_screen.dart b/lib/View/login/screen/login_screen.dart index 20fd11e..c8020e5 100644 --- a/lib/View/login/screen/login_screen.dart +++ b/lib/View/login/screen/login_screen.dart @@ -223,9 +223,11 @@ class _LoginScreenState extends State { result.then((value) => { if (value == true) { - Navigator.of(context).pushAndRemoveUntil( - MaterialPageRoute(builder: (_) => const RootTab()), - (route) => false) + Future.delayed(const Duration(milliseconds: 100), () { + Navigator.of(context).pushAndRemoveUntil( + MaterialPageRoute(builder: (_) => const RootTab()), + (route) => false); + }) } else if (value == false) {showAlert("알 수 없는 오류가 발생했습니다. 다시 시도해주세요.")} diff --git a/lib/View/mypage/screen/mypage_screen.dart b/lib/View/mypage/screen/mypage_screen.dart index 9dae4e0..648236c 100644 --- a/lib/View/mypage/screen/mypage_screen.dart +++ b/lib/View/mypage/screen/mypage_screen.dart @@ -11,6 +11,7 @@ import 'package:frontend/View/common/component/sub_app_bar.dart'; import 'package:frontend/View/login/screen/login_screen.dart'; import 'package:frontend/View/mypage/component/mypage_cell.dart'; import 'package:frontend/View/mypage/screen/myinfo_edit_screen.dart'; +import 'package:frontend/View/mypage/screen/webview_screen.dart'; class MypageScreen extends StatefulWidget { const MypageScreen({super.key}); @@ -207,9 +208,23 @@ class _MypageScreen extends State { .push(MaterialPageRoute(builder: (_) => const MyInfoEditScreen())); } - void moveToService() {} + void moveToService() { + Navigator.of(context).push(MaterialPageRoute( + builder: (_) => const WebviewScreen( + url: + 'https://broadleaf-mist-919.notion.site/eb903eafa720419a925fa6d1ec5ebde9?pvs=4', + title: '서비스 이용약관', + ))); + } - void moveToInfo() {} + void moveToInfo() { + Navigator.of(context).push(MaterialPageRoute( + builder: (_) => const WebviewScreen( + url: + 'https://broadleaf-mist-919.notion.site/9310499f66614abbbca63bb201ed07b5?pvs=4', + title: '개인정보 처리방침', + ))); + } void logout() { Future result = MypageService().logout(); diff --git a/lib/View/mypage/screen/webview_screen.dart b/lib/View/mypage/screen/webview_screen.dart new file mode 100644 index 0000000..ffa37ef --- /dev/null +++ b/lib/View/mypage/screen/webview_screen.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_inappwebview/flutter_inappwebview.dart'; +import 'package:frontend/View/common/component/sub_app_bar.dart'; + +class WebviewScreen extends StatefulWidget { + final String url; + final String title; + const WebviewScreen({super.key, required this.url, required this.title}); + + @override + State createState() => _WebviewScreen(); +} + +class _WebviewScreen extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: SubAppBar(titleText: widget.title), + body: InAppWebView( + initialUrlRequest: URLRequest( + url: Uri.parse(widget.url), + ), + initialOptions: InAppWebViewGroupOptions( + android: AndroidInAppWebViewOptions(useHybridComposition: true)), + ), + ); + } +} diff --git a/lib/View/notification/component/notification_cell.dart b/lib/View/notification/component/notification_cell.dart index 36d956b..8efc1ee 100644 --- a/lib/View/notification/component/notification_cell.dart +++ b/lib/View/notification/component/notification_cell.dart @@ -32,22 +32,22 @@ class _NotificationCellState extends State { void getType() { switch (widget.notification.notificationType) { - case "장비 예약 요청": + case "장비예약 요청": type = NotificationType.Request; break; - case "장비 예약 완료": + case "장비예약 완료": type = NotificationType.Complete; break; - case "장비 예약 승인": + case "장비예약 승인": type = NotificationType.Approve; break; - case "장비 예약 반려": + case "장비예약 반려": type = NotificationType.Cancel; break; - case "장비 예약 반납": + case "장비예약 반납": type = NotificationType.Return; break; - case "장비 예약 종료": + case "장비예약 종료": type = NotificationType.End; break; } @@ -55,6 +55,7 @@ class _NotificationCellState extends State { @override void initState() { + getType(); super.initState(); } diff --git a/pubspec.lock b/pubspec.lock index 5529f06..b79d3d6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -326,6 +326,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_inappwebview: + dependency: "direct main" + description: + name: flutter_inappwebview + sha256: d198297060d116b94048301ee6749cd2e7d03c1f2689783f52d210a6b7aba350 + url: "https://pub.dev" + source: hosted + version: "5.8.0" flutter_lints: dependency: "direct dev" description: diff --git a/pubspec.yaml b/pubspec.yaml index 7128cab..76c6b89 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: frontend description: A new Flutter project. publish_to: none -version: 18.0.0+18 +version: 20.0.0+20 environment: sdk: ">=3.0.5 <4.0.0" dependencies: @@ -23,6 +23,7 @@ dependencies: url_launcher: "^6.2.1" http: "^0.13.4" path_provider: "^2.1.1" + flutter_inappwebview: "^5.7.2+3" dev_dependencies: flutter_test: sdk: flutter