From 170a3e008c55ec05ec637dd900ecf5853fb74d30 Mon Sep 17 00:00:00 2001 From: Denis Knecht Date: Sat, 1 Apr 2023 10:26:24 +0200 Subject: [PATCH] app title --- lib/main.dart | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 74a1114..bffe654 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -35,6 +35,7 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State { late CounterBloc _counterBloc; + String? appTitle; @override void initState() { @@ -48,19 +49,27 @@ class _MyHomePageState extends State { 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: [ - 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; + }); + }, + ) ], ), ),