I want to create an app bar.
I created an app bar and set the color
I can’t see the app bar
Did I set it up wrong? I wonder what the problem is.
This is my code. and simulator picture
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(primarySwatch: Colors.green),
debugShowCheckedModeBanner: false,
home: const RootPage(),
);
}
}
class RootPage extends StatefulWidget {
const RootPage({super.key});
@override
State<RootPage> createState() => _RootPageState();
}
class _RootPageState extends State<RootPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
);
}
}