// import 'package:flutter/material.dart';
// import 'package:initial_folder/providers/firebase_authentication_provider.dart';
// import 'package:initial_folder/providers/incomplete_profile_provider.dart';
// import 'package:initial_folder/providers/login_provider.dart';
// import 'package:initial_folder/screens/home/home_screen.dart';
// import 'package:initial_folder/screens/login/components/get_user_data.dart';
// import 'package:initial_folder/screens/login/login_with_email/login_email_screen.dart';
// import 'package:initial_folder/screens/profile/account_sign_in/incomplete_profile_screen.dart';
// import 'package:initial_folder/screens/splash/splash_screen_login.dart';
// import 'package:provider/provider.dart';

// import '../../../size_config.dart';
// import '../../../theme.dart';

// class RegistrationFacebook {
//   Future handleRegistrationFacebook(BuildContext context) async {
//     final provider =
//         Provider.of<FirebaseAuthenticationProvider>(context, listen: false);
//     if (await provider.facebookLogin()) {
//       await getUserData(context);

//       Condition.loginFirebase = true;

//       IncompleteProfileProvider userInfoIncomplete =
//           Provider.of<IncompleteProfileProvider>(context, listen: false);
//       await userInfoIncomplete.getUserInfoIncomplete();
//       if (userInfoIncomplete.isUserInfoComplete == null) {
//         Navigator.of(context).pushNamedAndRemoveUntil(
//             LoginEmail.routeName, (Route<dynamic> route) => false);
//         return;
//       }

//       if (userInfoIncomplete.isUserInfoComplete!) {
//         Navigator.of(context).pushNamedAndRemoveUntil(
//             HomeScreen.routeName, (Route<dynamic> route) => false);
//       } else {
//         Navigator.of(context).pushNamedAndRemoveUntil(
//             IncompleteProfile.routeName, (Route<dynamic> route) => false);
//       }
//     } else {
//       showDialog(
//         context: context,
//         builder: (context) => AlertDialog(
//           insetPadding: EdgeInsets.symmetric(horizontal: 25, vertical: 20),
//           content: Container(
//             alignment: AlignmentDirectional.bottomCenter,
//             height: 50,
//             child: Text(
//               'Ada kendala dalam login, coba lagi atau periksa akun anda',
//               style: primaryTextStyle.copyWith(
//                   fontSize: getProportionateScreenWidth(12), letterSpacing: 1),
//             ),
//           ),
//           actions: [
//             Container(
//               height: 30,
//               alignment: AlignmentDirectional.topEnd,
//               child: GestureDetector(
//                 onTap: () {
//                   Navigator.of(context).pop();
//                 },
//                 child: Text('Tutup',
//                     style: primaryTextStyle.copyWith(
//                         fontSize: getProportionateScreenWidth(12),
//                         letterSpacing: 1,
//                         color: primaryColor)),
//               ),
//             ),
//           ],
//         ),
//       );
//     }
//     Provider.of<LoginProvider>(context, listen: false)
//         .loadFacebookActive(false);
//   }
// }
