Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() {
- runApp(const MyApp());
- }
- class MyApp extends StatelessWidget {
- const MyApp({super.key});
- @override
- Widget build(BuildContext context) {
- return const MaterialApp(
- title: 'SingleChildScrollView',
- home: MyHomePage(),
- );
- }
- }
- class MyHomePage extends StatelessWidget {
- const MyHomePage({super.key});
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: const Text('SingleChildScrollView'),
- ),
- body: SingleChildScrollView(
- child: Column(
- children: [
- Container(
- height: 500.0,
- color: Colors.blue,
- child: const Center(
- child: Text('Item 1'),
- ),
- ),
- Container(
- height: 500.0,
- color: Colors.green,
- child: const Center(
- child: Text('Item 2'),
- ),
- ),
- ],
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement