Search
 
SCRIPT & CODE EXAMPLE
 

DART

flutter How to dispose subscription

class EventNotifier extends ValueNotifier<List<String>> {
  // Omitted

  @override
  void dispose() {
    streamSub.cancel();
    super.dispose();
  }
}
Comment

dispose in dart

Dart does not have destructors. 
Objects are automatically garbage collected when no longer referenced

In flutter we can do like for widget dispose:

@override
void dispose() {
	// your dispose part
	super.dispose();
}
Comment

PREVIOUS NEXT
Code Example
Dart :: flutter add height to appbar 
Dart :: double to animation in flutter 
Dart :: How to Style DropdownButton in Flutter 
Dart :: dart pow 
Dart :: Counting no of word in javascript string 
Dart :: dart list sort by value with custom class 
Dart :: dart extension 
Dart :: dart convert iterable to list 
Dart :: flutter remove dropdown shadow appbar 
Dart :: flutter get initials from name 
Dart :: flutter concat lists 
Dart :: dart round 
Dart :: Failed to load network image fliutter 
Dart :: list in dart 
Dart :: popup keyboard automatically in flutter 
Dart :: flutter icon color 
Dart :: flutter remove object from list 
Dart :: dart check type of variable 
Dart :: what is interface in dart 
Dart :: dart regex,regex dart 
Dart :: flutter portrate only 
Dart :: flutter Explain Hot Reload in 
Dart :: change color icon tabbar flutter 
Dart :: flutter get language code 
Dart :: flutter mouse paralax 
Dart :: dart svg drawer 
Dart :: tabbar flutter change background color 
Dart :: Flutter: How to point to localhost:8000 with the Dart http package in Flutter? 
Dart :: icons flutter to put a right 
Dart :: flutter container rounded corners 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =