Remove statefull. Disting view correct equal operators

This commit is contained in:
vjrj 2018-06-29 08:10:38 +02:00
parent 646eeb29ca
commit de340c0664
3 changed files with 22 additions and 55 deletions

View file

@ -43,39 +43,20 @@ class _ViewModel {
identical(this, other) ||
other is _ViewModel &&
runtimeType == other.runtimeType &&
mapState == other.mapState &&
onSubs == other.onSubs &&
onSubsConfirmed == other.onSubsConfirmed &&
onUnSubs == other.onUnSubs &&
onSlide == other.onSlide;
mapState == other.mapState;
@override
int get hashCode =>
mapState.hashCode ^
onSubs.hashCode ^
onSubsConfirmed.hashCode ^
onUnSubs.hashCode ^
onSlide.hashCode;
int get hashCode => mapState.hashCode;
}
class YourLocationMap extends StatefulWidget {
YourLocationMap();
@override
_YourLocationMapState createState() => _YourLocationMapState();
}
class _YourLocationMapState extends State<YourLocationMap> {
class YourLocationMap extends StatelessWidget {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
final FirebaseMessaging _firebaseMessaging = new FirebaseMessaging();
_YourLocationMapState();
@override
Widget build(BuildContext context) {
return new StoreConnector<AppState, _ViewModel>(
distinct: false, // FIXME
distinct: true,
converter: (store) {
return new _ViewModel(
onSubs: (loc) {