conditional import1 [Flutter] Conditional import 하는 방법. Flutter 사용 시 dart.html 같은 Web 에서만 build 되는 것을 import 할 때 사용하는 방법이다. 간단한 예제로 아래와 같은 트리로 설명해보자면. lib / main.dart web.dart app.dart platform_screen.dart 1. platform_screen.dart 파일을 생성. export 'app.dart' if (dart.library.html) 'web.dart'; 2. app.dart 파일 생성. ( 파일은 app.dart 이고 class 명은 PlatfromWidget )class PlatformWidget extends StatelessWidget { const PlatformWidget({super.key}).. 2025. 1. 1. 이전 1 다음