connectPinterest method

Future<bool> connectPinterest(
  1. BuildContext context
)

Connect to Pinterest using enhanced WebView

Implementation

Future<bool> connectPinterest(BuildContext context) async {
  try {
    final username = await getFromSecure('username') ?? '';
    debugPrint('📌 Connecting to Pinterest for user: $username');

    // Use the enhanced Pinterest connection screen
    final result = await showModalBottomSheet<bool>(
      context: context,
      isScrollControlled: true,
      backgroundColor: Colors.transparent,
      builder: (context) => FractionallySizedBox(
        heightFactor: 0.9,
        child: PinterestConnectionScreen(username: username),
      ),
    );

    return result ?? false;
  } catch (e) {
    debugPrint('❌ Error connecting to Pinterest: $e');
    return false;
  }
}