Swipe to close 기능을 만들기 위해 Dismissible 위젯을 이용해 페이지를 구성했는데 이전 화면이 안나오는 것입니다.
Scaffold의 배경색을 투명으로 해도 그렇더군요. 찾아보니 MaterialPageRoute는 기본 불투명으로 되더군요.
그래서 MaterialPageRoute 클래스 소스를 가져와 opaque를 false로 변경 후 적용했습니다.
class TransparentMaterialPageRoute extends PageRoute {
TransparentMaterialPageRoute({
@required this.builder,
RouteSettings settings,
this.maintainState = true,
bool fullscreenDialog = false,
}) : assert(builder != null),
assert(maintainState != null),
assert(fullscreenDialog != null),
super(settings: settings, fullscreenDialog: fullscreenDialog) {
// ignore: prefer_asserts_in_initializer_lists , https://github.com/dart-lang/sdk/issues/31223
/// 기본 opaque가 true인 경우에만 실행되기 때문에 주석처리
// assert(opaque);
}
/// 생략 ...
@override
bool get opaque => false;
}
'개발 > Flutter' 카테고리의 다른 글
xcode 13.4.1에서 iOS 빌드시 버그 해결하기 (0) | 2022.09.07 |
---|---|
xcode 14 베타 사용시 Invalid Bundle로 배포 안되는 버그 수정 (0) | 2022.09.05 |
캐러셀 리스트뷰 만들기 (0) | 2018.12.21 |
링크 모음 (0) | 2018.11.25 |
키보드 show/hide 감지하기 (0) | 2018.11.25 |
상태바, 내비게이션 바 보이기/감추기 (0) | 2018.11.25 |