<% const themeClassName = file.prefix + 'Theme'; const themeDataClassName = themeClassName + 'Data'; const isEquatable = file.compareBy === 'equatable'; %> // // <%= file.destination %> // <%= fileHeader({file, commentStyle: 'short'}) %> import 'package:flutter/widgets.dart'; <% if(isEquatable) { %>import 'package:equatable/equatable.dart';<% } %> part 'data.g.dart'; class <%= themeClassName %> extends InheritedWidget { const <%= themeClassName %>({ Key? key, required this.data, required Widget child, }) : super(key: key, child: child,); final <%= themeDataClassName %> data; static <%= themeDataClassName %> of(BuildContext context) { return context.dependOnInheritedWidgetOfExactType<<%= themeClassName %>>()?.data ?? <%= themeDataClassName %>.regular(); } @override bool updateShouldNotify(covariant <%= themeClassName %> oldWidget) { return oldWidget.data != data; } }