preloader
軟體工程 Pass arguments between Flutter app screens by Navigator.pushName()

Suppose your app, which built by flutter 1.2, has ItemListScreen and ItemDetailScreen, and this app uses named route to manage routing of app. Users can click one of item in ItemListScreen and then ItemDetailScreen will show detail information of the clicked item. You can find following example to decouple between screens by no need importing ItemDetailScreen class to ItemListScreen file. Solution: Use ModalRoute.of(context).settings.arguments in your routes.dart file to pass arguments

read more

About

Howard Lee is a Staff Software Engineer based in Taipei, specializing in frontend architecture, CI/CD, and production-quality engineering for enterprise web applications. With 13+ years of software development experience, Howard has worked across B2B SaaS, IoT energy-management platforms, online travel marketplaces, and Android applications. His work focuses on modernizing large frontend systems, improving delivery quality, and building reliable product workflows with automated testing, observability, and practical cloud/platform integration. Core Expertise Frontend architecture: Angular 5 to 19 modernization, TypeScript, JavaScript, React, Next.

Know More

Tag

Social