import 'package:flutter/material.dart';
import 'package:story/screens/libraryPage.dart';
import 'package:story/utils/titleUtils.dart';


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

  @override
  Widget build(BuildContext context) {
    return  Container(
      //color: Color.fromRGBO(86, 125, 106, 1),
      decoration: const BoxDecoration(gradient: 
        LinearGradient(
          begin: AlignmentDirectional.centerStart,
          end: AlignmentDirectional.centerEnd,
          colors: [
            Color.fromARGB(255, 50, 50, 50),
            Color.fromARGB(255, 50, 50, 50)
            //const Color.fromARGB(50, 86, 125, 106),
            //const Color.fromARGB(255, 86, 125, 106),
            //const Color.fromARGB(255, 86, 125, 106),
            //const Color.fromARGB(255, 64, 95, 80)
          ]
      )
      ),
      child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ClipRRect(
                borderRadius: BorderRadius.circular(10),
                child: Image.asset('assets/images/logo.jpg', width: 250)
                ),
              const SizedBox(height: 20),
              const TitleUtils(title: 'Histoire d\'un soir'),
              const SizedBox(height: 300),
              ElevatedButton(
                onPressed: () {
                  Navigator.pushReplacement(
                    context,
                    MaterialPageRoute(builder: (context) => LibraryPage()),
                  );
                },
                child: const Text('Mettre a jour'),
              ),
              const SizedBox(height: 20),

              ElevatedButton(
                onPressed: () {
                  Navigator.pushReplacement(
                    context,
                    MaterialPageRoute(builder: (context) => LibraryPage()),
                  );
                },
                child: const Text('Commencer la lecture'),
              ),
            ],
          ),
        ),
    );
  }
}