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'; | |
void main() => runApp(TapCounter()); | |
class TapCounter extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Tap Counter', | |
theme: ThemeData( |
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
class Home extends StatefulWidget { | |
Home({Key key, this.title}) : super(key: key); | |
final String title; | |
@override | |
_HomeState createState() => _HomeState(); | |
} | |
class _HomeState extends State<Home> { | |
int _counter = 0; |
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
return MaterialApp( | |
title: title, | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text(title), | |
), | |
body: ListView( | |
children: List.generate(images.length, (index) { | |
return Column( | |
children: <Widget>[ |
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
final ThemeData lightTheme = ThemeData( | |
brightness: Brightness.light, | |
accentColor: Colors.white, | |
primaryColor: Colors.blue, | |
iconTheme: IconThemeData(color: Colors.grey), | |
textTheme: | |
TextTheme(body1: TextStyle(color: Color.fromRGBO(32, 73, 105, 1)))); | |
final ThemeData darkTheme = ThemeData( | |
brightness: Brightness.dark, |
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
ThemeData currentTheme; | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: currentTheme, | |
... | |
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
class _HomePageState extends State<HomePage> { | |
VideoPlayerController _videoPlayerController; | |
Future<void> _initializeVideoPlayerFuture; | |
@override | |
void initState() { | |
_videoPlayerController = VideoPlayerController.network( | |
'https://github.com/slamdon/flutter-starter/raw/master/resources/sky.mp4'); | |
_videoPlayerController.setLooping(true); | |
_initializeVideoPlayerFuture = _videoPlayerController.initialize(); |
OlderNewer