Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3.  
  4.  
  5. void main() => runApp(App());
  6.  
  7.  
  8.  
  9. class App extends StatelessWidget {
  10. // This widget is the root of your application.
  11. @override
  12. Widget build(BuildContext context) {
  13. return MaterialApp(
  14. title: 'Flutter Demo',
  15. theme: ThemeData(
  16. // This is the theme of your application.
  17. //
  18. // Try running your application with "flutter run". You'll see the
  19. // application has a blue toolbar. Then, without quitting the app, try
  20. // changing the primarySwatch below to Colors.green and then invoke
  21. // "hot reload" (press "r" in the console where you ran "flutter run",
  22. // or simply save your changes to "hot reload" in a Flutter IDE).
  23. // Notice that the counter didn't reset back to zero; the application
  24. // is not restarted,
  25. ),
  26. home: HomePage(title: 'Wo ist mein Lehrer?'),
  27. );
  28. }
  29. }
  30.  
  31. class HomePage extends StatefulWidget {
  32. HomePage({Key key, this.title}) : super(key: key);
  33.  
  34. final String title;
  35.  
  36. @override
  37. _HomePageState createState() => _HomePageState();
  38. }
  39.  
  40. class _HomePageState extends State<HomePage> {
  41.  
  42. @override
  43. Widget build(BuildContext context) {
  44.  
  45. return new MaterialApp(
  46. home: new Scaffold(
  47. backgroundColor: Colors.white,
  48. body: new Column(
  49. children: [
  50. new Flexible(
  51. child: new SizedBox(
  52. height: 175,
  53. child: new Container(
  54. child: new SizedBox(
  55. width: MediaQuery.of(context).size.width,
  56. child : Center(child: Text('Wo ist mein Lehrer?', style: TextStyle(fontSize: 30.0))),
  57. ),
  58. decoration: new BoxDecoration(
  59. color: Colors.red,
  60. borderRadius: new BorderRadius.only(
  61. bottomLeft: const Radius.circular(20.0),
  62. bottomRight: const Radius.circular(20.0))),
  63. ),
  64. ),
  65. ),
  66. new SizedBox(height: 25),
  67. new Column(
  68.  
  69. children: [
  70. new Container(
  71. child: Center(child: Text('LoJ entfällt: 1. - 12.')),
  72. width: MediaQuery.of(context).size.width,
  73. height: 75,
  74. decoration: BoxDecoration(color: Colors.grey[600],borderRadius: BorderRadius.only(topLeft: const Radius.circular(15.0), topRight: const Radius.circular(15.0), bottomLeft: const Radius.circular(15.0), bottomRight: const Radius.circular(15.0))),
  75. ),
  76. ]
  77. ),
  78. ]
  79. ),
  80. bottomNavigationBar: new BottomAppBar(
  81. color: Colors.grey[600],
  82. shape: const CircularNotchedRectangle(),
  83. child: Container(height: 50.0),
  84. ),
  85. floatingActionButton: FloatingActionButton(
  86. child: Icon(Icons.assignment_ind),
  87. backgroundColor: Colors. red,
  88. onPressed: () => {
  89. Navigator.push(context, MaterialPageRoute(builder: (context) => ProfileInfo()),),
  90. }
  91. ),
  92. floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
  93. ),
  94. );
  95. }
  96. }
  97.  
  98. class ProfileInfo extends StatelessWidget {
  99.  
  100. @override
  101. Widget build(BuildContext context) {
  102. return new Scaffold(
  103. body: new Container(
  104. color: Colors.black,
  105. width: MediaQuery.of(context).size.width,
  106. height: MediaQuery.of(context).size.height-200,
  107. ),
  108. );
  109. }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement