Chapter 3, Starter project , App Bar Title not centered

2nd Ed, Chapter 3, After opening the starter project and running it I noticed that the AppBar title text was left aligned, not centered as it is shown in the materials. I added the property centerTitle: true. to the AppBar Widget as shown and it is centered now.

 return MaterialApp(
      // TODO: Add theme
      title: 'Fooderlich',
      // 4
      home: Scaffold(
        // TODO: Style the title
        appBar: AppBar(
          title: const Text('Fooderlich'),
          centerTitle: true,
        ),

Hi @naplesdave are you using iOS or Android? It’s common for Android apps to align their title to the left of the AppBar

1 Like

I am using a Pixel 4 emulator in the Android Studio. I also have a iPhone 8 setup in MAC Simulator. But the left align thing is showing up on my ANDROID emulator. The centerTitle: true under the scoffold fixes it though.

@naplesdave ah yes, android by default will align it left, and iOS by default will align it to the center. It’s their design system.

i can get the starter file to run in chapter 3:
getting this error

Using hardware rendering with device sdk gphone x86. If you notice
graphics artifacts, consider enabling software rendering with
“–enable-software-rendering”.
Launching lib/main.dart on sdk gphone x86 in debug mode…

FAILURE: Build failed with an exception.

  • Where:
    Script ‘/home/ara/snap/flutter/common/flutter/packages/flutter_tools/gradle/flutter.gradle’ line: 386

  • What went wrong:
    A problem occurred configuring project ‘:path_provider’.

Failed to notify project evaluation listener.
FlutterPlugin$_configurePluginProject_closure13$_closure38

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 27s

Hi @arababs2015 were you able to get it to work? Could you try:

flutter run --verbose

And send the output, so we can better look at what the issue is?