icemanbsi / searchable_dropdown

MIT License
107 stars 162 forks source link

Doesn't work with CupertinoApp #83

Closed palicka closed 4 years ago

palicka commented 4 years ago

I'm getting error when using CupertinoApp instead of MaterialApp. Is it possible to add support also for CupertinoApp?

error:

Unhandled Exception: No MaterialLocalizations found.
SearchableDropdown<String> widgets require MaterialLocalizations to be provided by a Localizations widget ancestor.
Localizations are used to generate many different messages, labels, and abbreviations which are used by the material library.
To introduce a MaterialLocalizations, either use a MaterialApp at the root of your application to include them automatically, or add a Localization widget with a MaterialLocalizations delegate.
The specific widget that could not find a MaterialLocalizations ancestor was:
  SearchableDropdown<String>
The ancestors of this widget were:
  Semantics
  DefaultTextStyle
  AnimatedDefaultTextStyle
  _InkFeatures-[GlobalKey#4ac5f ink renderer]
  NotificationListener<LayoutChangedNotification>
  CustomPaint
  _ShapeBorderPaint
  PhysicalShape
  _MaterialInterior
  Material
  Padding
  Container
  Semantics
  Card
  Column
  Graphs
  Builder
  _FocusMarker
  Semantics
  FocusScope
  _Eff<…>
palicka commented 4 years ago

nevermind, I fixed it this way:

    CupertinoApp(
...
      localizationsDelegates: [
        DefaultMaterialLocalizations.delegate,
        DefaultCupertinoLocalizations.delegate,
        DefaultWidgetsLocalizations.delegate,
      ],
...
    ),