import 'package:flutter/material.dart';

import '../objects/create_material_color.dart';
import '../widgets/sidebar.dart';

class MainScreen extends StatelessWidget {
  const MainScreen({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    const String appName = "Provisioning for IOT";

    return MaterialApp(
      title: appName,
      theme: ThemeData(
        primarySwatch: CustomColor.createMaterialColor(const Color(0xff263f8c)),
        brightness: Brightness.light,
      ),
      home: const HomeScreen(title: appName),
      //debugShowCheckedModeBanner: false,
    );
  }
}

class HomeScreen extends StatefulWidget {
  final String title;

  const HomeScreen({super.key, required this.title});

  @override
  State<HomeScreen> createState() => _HomeScreen();
}

class _HomeScreen extends State<HomeScreen> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              "Die HFU präsentiert:",
            ),
            Text(
              "Cloud Provisioning for IOT Devices",
              textAlign: TextAlign.center,
              style: Theme.of(context).textTheme.headlineMedium,
            ),
            const SizedBox(
              width: 10.0,
              height: 50.0,
            ),
            const Image(image: AssetImage('assets/device/PFC200.jpg')),
          ],
        ),
      ),
      drawer: const Sidebar(), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
