This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MaterialApp( | |
title: 'YouTube Clone', | |
debugShowCheckedModeBanner: false, | |
home: HomeScreen(), | |
)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
class DataCreator { | |
final _controller = StreamController<String>(); | |
int _count = 1; | |
DataCreator() { | |
Timer.periodic(Duration(seconds: 1), (callBack) { | |
_controller.sink.add('String $_count'); | |
_count++; | |
}); |