import 'package:flutter/material.dart';
import 'CheckRegistration.dart';
import 'Constants.dart';
import 'EmployeeReport.dart';

class UserRegistration extends StatefulWidget {
  final String message;
  const UserRegistration({super.key, required this.message});
  @override
  State<UserRegistration> createState() => _MyWidgetState();
}

class _MyWidgetState extends State<UserRegistration> {
  var storeName = '';
  @override
  void initState() {
    super.initState();
    storeName = widget.message;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text(
            'USER REGISTRATION',
            style: Constants.fontStyle,
          ),
          flexibleSpace: Container(
            decoration: BoxDecoration(
              gradient: Constants.getReturn(),
            ),
          ),
        ),
        body: Container(
            margin: const EdgeInsets.all(15.0),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.start,
              //mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Row(
                    //crossAxisAlignment: CrossAxisAlignment.start,
                    //mainAxisAlignment: MainAxisAlignment.spaceAround,
                    children: [
                      Expanded(
                        child: SizedBox(
                          width: MediaQuery.of(context).size.width * 0.44,
                          child: GestureDetector(
                            onTap: () {
                              Navigator.push(
                                context,
                                MaterialPageRoute(
                                    builder: (context) => CheckRegistration(
                                          message: storeName,
                                        )),
                              );
                            },
                            child: Container(
                              margin: const EdgeInsets.only(
                                  left: 0, top: 0, right: 0, bottom: 0),
                              width: MediaQuery.of(context).size.width * 0.43,
                              height: MediaQuery.of(context).size.width * 0.22,
                              padding: const EdgeInsets.all(5),
                              decoration: BoxDecoration(
                                gradient: const LinearGradient(
                                  begin: Alignment.bottomLeft,
                                  end: Alignment.bottomRight,
                                  colors: [
                                    Color(0xFFf3b87e),
                                    //Color(0xFFC2185B),
                                    Color(0xFFc89181),
                                  ],
                                ),
                                borderRadius: BorderRadius.circular(10),
                              ),
                              child: Row(
                                children: [
                                  Image.asset(
                                    'assets/images/Registration.png',
                                    width: 145,
                                    height: 160,
                                  ), // replace with your image
                                  // const SizedBox(
                                  //     width:
                                  //         5), // add some space between the image and the text
                                  // const Expanded(
                                  //   child: Text('Register',
                                  //       style: Constants.buttonsfontStyle,
                                  //       overflow: TextOverflow.ellipsis,
                                  //       textAlign: TextAlign.center),
                                  // ),
                                ],
                              ),
                            ),
                          ),
                        ),
                      ),
                      const VerticalDivider(width: 10.0),
                      Expanded(
                        child: Container(
                          margin: const EdgeInsets.only(
                              left: 0, top: 0, right: 0, bottom: 0),
                          width: MediaQuery.of(context).size.width * 0.44,
                          child: GestureDetector(
                            onTap: () {
                              Navigator.push(
                                context,
                                MaterialPageRoute(
                                    builder: (context) => EmployeeReport(
                                        message: storeName.toString())),
                              );
                            },
                            child: Container(
                              width: MediaQuery.of(context).size.width * 0.43,
                              height: MediaQuery.of(context).size.width * 0.22,
                              padding: const EdgeInsets.all(5),
                              decoration: BoxDecoration(
                                gradient: const LinearGradient(
                                  begin: Alignment.bottomLeft,
                                  end: Alignment.bottomRight,
                                  colors: [
                                    Color(0xFFfd5492),
                                    //Color(0xFFC2185B),
                                    Color(0xFFf86f64),
                                  ],
                                ),
                                borderRadius: BorderRadius.circular(10),
                              ),
                              child: Row(
                                children: [
                                  Image.asset(
                                    'assets/images/Report.png',
                                    height: 160,
                                    width: 145,
                                  ),
                                  // const SizedBox(width: 5),
                                  // const Expanded(
                                  //   child: Text('Report',
                                  //       overflow: TextOverflow.ellipsis,
                                  //       textAlign: TextAlign.center,
                                  //       style: Constants.buttonsfontStyle),
                                  // ),
                                ],
                              ),
                            ),
                          ),
                        ),
                      ),
                    ])
              ],
            )));
  }
}
