diff --git a/frontend/lib/http.dart b/frontend/lib/http.dart index e33bb26b25..9aa140fa7b 100644 --- a/frontend/lib/http.dart +++ b/frontend/lib/http.dart @@ -323,7 +323,9 @@ Future quizCreate( "endDate": endDate, }), ); - final data = res.body; + //final data = res.body; + final data = json.decode(utf8.decode(res.bodyBytes)); + print(data); return data; } @@ -693,6 +695,37 @@ Future getRecommend(String token) async { return data; } +//서재 삭제하기 +Future deleteLibrary(String token, String groupName) async { + var address = + Uri.parse("$BASE_URL/member/my-book/rm/group?groupName=$groupName"); + http.Response res = await http.delete( + address, + headers: { + "Content-Type": "application/json", + "Authorization": 'Bearer $token', + }, + ); + final data = res.body; + return data; +} + +//서재에서 책 삭제하기 +Future deleteBookFromLibrary( + String token, String groupName, String isbn) async { + var address = Uri.parse( + "$BASE_URL/member/my-book/rm/book?groupName=$groupName&isbn=$isbn"); + http.Response res = await http.delete( + address, + headers: { + "Content-Type": "application/json", + "Authorization": 'Bearer $token', + }, + ); + final data = res.body; + return data; +} + // 추천 리스트 받아오기(비로그인) Future getRecommendAnony() async { var address = Uri.parse(BASE_URL + "/rec/anonymous"); diff --git a/frontend/lib/screens/home/bookreport/bookreport_writing_screen.dart b/frontend/lib/screens/home/bookreport/bookreport_writing_screen.dart index fd126c5aec..6bff77331f 100644 --- a/frontend/lib/screens/home/bookreport/bookreport_writing_screen.dart +++ b/frontend/lib/screens/home/bookreport/bookreport_writing_screen.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:frontend/http.dart'; import 'package:frontend/provider/secure_storage_provider.dart'; -import 'package:frontend/screens/home/bookreport/bookreport_viewing_screen.dart'; import 'package:frontend/screens/home/bookreport/booksearch_screen_util.dart' as searchutil; import 'package:go_router/go_router.dart'; @@ -191,7 +190,6 @@ class _BookReportWritingState extends State { SizedBox(width: 10.w), Expanded( child: SizedBox( - //width: _screenWidth * 0.7, child: TextField( style: TextStyle(fontSize: 14.sp), controller: _titleController, @@ -457,10 +455,10 @@ class _BookReportWritingState extends State { selectedCategory.toString(), _questionController.text, ansnum, - _answerController1.text, - _answerController2.text, - _answerController3.text, - _answerController4.text, + _answerControllers[0].text, + _answerControllers[1].text, + _answerControllers[2].text, + _answerControllers[3].text, _startDate.toString(), _endDate.toString()); break; @@ -557,13 +555,11 @@ class _BookReportWritingState extends State { controller: _writingController, textAlign: TextAlign.center, maxLines: 10, - decoration: InputDecoration( decoration: InputDecoration( hintText: '인용문을 작성해주세요', hintStyle: TextStyle( // 힌트 텍스트 정중앙 정렬 height: 15.h, - height: 15.h, ), border: InputBorder.none, ), @@ -630,8 +626,7 @@ class _BookReportWritingState extends State { ), ], ), - SizedBox(height: 15.h), - SizedBox(height: 15.h), + SizedBox(height: 5.h), Padding( padding: EdgeInsets.symmetric(horizontal: 0.w), child: Row( @@ -657,8 +652,6 @@ class _BookReportWritingState extends State { SizedBox( width: 350.w, height: 150.h, - width: 350.w, - height: 190.h, child: Stack( children: [ Positioned( @@ -667,12 +660,8 @@ class _BookReportWritingState extends State { child: Container( width: 350.w, height: 150.h, - width: 350.w, - height: 190.h, decoration: BoxDecoration( color: const Color(0xFFE7FFEB), - borderRadius: BorderRadius.circular(20), - border: Border.all(width: 1.w), borderRadius: BorderRadius.circular(20.r), border: Border.all(width: 1.w), ), @@ -735,8 +724,6 @@ class _BookReportWritingState extends State { SizedBox( width: 350.w, height: 150.h, - width: 350.w, - height: 190.h, child: Stack( children: [ Positioned( @@ -745,12 +732,8 @@ class _BookReportWritingState extends State { child: Container( width: 350.w, height: 150.h, - width: 350.w, - height: 190.h, decoration: BoxDecoration( color: const Color(0xFFE7FFEB), - borderRadius: BorderRadius.circular(20), - border: Border.all(width: 1.w), borderRadius: BorderRadius.circular(20.r), border: Border.all(width: 1.w), ), @@ -765,7 +748,6 @@ class _BookReportWritingState extends State { SizedBox(width: 10.w), Expanded( child: SizedBox( - //width: _screenWidth * 0.7, child: TextField( style: TextStyle(fontSize: 14.sp), controller: _questionController, @@ -785,7 +767,6 @@ class _BookReportWritingState extends State { SizedBox(height: 15.h), SizedBox(height: 15.h), Padding( - padding: EdgeInsets.symmetric(horizontal: 20.w), padding: EdgeInsets.symmetric(horizontal: 20.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -801,15 +782,13 @@ class _BookReportWritingState extends State { backgroundColor: _isOX ? Colors.green : Colors.white, elevation: 0, side: BorderSide(width: 0.5.w), - side: BorderSide(width: 0.5.w), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20.r)), - minimumSize: const Size(140, 140), + minimumSize: Size(140.w, 140.w), ), child: const Text('O'), ), SizedBox(width: 30.w), - SizedBox(width: 30.w), ElevatedButton( onPressed: () { setState(() { @@ -821,10 +800,9 @@ class _BookReportWritingState extends State { backgroundColor: !_isOX ? Colors.green : Colors.white, elevation: 0, side: BorderSide(width: 0.5.w), - side: BorderSide(width: 0.5.w), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20.r)), - minimumSize: const Size(140, 140), + minimumSize: Size(140.w, 140.w), ), child: const Text('X'), ), @@ -839,8 +817,6 @@ class _BookReportWritingState extends State { SizedBox( width: 350.w, height: 150.h, - width: 350.w, - height: 190.h, child: Stack( children: [ Positioned( @@ -849,12 +825,8 @@ class _BookReportWritingState extends State { child: Container( width: 350.w, height: 150.h, - width: 350.w, - height: 190.h, decoration: BoxDecoration( color: const Color(0xFFE7FFEB), - borderRadius: BorderRadius.circular(20), - border: Border.all(width: 1.w), borderRadius: BorderRadius.circular(20.r), border: Border.all(width: 1.w), ), @@ -866,10 +838,8 @@ class _BookReportWritingState extends State { children: [ const Text('Q: '), SizedBox(width: 10.w), - SizedBox(width: 10.w), Expanded( child: SizedBox( - //width: _screenWidth * 0.7, child: TextField( style: TextStyle(fontSize: 14.sp), controller: _questionController, @@ -886,10 +856,8 @@ class _BookReportWritingState extends State { ], ), ), - SizedBox(height: 15.h), - SizedBox(height: 15.h), + SizedBox(height: 10.h), Padding( - padding: EdgeInsets.symmetric(horizontal: 0.w), padding: EdgeInsets.symmetric(horizontal: 0.w), child: Column( children: [ @@ -920,7 +888,6 @@ class _BookReportWritingState extends State { ), ), SizedBox(width: 5.w), - SizedBox(width: 5.w), Expanded( child: Container( decoration: BoxDecoration( @@ -928,26 +895,22 @@ class _BookReportWritingState extends State { border: Border.all( color: Colors.black, width: 0.5.w, - width: 0.5.w, ), color: _multipleanswer[i] ? Colors.green : Colors.white, ), height: 24.h, - height: 24.h, alignment: Alignment.center, child: Row( children: [ - SizedBox(width: 10.w), SizedBox(width: 10.w), const Text('A: '), Expanded( child: SizedBox( - //width: _screenWidth * 0.7, child: TextField( style: TextStyle(fontSize: 10.sp), - controller: _answerController1, + controller: _answerControllers[i], decoration: InputDecoration( hintText: '답을 입력해주세요.', contentPadding: