Skip to content

Commit

Permalink
Merge pull request #61 from rosera/tastethedream-patch-59
Browse files Browse the repository at this point in the history
Update ex11-5.md
  • Loading branch information
rosera authored Dec 17, 2022
2 parents 436a14f + 8f024da commit 8285f78
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions ch11/ex11-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,42 @@
# Example

```dart
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
const paramTitle = 'My Title';
const paramName = 'My Name';
return MaterialApp(
title: paramTitle,
home: Scaffold(
appBar: AppBar(
title: const Text(paramTitle),
),
body: const MyTextWidget(name: paramName, title: paramTitle),
),
);
}
}
class MyTextWidget extends StatelessWidget {
final String title;
final String name;
const MyTextWidget({Key? key, required this.title, required this.name})
: super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: Text("$title $name"),
);
}
}
```

0 comments on commit 8285f78

Please sign in to comment.