Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 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. debugShowCheckedModeBanner: false,
  12. theme: ThemeData(
  13. primarySwatch: Colors.blue,
  14. ),
  15. home: MyHomePage(title: 'Flutter Demo Home Page'),
  16. );
  17. }
  18. }
  19.  
  20. class MyHomePage extends StatefulWidget {
  21. MyHomePage({Key key, this.title}) : super(key: key);
  22.  
  23. final String title;
  24.  
  25. @override
  26. _MyHomePageState createState() => _MyHomePageState();
  27. }
  28.  
  29. class _MyHomePageState extends State<MyHomePage> {
  30. @override
  31. Widget build(BuildContext context) {
  32. return Scaffold(
  33. appBar: AppBar(
  34. title: Text(widget.title),
  35. ),
  36.  
  37. body: ListView(
  38. children: <Widget>[
  39. Text("List Item"),
  40. Text("List Item"),
  41. GridView.count(
  42. shrinkWrap: true,
  43. primary: false,
  44. padding: const EdgeInsets.only(top: 5),
  45. crossAxisSpacing: 10.0,
  46. crossAxisCount: 2,
  47. children: List.generate(5, (i) {
  48. return Stack(
  49. overflow: Overflow.visible,
  50. fit: StackFit.expand,
  51. children: <Widget>[
  52. Container(
  53. color: Colors.yellow,
  54. child: Card(
  55. color: Colors.red,
  56. elevation: 5,
  57. child: Column(
  58. mainAxisSize: MainAxisSize.max,
  59. children: <Widget>[
  60. Text(
  61. "Some Text Here and here and here and here and more and more and more and more Some Text Here and here and here and here and more and more and more and more Some Text Here and here and here and here and more and more and more and more and more and more end ",
  62. style: TextStyle(fontSize: 14),
  63. overflow: TextOverflow.visible),
  64.  
  65. // ➜ This is the text.
  66.  
  67. SizedBox(
  68. height: 30,
  69. ),
  70. Text('End'),
  71. ],
  72. ),
  73. ),
  74. ),
  75. ],
  76. );
  77. }),
  78. ),
  79. Text("List Item"),
  80. Text("List Item"),
  81. Text("List Item"),
  82. Text("List Item"),
  83. Text("List Item"),
  84. Text("List Item"),
  85. Text("List Item"),
  86. Text("List Item"),
  87. ],
  88. ));
  89. }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement