미해결
[2024 최신] [코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
한 페이지에서 벗어나지지 않습니다 ㅠ
그대로 따라 했는데, 이 페이지에서 벗어나 지지 않습니다. 어떻게 해야 벗어나 질까요?;코드 하단에 있습니다.import 'package:flutter/material.dart';import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({Key? key}) : super(key: key); @override State<HomeScreen> createState() => HomeScreenState(); } class HomeScreenState extends State<HomeScreen> {static final LatLng companyLatLng = LatLng( 37.4493182, 126.6601906, ); //위도 경도 지정하기 static final CameraPosition initialPosition = CameraPosition( target: companyLatLng, zoom: 15, ); static final Circle circle = Circle( circleId: CircleId('circle'), ); @override Widget build(BuildContext context) { return Scaffold( appBar: renderAppBar(), body: FutureBuilder( future: checkPermission(), builder: (BuildContext context, AsyncSnapshot snapshot){ if(snapshot.connectionState == ConnectionState.waiting){ return Center( child: CircularProgressIndicator(), ); } if(snapshot.data == '위치 권한이 허가되었습니다.'){ return Column( children: [ _CustomGoogleMap( initialPosition: initialPosition, ), _ChoolcheckButton(), ], ); } return Center( child: Text(snapshot.data), ); }, ),);} Future<String> checkPermission() async { final isLocationEnabled = await Geolocator.isLocationServiceEnabled(); if (!isLocationEnabled) { return '위치 서비스를 활성화 해주세요.';} LocationPermission checkPermission = await Geolocator.checkPermission();if (checkPermission == LocationPermission.denied) { checkPermission = await Geolocator.requestPermission(); if (checkPermission == LocationPermission.denied) { return '위치 권한을 허가해주세요.'; } } if (checkPermission == LocationPermission.deniedForever) { return '앱의 위치 권한을 세팅에서 허가해주세요.'; } return '앱의 위치 권한이 허가되었습니다.';} AppBar renderAppBar() { return AppBar(title: Center( child: Text( '오늘도 출근', style: TextStyle( color: Colors.blue,fontWeight: FontWeight.w700, ),),),backgroundColor: Colors.white, ); }} class _CustomGoogleMap extends StatelessWidget { final CameraPosition initialPosition; const _CustomGoogleMap({required this.initialPosition, Key? key }) : super(key: key); @override Widget build(BuildContext context) { return Expanded( flex: 2, child: GoogleMap( mapType: MapType.normal, initialCameraPosition: initialPosition, myLocationEnabled: true, myLocationButtonEnabled: false, ), ); } } class ChoolcheckButton extends StatelessWidget { const ChoolcheckButton({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Expanded( child: Text( '출근', ), );}}