Advertisement
yudiwbs

scrollview

Mar 20th, 2024
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.08 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. void main() {
  4.   runApp(const MyApp());
  5. }
  6.  
  7. class MyApp extends StatelessWidget {
  8.   const MyApp({super.key});
  9.  
  10.   @override
  11.   Widget build(BuildContext context) {
  12.     return const MaterialApp(
  13.       title: 'SingleChildScrollView',
  14.       home: MyHomePage(),
  15.     );
  16.   }
  17. }
  18.  
  19. class MyHomePage extends StatelessWidget {
  20.   const MyHomePage({super.key});
  21.  
  22.   @override
  23.   Widget build(BuildContext context) {
  24.     return Scaffold(
  25.       appBar: AppBar(
  26.         title: const Text('SingleChildScrollView'),
  27.       ),
  28.       body: SingleChildScrollView(
  29.         child: Column(
  30.           children: [
  31.             Container(
  32.               height: 500.0,
  33.               color: Colors.blue,
  34.               child: const Center(
  35.                 child: Text('Item 1'),
  36.               ),
  37.             ),
  38.             Container(
  39.               height: 500.0,
  40.               color: Colors.green,
  41.               child: const Center(
  42.                 child: Text('Item 2'),
  43.               ),
  44.             ),
  45.           ],
  46.         ),
  47.       ),
  48.     );
  49.   }
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement