最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

dart - Flutter web url startegy with onGenerateRoutes i.e. PageRoute is not working - Stack Overflow

programmeradmin1浏览0评论

I'm trying to get some paths for screens and followed the official document

But it requires routes setup instead of onGenerateRoute which is my current implementation?

return MaterialApp(
          title: Localized.brand,
          scrollBehavior: MaterialScrollBehavior().copyWith(
            dragDevices: {
              PointerDeviceKind.mouse,
              PointerDeviceKind.touch,
            },
          ),
          // routes: {}, << Url strategy expects this
          onGenerateRoute: AppRouter.setupRouting, // I'm using this
          theme: ThemeData(
            colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
            useMaterial3: true,
          ),
          home: const RootScreen(),
        )

Is there any way to achieve same with onGenerateRoute?

发布评论

评论列表(0)

  1. 暂无评论