-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.dart
39 lines (34 loc) · 941 Bytes
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import 'package:flutter/material.dart';
import 'package:ghostleg/ghost_leg.dart';
import 'line_painter.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const MaterialApp(
//use MaterialApp() widget like this
home: Home() //create new widget class for this 'home' to
// escape 'No MediaQuery widget found' error
);
}
}
class Home extends StatelessWidget {
const Home({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return Container(
child: Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
height: MediaQuery.of(context).size.height * 0.8,
child: CustomPaint(
foregroundPainter: LinePainter(),
),
),
),
);
}
}