Complete the code to create a basic Flutter app with Material design.
void main() {
runApp([1](
home: Scaffold(
appBar: AppBar(title: Text('Home')),
body: Center(child: Text('Welcome')),
),
));
}The MaterialApp widget sets up the app with Material Design styling and navigation.
Complete the code to add a Scaffold with an app bar and a centered text.
MaterialApp( home: [1]( appBar: AppBar(title: Text('My App')), body: Center(child: Text('Hello World')), ), );
The Scaffold widget provides the basic visual layout structure for Material apps, including app bars and body content.
Fix the error in the code by completing the missing widget that provides the app's theme and navigation.
void main() {
runApp([1](
title: 'Demo',
home: Scaffold(
appBar: AppBar(title: Text('Demo')),
body: Center(child: Text('Content')),
),
));
}MaterialApp is needed to provide Material Design theme and navigation support.
Fill both blanks to create a Material app with a Scaffold that has an app bar and a floating action button.
MaterialApp( home: [1]( appBar: AppBar(title: Text('Demo')), body: Center(child: Text('Press the button')), floatingActionButton: [2]( onPressed: () {}, child: Icon(Icons.add), ), ), );
The Scaffold provides the app structure, and FloatingActionButton adds a button floating above the content.
Fill all three blanks to create a MaterialApp with a Scaffold that has an app bar title, a centered text, and a bottom navigation bar.
MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text([1])),
body: Center(child: Text([2])),
bottomNavigationBar: BottomNavigationBar(
items: [
BottomNavigationBarItem(icon: Icon(Icons.home), label: [3]),
BottomNavigationBarItem(icon: Icon(Icons.settings), label: 'Settings'),
],
),
),
);The app bar title is 'Home', the centered text is 'Welcome to the app!', and the bottom navigation label for home is 'Home'.