import 'package:flutter/material.dart';
import 'package:rkm/widgets/text_default.dart';
import '../screens/registers_citizen/register_citizen_screen.dart';
import '../screens/registers_citizen/register_home_screen.dart';
import '../screens/registers_citizen/register_individual_screen.dart';
import '../config/color_palette.dart';

class SubtitleAppbarCitizen extends StatelessWidget {
  int title;
  bool edit;

  SubtitleAppbarCitizen({
    required this.title,
    this.edit = false
  });

  @override
  Widget build(BuildContext context) {

    double heigth = MediaQuery.of(context).size.height;
    double width = MediaQuery.of(context).size.width;

    return Container(
      color: ColorPalette.white,
      width: width,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          TextButton.icon(
              onPressed:edit? ()=> Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => RegisterCitizenScreen(listData: [],)),
              ):null,
              icon: Icon(Icons.person,color: title==1?Colors.black:ColorPalette.gray,),
              label: TextDefault(text: 'Cadastro Cidadão',fontSize: 14,color: title==1?Colors.black:ColorPalette.gray,)
          ),
          TextButton.icon(
              onPressed:edit? ()=> Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => RegisterIndividualScreen()),
              ):null,
              icon: Icon(Icons.assignment_outlined,color: title==2?Colors.black:ColorPalette.gray,),
              label: TextDefault(text: 'Cadastro Individual',fontSize: 14,color: title==2?Colors.black:ColorPalette.gray,)
          ),
          TextButton.icon(
              onPressed:edit? ()=> Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => RegisterHomeScreen()),
              ):null,
              icon: Icon(Icons.home,color: title==3?Colors.black:ColorPalette.gray,),
              label: TextDefault(text: 'Cadastro Domiciliar',fontSize: 14,color: title==3?Colors.black:ColorPalette.gray,)
          ),
        ],
      ),
    );
  }
}
