import 'package:halkyon_learn_flutter/src/core/video/youtube_videos.dart'; import 'package:material_ui/material_ui.dart'; /// [YoutubeVideos] that plays nothing: its player is a text naming the video, /// and it notes the videos it was asked to open. class FakeYoutubeVideos({bool playInApp = false}) implements YoutubeVideos { @override final bool playInApp = playInApp; /// The videos opened outside the app, in order. final opened = []; /// The videos whose player was built, in order. final played = []; @override Widget player(YoutubeVideo video) { played.add(video); return Text('Playing ${video.id} from ${video.start}'); } @override Future open(YoutubeVideo video) async { opened.add(video); return true; } }