import 'package:flutter/material.dart';
import 'package:rkm/widgets/alert_dialog_settings.dart';
import '../screens/login/login_saved_screen.dart';
import '../config/color_palette.dart';
import 'icon_button_default.dart';

class AppBarDefault{

  @override
  PreferredSize appbar(BuildContext context,String title) {
    return PreferredSize(
        preferredSize: Size.fromHeight(50),
        child: AppBar(
        title: Text(title),
        centerTitle: true,
        actions: [
          IconButtonDefault(
              icon: Icons.settings,
              color: ColorPalette.white,
              onPressed: ()=>AlertDialogSettings().alert(context)
          ),
          IconButtonDefault(
            icon: Icons.logout,
            color: ColorPalette.white,
            onPressed: (){
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => LoginSavedScreen(listControl: [])),
              );
            }),
        ],
      ),
    );
  }
}
