flutter_countdown_timer 4.1.0 flutter_countdown_timer: ^4.1.0 copied to clipboard
A flutter countdown timer. [10 days 5:30:46] ⬇⬇⬇⬇
import 'package:example/countdown_page.dart';
import 'package:example/countdown_timer_page.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
buildItem("countdown", CountdownPage()),
buildItem("countdown page", CountdownTimerPage()),
],
),
);
}
Widget buildItem(String title, Widget page) {
return GestureDetector(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(builder: (_) {
return page;
}));
},
child: Container(
margin: const EdgeInsets.all(5),
color: Colors.blue,
width: double.infinity,
alignment: Alignment.center,
height: 100,
child: Text(title, style: TextStyle(fontSize: 36),),
),
);
}
}