2025-12-30 15:02:51 +05:30

105 lines
3.7 KiB
Dart

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../../../core/constants/colors.dart';
import 'social_connect_details_screen.dart';
class SocialPlatform {
final String name;
final Color color;
final IconData icon;
final bool isConnected;
SocialPlatform({
required this.name,
required this.color,
required this.icon,
this.isConnected = false,
});
}
class ConnectScreen extends StatelessWidget {
const ConnectScreen({super.key});
@override
Widget build(BuildContext context) {
final List<SocialPlatform> platforms = [
SocialPlatform(name: "Facebook", color: const Color(0xFF1877F2), icon: Icons.facebook, isConnected: true),
SocialPlatform(name: "Instagram", color: const Color(0xFFE4405F), icon: Icons.camera_alt, isConnected: true),
SocialPlatform(name: "LinkedIn", color: const Color(0xFF0A66C2), icon: Icons.business),
SocialPlatform(name: "Twitter", color: const Color(0xFF1DA1F2), icon: Icons.alternate_email),
SocialPlatform(name: "Pinterest", color: const Color(0xFFBD081C), icon: Icons.pin_drop),
SocialPlatform(name: "TikTok", color: const Color(0xFF000000), icon: Icons.tiktok),
];
return Scaffold(
backgroundColor: AppColors.darkBg,
body: ListView.builder(
padding: const EdgeInsets.all(20),
itemCount: platforms.length,
itemBuilder: (context, index) {
final platform = platforms[index];
return GestureDetector(
onTap: () {
if (platform.name == "Facebook" || platform.name == "Instagram") {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SocialMediaConnectScreen()),
);
}
},
child: Container(
margin: const EdgeInsets.only(bottom: 15),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: AppColors.cardBg,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: Colors.white.withOpacity(0.05)),
),
child: Row(
children: [
Container(
width: 50,
height: 50,
decoration: BoxDecoration(
color: platform.color.withOpacity(0.1),
shape: BoxShape.circle,
),
child: Icon(platform.icon, color: platform.color, size: 28),
),
const SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
platform.name,
style: GoogleFonts.nunito(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
Text(
platform.isConnected ? "Connected" : "Not connected",
style: GoogleFonts.nunito(
fontSize: 12,
color: platform.isConnected ? AppColors.success : Colors.white38,
),
),
],
),
),
const Icon(Icons.arrow_forward_ios, color: Colors.white24, size: 16),
],
),
),
);
},
),
);
}
}