of static method

Resolves the effective theme for context.

Precedence, lowest to highest: the app-wide ThemeData.extension<ResizableSplitterThemeData>(), then every enclosing ResizableSplitterTheme from outermost to innermost. Because every field is nullable, a more specific scope only overrides the fields it actually sets; the rest fall through. Constructor parameters on the widget sit above all of these.

Implementation

static ResizableSplitterThemeData of(BuildContext context) {
  final inherited = context
      .dependOnInheritedWidgetOfExactType<_InheritedSplitterTheme>();
  final extension = Theme.of(context).extension<ResizableSplitterThemeData>();
  final base = extension ?? const ResizableSplitterThemeData();
  // The nearest scope already folded every ancestor scope into its data (see
  // [build]), so layering it over the app-wide extension yields the full
  // extension -> outer -> ... -> inner resolution.
  final local = inherited?.data;
  return local == null ? base : base.merge(local);
}