import 'package:drifter/pages/terms_of_service/terms_of_service_text.dart';
import 'package:drifter/theme/app_colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';

class TermsOfServiceScreen extends StatefulWidget {
  const TermsOfServiceScreen({super.key});

  @override
  State<TermsOfServiceScreen> createState() => _TermsOfServiceScreenState();
}

class _TermsOfServiceScreenState extends State<TermsOfServiceScreen> {
  bool isChecked = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: AppColors.mainBackground,
      body: Padding(
        padding: const EdgeInsets.only(top: 100, right: 16, left: 16),
        child: Center(
          child: Column(children: [
            Text(
              'Terms of service',
              style: TextStyle(
                  color: Color(0xFF302F38),
                  fontSize: 20,
                  fontWeight: FontWeight.w600),
            ),
            Padding(
              padding: const EdgeInsets.only(top: 20, bottom: 14),
              child: Container(
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(16),
                  color: Colors.white,
                ),
                height: 568,
                child: ListView(
                  padding: EdgeInsets.all(16),
                  children: [Text(TermsOfServiceText.termOfService)],
                ),
              ),
            ),
            Row(
              children: [
                Checkbox(
                  checkColor: Colors.white,
                  value: isChecked,
                  onChanged: (bool? value) {
                    setState(() {
                      isChecked = value!;
                    });
                  },
                ),
                const Text(
                    'I agree to the Terms of Service and Privacy Policy'),
              ],
            ),
            SizedBox(
              width: double.infinity,
              height: 56,
              child: ElevatedButton(
                onPressed: () {
                  // Navigator.pushNamed(context, '/terms');
                },
                child: Text(
                  'Login',
                  style: TextStyle(fontSize: 16),
                ),
                style: ButtonStyle(
                  shape: MaterialStatePropertyAll(RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(100))),
                  backgroundColor: const MaterialStatePropertyAll(
                      AppColors.buttonPrimaryDefaultBg),
                ),
              ),
            ),
          ]),
        ),
      ),
    );
  }
}
