Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ex8-6.md #46

Merged
merged 1 commit into from
Dec 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 25 additions & 24 deletions ch08/ex8-6.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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'))),
),
),
],
],
),
);
}
}
Expand Down