リスト 4.54_cf


//flutter
import 'package:flutter/material.dart';

void main() {
  return runApp(TestPage());
}

//リスト4.54_cf
class TestPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'SingleChildScrollView',
      home: Scaffold(
        appBar: AppBar(title: Text('SingleChildScrollView')),
        body: SingleChildScrollView(
          child: Padding(
            padding: EdgeInsets.all(8),
            child: Text(makeText())
          )
        )
      )
    );
  }

  String makeText() {
    String text = '';
    for (int i = 0; i < 50; i++) {
      text += 'サンプルのテキスト $i\n';
    }
    return text;
  }
}