Instantly share code, notes, and snippets.

@MarcinusX MarcinusX/main.dart Secret
Created Jan 13, 2019

Embed
What would you like to do?
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Piano Tiles 2 clone',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MainPage(),
);
}
}
class MainPage extends StatefulWidget {
@override
_MainPageState createState() => _MainPageState();
}
class _MainPageState extends State<MainPage> {
@override
Widget build(BuildContext context) {
return Material(
child: Stack(
fit: StackFit.passthrough,
children: <Widget>[
Image.asset(
'assets/background.jpg',
fit: BoxFit.cover,
),
Row(
children: <Widget>[
Expanded(child: Container()),
LineDivider(),
Expanded(child: Container()),
LineDivider(),
Expanded(child: Container()),
LineDivider(),
Expanded(child: Container()),
],
)
],
),
);
}
}
class LineDivider extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: double.infinity,
width: 1,
color: Colors.white,
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment