mirrored_repositories/mad_fall_2023/mad_week5_widgets_project/lib/screens
import 'package:flutter/material.dart';
import 'package:mad_week5_widgets_project/data/stateless_widget_data.dart';

class StateLessWidgetDetailsScreen extends StatelessWidget {
  const StateLessWidgetDetailsScreen({super.key, required this.widgetData});

  final StateLessWidgetData widgetData;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widgetData.name),
      ),
      body: SingleChildScrollView(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Card(
              elevation: 4,
              color: Colors.blue, // Change the color as desired
              child: Padding(
                padding: const EdgeInsets.all(16.0),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    const Text(
                      'Description:',
                      style: TextStyle(
                        fontSize: 20,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    const SizedBox(height: 10),
                    Text(
                      widgetData.description,
                      style: const TextStyle(
                        fontSize: 18,
                        color: Colors.white, // Change the text color
                      ),
                    ),
                  ],
                ),
              ),
            ),
            const SizedBox(height: 20),
            Card(
              elevation: 4,
              color: Colors.green, // Change the color as desired
              child: Padding(
                padding: const EdgeInsets.all(16.0),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    const Text(
                      'Code:',
                      style: TextStyle(
                        fontSize: 20,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    const SizedBox(height: 10),
                    Text(
                      widgetData.code,
                      style: const TextStyle(
                        fontSize: 16,
                        color: Colors.white, // Change the text color
                      ),
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
