Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. void main() => runApp(MyApp());
  4.  
  5. class MyApp extends StatelessWidget {
  6. // This widget is the root of your application.
  7. @override
  8. Widget build(BuildContext context) {
  9. return MaterialApp(
  10. title: 'Flutter Demo',
  11. theme: ThemeData(
  12. primarySwatch: Colors.green,
  13. ),
  14. home: MyHomePage(title: 'Flutter Demo Home Page'),
  15. );
  16. }
  17. }
  18.  
  19. class MyHomePage extends StatefulWidget {
  20. MyHomePage({Key key, this.title}) : super(key: key);
  21.  
  22. final String title;
  23.  
  24. @override
  25. _MyHomePageState createState() => _MyHomePageState();
  26. }
  27.  
  28. class _MyHomePageState extends State<MyHomePage> {
  29. @override
  30. Widget build(BuildContext context) {
  31. return Scaffold(
  32. body: Column(
  33. children: [
  34. //Title
  35. SafeArea(
  36. child: Container(
  37. margin: const EdgeInsets.all(30),
  38. child: Row(
  39. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  40. children: [
  41. Text("Dashboard",
  42. style: TextStyle(
  43. fontSize: 30,
  44. fontWeight: FontWeight.bold
  45. ),
  46. ),
  47. InkWell(
  48. child: Text("Create New",
  49. style: TextStyle(
  50. color: Colors.blue,
  51. fontSize: 15
  52. ),
  53. ),
  54. onLongPress: () {
  55. Scaffold.of(context).showSnackBar(
  56. SnackBar(
  57. content: Text('Have a snack!'),
  58. ),
  59. );
  60. }
  61. ),
  62. ],
  63. ),
  64. )
  65. )
  66. ]
  67. )
  68. );
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement