import 'package:flutter/material.dart';
class WidgetExplanationScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Widget Explanation Screen'),
),
body: Padding(
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Why everything in Flutter is a widget:', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
SizedBox(height: 12),
Text('• Widgets build UI elements.'),
Text('• They are reusable blocks.'),
Text('• Everything is a widget: text, buttons, layout, even padding.'),
],
),
),
bottomNavigationBar: Padding(
padding: EdgeInsets.all(16),
child: ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text('OK'),
),
),
);
}
}
This screen uses a Scaffold with an AppBar for the title. The main content is a Column inside Padding to show bullet points explaining why Flutter uses widgets everywhere. The bullet points are simple Text widgets. At the bottom, an ElevatedButton labeled 'OK' closes the screen using Navigator.pop(). This shows how Flutter treats everything as widgets, even text and buttons, making UI building consistent and flexible.