import 'package:flutter/material.dart'; class MapModel extends InheritedModel { final Map data; const MapModel({ required this.data, required super.child, }); @override bool updateShouldNotify(MapModel oldWidget) => oldWidget.data != data; @override bool updateShouldNotifyDependent( MapModel oldWidget, Set dependencies, ) { for (final dependecy in dependencies) { if (oldWidget.data[dependecy] != data[dependecy]) { return true; } } return false; } }