-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwidget.dart
86 lines (80 loc) · 1.94 KB
/
widget.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import 'package:flutter/material.dart';
void main(){
runApp(MaterialApp(
title: "Futter utilties",
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.teal,
brightness: Brightness.light,
accentColor: Colors.yellow,
),
home: HomePage(),
));
}
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Flutter_Util",
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight: FontWeight.w800,
),
),
centerTitle: true,
),
body: MyBody(),
);
}
}
class MyBody extends StatelessWidget {
AlertDialog dialog = AlertDialog(
content: Text("Dialogue is up",
style: TextStyle(
fontSize: 20.0,
color: Colors.deepOrangeAccent,
fontWeight: FontWeight.w900,
),
),
title: Center(child: Text("Hello there!!!",
style: TextStyle(
color: Colors.lime,
fontWeight: FontWeight.w700,
fontSize: 18.0,
),
)),
);
@override
Widget build(BuildContext context) {
return Container(
child: Center(
child: RaisedButton(
child: Text("Click me",
style: TextStyle(
fontSize: 15.0,
color: Colors.white,
fontWeight: FontWeight.w900
),
),
color: Colors.indigo,
// onPressed: ()=> Scaffold.of(context).showSnackBar(
// new SnackBar(
// content: Text("You clicked me"),
// duration: Duration(milliseconds: 378),
//
// )),
onPressed: () => showDialog(
context: context,
child: dialog,
),
),
),
);
}
}