Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Sign in
G
gmalpha_flutter
  • Project
    • Project
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • mobile
  • gmalpha_flutter
  • Repository

Switch branch/tag
  • gmalpha_flutter
  • lib
  • commonModel
  • live
  • LiveData.dart
Find file
BlameHistoryPermalink
  • 林生雨's avatar
    commit · 496de6de
    林生雨 authored 5 years ago
    496de6de
LiveData.dart 402 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
/*
 * @author lsy
 * @date   2019-09-05
 **/
import 'dart:async';

class LiveData<T> {
  StreamController<T> _controller;
  T data;

  LiveData() {
    this._controller = new StreamController<T>();
  }

  get stream => _controller.stream;

  get controller => _controller;

  void notifyView(T t) {
    this.data = t;
    _controller.sink.add(t);
  }

  void dispost() {
    _controller.close();
  }
}

Replace LiveData.dart

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.