diff --git a/ch08/ex8-6.md b/ch08/ex8-6.md index 0feb990..6d7d8db 100644 --- a/ch08/ex8-6.md +++ b/ch08/ex8-6.md @@ -9,9 +9,7 @@ void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); - - static const String _title = 'Example'; - + static const String _title = 'SizedBox Widget Demo'; @override Widget build(BuildContext context) { return const MaterialApp( @@ -23,7 +21,6 @@ class MyApp extends StatelessWidget { class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); - @override Widget build(BuildContext context) { return Scaffold( @@ -33,27 +30,31 @@ class MyStatelessWidget extends StatelessWidget { } Widget _buildSizedBoxWidget() { - return Column( - children: [ - Container( - width: 200, - height: 200, - color: Colors.red, - ), - const SizedBox( - width: 100, - height: 100, - ), - const SizedBox( - width: 400, - height: 300, - child: Card( - child: Center( - child: Text('Hello World'), - ) + return SingleChildScrollView( + padding: const EdgeInsets.all(10.0), + child: Column( + children: const [ + SizedBox( + width: 200, + height: 100, + child: Card( + color: Colors.amber, child: Center(child: Text('Developer'))), + ), + SizedBox( + width: 300, + height: 100, + child: Card( + color: Colors.green, + child: Center(child: Text('Flutter Framework'))), + ), + SizedBox( + width: 400, + height: 100, + child: Card( + color: Colors.blue, child: Center(child: Text('Dart SDK'))), ), - ), - ], + ], + ), ); } }