import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:initial_folder/providers/page_provider.dart';
import 'package:initial_folder/providers/theme_provider.dart';
import 'package:initial_folder/screens/login/login_with_email/login_email_screen.dart';
import 'package:initial_folder/size_config.dart';
import 'package:initial_folder/theme.dart';
import 'package:initial_folder/screens/profile/components/about_profile_list.dart';
import 'package:initial_folder/widgets/login_regist/default_button.dart';
import 'package:initial_folder/widgets/terms_and_privacy.dart';
import 'package:provider/provider.dart';

class NotSignInScreen extends StatefulWidget {
  const NotSignInScreen({Key? key}) : super(key: key);

  @override
  State<NotSignInScreen> createState() => _NotSignInScreenState();
}

class _NotSignInScreenState extends State<NotSignInScreen> {
  final double maximumRadius = 1000;

  @override
  Widget build(BuildContext context) {
    PageProvider pageProvider =
        Provider.of<PageProvider>(context, listen: false);
    final themeProvider = Provider.of<ThemeProvider>(context);

    return SafeArea(
      child: Scaffold(
        backgroundColor: Colors.transparent,
        body: Container(
          margin: EdgeInsets.all(getProportionateScreenWidth(16)),
          child: Stack(
            children: [
              Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Text(
                        'Akun',
                        style: secondaryTextStyle.copyWith(
                            fontWeight: semiBold,
                            letterSpacing: 2.3,
                            fontSize: getProportionateScreenWidth(16)),
                      ),
                      IconButton(
                        icon: SvgPicture.asset(
                          themeProvider.themeData == ThemeClass.darkmode
                              ? 'assets/icons/moon.svg'
                              : 'assets/icons/sun.svg',
                        ),
                        onPressed: () {
                          setState(() {
                            themeProvider.toggleTheme();
                          });
                        },
                      ),
                    ],
                  ),
                  SizedBox(height: getProportionateScreenHeight(15)),
                  AboutAccountList(
                      onPress: () {
                        Navigator.push(
                          context,
                          MaterialPageRoute(
                            builder: (context) => TermsAndCondition(
                                url:
                                    'https://vocasia-v4-develop.vercel.app/about-us',
                                id: 'about'),
                          ),
                        );
                      },
                      title: 'Tentang Vocasia'),
                  AboutAccountList(
                      onPress: () {
                        Navigator.push(
                          context,
                          MaterialPageRoute(
                            builder: (context) => TermsAndCondition(
                                url:
                                    'https://vocasia-v4-develop.vercel.app/syarat-ketentuan',
                                id: 'sk'),
                          ),
                        );
                      },
                      title: 'Syarat dan Ketentuan'),
                  AboutAccountList(
                      onPress: () {
                        Navigator.push(
                          context,
                          MaterialPageRoute(
                            builder: (context) => TermsAndCondition(
                                url:
                                    'https://vocasia-v4-develop.vercel.app/privacy-policy',
                                id: 'prv'),
                          ),
                        );
                      },
                      title: 'Kebijakan Privasi'),
                  AboutAccountList(
                      onPress: () {
                        Navigator.push(
                          context,
                          MaterialPageRoute(
                            builder: (context) => TermsAndCondition(
                                url:
                                    'https://vocasia-v4-develop.vercel.app/contact',
                                id: 'ctc'),
                          ),
                        );
                      },
                      title: 'Kontak Kami'),
                  AboutAccountList(
                      onPress: () {
                        Navigator.push(
                          context,
                          MaterialPageRoute(
                            builder: (context) => TermsAndCondition(
                                url:
                                    'https://vocasia-v4-develop.vercel.app/help',
                                id: 'help'),
                          ),
                        );
                      },
                      title: 'Bantuan'),
                  SizedBox(height: getProportionateScreenHeight(15)),
                  Center(
                    child: DefaultButton(
                      text: 'Masuk',
                      press: () {
                        Navigator.of(context).pushNamedAndRemoveUntil(
                            LoginEmail.routeName,
                            (Route<dynamic> route) => false);
                        pageProvider.remove();
                      },
                    ),
                  )
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}
