Skip to content

Instantly share code, notes, and snippets.

@felangel felangel/main.dart
Created May 28, 2019

What would you like to do?
[flutter_timer] MyApp
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());
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(),
void dispose() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.