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

app title #9

Open
wants to merge 1 commit into
base: protected/start-3
Choose a base branch
from
Open
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
17 changes: 13 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class MyHomePage extends StatefulWidget {

class _MyHomePageState extends State<MyHomePage> {
late CounterBloc _counterBloc;
String? appTitle;

@override
void initState() {
Expand All @@ -48,19 +49,27 @@ class _MyHomePageState extends State<MyHomePage> {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
title: Text(appTitle ?? "Standard Title"),
),
body: BlocProvider(
create: (context) => _counterBloc,
child: const Center(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
HitCounter(),
Padding(
const HitCounter(),
const Padding(
padding: EdgeInsets.symmetric(vertical: 5),
child: ButtonSection(),
),
TextField(
decoration: const InputDecoration(labelText: "App Title"),
onChanged: (value) {
setState(() {
appTitle = value;
});
},
)
],
),
),
Expand Down