فهرست منبع

Remove unnecessary subscription in gallery

Vishnu Mohandas 5 سال پیش
والد
کامیت
2dae6159b7
1فایلهای تغییر یافته به همراه0 افزوده شده و 17 حذف شده
  1. 0 17
      lib/ui/gallery.dart

+ 0 - 17
lib/ui/gallery.dart

@@ -1,11 +1,8 @@
-import 'dart:async';
 import 'dart:collection';
 import 'dart:collection';
 
 
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:flutter/services.dart';
-import 'package:photos/core/event_bus.dart';
-import 'package:photos/events/local_photos_updated_event.dart';
 import 'package:photos/models/photo.dart';
 import 'package:photos/models/photo.dart';
 import 'package:photos/ui/detail_page.dart';
 import 'package:photos/ui/detail_page.dart';
 import 'package:photos/ui/thumbnail_widget.dart';
 import 'package:photos/ui/thumbnail_widget.dart';
@@ -30,15 +27,6 @@ class _GalleryState extends State<Gallery> {
   final List<List<Photo>> _collatedPhotos = List<List<Photo>>();
   final List<List<Photo>> _collatedPhotos = List<List<Photo>>();
   Set<Photo> _selectedPhotos = HashSet<Photo>();
   Set<Photo> _selectedPhotos = HashSet<Photo>();
   List<Photo> _photos;
   List<Photo> _photos;
-  StreamSubscription<LocalPhotosUpdatedEvent> _subscription;
-
-  @override
-  void initState() {
-    _subscription = Bus.instance.on<LocalPhotosUpdatedEvent>().listen((event) {
-      setState(() {});
-    });
-    super.initState();
-  }
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
@@ -181,9 +169,4 @@ class _GalleryState extends State<Gallery> {
         firstDate.month == secondDate.month &&
         firstDate.month == secondDate.month &&
         firstDate.day == secondDate.day;
         firstDate.day == secondDate.day;
   }
   }
-
-  void dispose() {
-    _subscription.cancel();
-    super.dispose();
-  }
 }
 }