Created
May 28, 2019 02:57
-
-
Save felangel/4106b60224b6d8cab1c9f1be2762df14 to your computer and use it in GitHub Desktop.
[flutter_timer] MyApp
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'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
import 'package:flutter_timer/bloc/bloc.dart'; | |
import 'package:flutter_timer/ticker.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatefulWidget { | |
State<MyApp> createState() => _MyAppState(); | |
} | |
class _MyAppState extends State<MyApp> { | |
final TimerBloc _timerBloc = TimerBloc(ticker: Ticker()); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData( | |
primaryColor: Color.fromRGBO(109, 234, 255, 1), | |
accentColor: Color.fromRGBO(72, 74, 126, 1), | |
brightness: Brightness.dark, | |
), | |
title: 'Flutter Timer', | |
home: BlocProvider( | |
bloc: _timerBloc, | |
child: Timer(), | |
), | |
); | |
} | |
@override | |
void dispose() { | |
_timerBloc.dispose(); | |
super.dispose(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment