0

我开发了一个具有自己的本地化和主题的颤振包,因此我在包中使用了 MaterialApp 小部件。

return MaterialApp(
  key: Key('key_root_widget'),
  debugShowCheckedModeBanner: false,
  theme: ChatController.chatConfig.themeData,
  locale: ChatController.chatConfig.locale,
  routes: Routes.routes,
  supportedLocales: [
    Locale('en', 'US'),
    Locale('es', 'ES'),
    Locale('da', 'DK'),
  ],
  localizationsDelegates: [
    // A class which loads the translations from JSON files
    AppLocalizations.delegate,
    // Built-in localization of basic text for Material widgets
    GlobalMaterialLocalizations.delegate,
    // Built-in localization for text direction LTR/RTL
    GlobalWidgetsLocalizations.delegate,
    // Built-in localization of basic text for Cupertino widgets
    GlobalCupertinoLocalizations.delegate,
  ],
  // Returns a locale which will be used by the app
  localeResolutionCallback: (locale, supportedLocales) {
    // Check if the current device locale is supported
    for (var supportedLocale in supportedLocales) {
      if (supportedLocale.languageCode == locale.languageCode) {
        return supportedLocale;
      }
    }
    // If the locale of the device is not supported, use the first one
    // from the list (English, in this case).
    return supportedLocales.first;
  },
  home: Scaffold(
    appBar: AppBar(title: Text('Flutter Package'),),
    body: Material(
      child: FutureBuilder(
        future: widget.controller.init(),
        builder: (BuildContext context, AsyncSnapshot snapshot) {
          if (snapshot.connectionState == ConnectionState.done) {
            if (_chatStore.navigateToChatRoom) _navigateToChatRoom();
            return _buildBody();
          } else {
            return CustomProgressIndicatorWidget();
          }
        },
      ),
    ),
  ),
);

我想删除项目的应用栏,只想使用包应用栏,但不幸的是我无法做到这一点。需要帮助 :)

截屏

4

1 回答 1

0

只需从您的代码中删除该行,

appBar: AppBar(title: Text('Flutter Package'),),
于 2019-12-12T07:04:46.263 回答