J.Y.S
¿ whats my interest ?
J.Y.S
전체 방문자
오늘
어제
  • 분류 전체보기 (59)
    • 트러블슈팅 기록 (7)
    • Java&Kotlin (5)
    • Server (22)
    • 데이터 엔지니어링 (3)
    • Architecture& Design Patter.. (1)
    • Daily (11)
    • 알고리즘 공부 (9)

블로그 메뉴

  • 홈
  • 태그

공지사항

인기 글

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
J.Y.S

¿ whats my interest ?

Server

Flutter Spring-boot 연동해서 웹 페이지 만들기(to-do list)

2021. 12. 22. 17:52

flutter 연동 관련 정리안된 내용들

✅ 연동하는 방법이 Spring boot 에서 띄운 서버를 flutter에서 접속(fetch.get())하여 데이터 받아와서 ui까지 합해서 보여주는 방법밖에 없는건지? 내가 생각했던 방식은 백엔드는 spring-boot로, front는 flutter로 구현하는 것이었음.

==> spring boot에서 백엔드를 처리. 즉 비즈니스 로직에 필요한 데이터를 처리한다.
Flutter로는 프론트엔드를 구현. 즉 처리된 데이터를 화면에 보여주는 것.

결론:

서로 연동하기 위해서는 1) 로직에 따라 데이터를 json 타입으로 받아오거나/보내는 spring boot에서 작동하는 서버가 필요하고, 2) frontend는 이 서버로부터 받는(서버로 보내는) Json 형식의 데이터를 처리하여 사용자에게 보여줄 수 있도록 구현을 해야한다.

--- 구현 끝~.~

참고한 블로그:

1. https://betterprogramming.pub/how-to-display-data-in-flutter-using-spring-boot-rest-service-e722ceb80d97

 

How to Display Data in Flutter Using Spring Boot REST Service

Fetch data from a Spring REST service and display the results in dynamic grid cards

betterprogramming.pub

요약 : spring boot로 localhost:8080/api 띄움. 접속하면 json 으로 반환된 값만 출력됨. flutter에서 localhost:8080/api에 접속해서 ui+합해서 localhost:______ 에 새로 띄우게 됨.

* 이거 대로 따라하면 에러 나고 spring boot에서 CORS 설정을 바꿔줘야 flutter에서 접근 가능해짐.

2. https://www.youtube.com/watch?v=BpdU-nLDV78&list=PLeFUpOmPweSixYxSMLLJ8rark-CFTLPn3 

 

저작자표시

'Server' 카테고리의 다른 글

[spring-boot] application.properties-dev로 실행하기  (0) 2022.01.19
[Spring-boot] @RequestBody, @ResponseBody : HTTP body에 데이터 송수신하기  (0) 2021.12.28
[Spring] 스프링 빈, 의존성(DI) 주입  (0) 2021.12.07
VSCode Javascript 개발 환경 (Prettier, ESLint, Typescript)  (0) 2021.10.07
[node.js] 간단 HTTP 서버 띄우기 (웹 서버 호스팅하기)  (0) 2021.10.06
    'Server' 카테고리의 다른 글
    • [spring-boot] application.properties-dev로 실행하기
    • [Spring-boot] @RequestBody, @ResponseBody : HTTP body에 데이터 송수신하기
    • [Spring] 스프링 빈, 의존성(DI) 주입
    • VSCode Javascript 개발 환경 (Prettier, ESLint, Typescript)
    J.Y.S
    J.Y.S

    티스토리툴바