diff options
| author | Akshay Nair <phenax5@gmail.com> | 2020-06-02 19:03:52 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2020-06-02 19:03:52 +0530 |
| commit | fb1a274bc9b16650d6a85761ad236b90cdbfd41a (patch) | |
| tree | 3708c1971d99efedf697208a2665e128df12a4cd /lib/main.dart | |
| parent | 08c52d1b09eaf78a0fdba9d808ed1669430b34f6 (diff) | |
| download | daft-launcher-fb1a274bc9b16650d6a85761ad236b90cdbfd41a.tar.gz daft-launcher-fb1a274bc9b16650d6a85761ad236b90cdbfd41a.zip | |
Adds timer stream to home page
Diffstat (limited to 'lib/main.dart')
| -rw-r--r-- | lib/main.dart | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/main.dart b/lib/main.dart index 9397dc9..64db33a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'package:flutter/material.dart'; import 'pages/Home.dart'; @@ -8,17 +9,24 @@ void main() { } class MyApp extends StatelessWidget { + final Stream<DateTime> time$ = Stream.periodic(Duration(seconds: 1), (_x) => DateTime.now()).asBroadcastStream(); + + @override + void dispose() { + time$.drain(); + } + // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( - title: 'Flutter Demo', + title: 'owyn launcher', home: Scaffold( body: PageView( - controller: PageViewController(), + controller: PageController(), children: [ - HomeView(), - AppView(), + HomeView(time$: time$), + AppsView(), ], ), ), |
