Compare commits

...

1 Commits

Author SHA1 Message Date
Flatlogic Bot
18b6dbc27d V1 2025-10-26 23:03:53 +00:00
12 changed files with 790 additions and 145 deletions

16
api.php Normal file
View File

@ -0,0 +1,16 @@
<?php
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *'); // Allow all origins for now
require_once 'db/config.php';
try {
$pdo = db();
$stmt = $pdo->query('SELECT id, title, location, description, company, salary_range, created_at FROM jobs ORDER BY created_at DESC');
$jobs = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo json_encode(['success' => true, 'data' => $jobs]);
} catch (PDOException $e) {
http_response_code(500);
echo json_encode(['success' => false, 'error' => 'Database error: ' . $e->getMessage()]);
}
?>

74
assets/css/custom.css Normal file
View File

@ -0,0 +1,74 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
:root {
--primary: #3E66F8;
--secondary: #17A2B8;
--background: #F8F9FA;
--surface: #FFFFFF;
--text: #212529;
--radius: 0.5rem;
}
body {
font-family: 'Poppins', sans-serif;
background-color: var(--background);
color: var(--text);
}
.navbar {
background-color: var(--surface);
box-shadow: 0 2px 4px rgba(0,0,0,.05);
}
.hero {
background: linear-gradient(45deg, var(--primary), var(--secondary));
color: white;
padding: 4rem 1rem;
text-align: center;
}
.job-card {
background-color: var(--surface);
border: none;
border-radius: var(--radius);
box-shadow: 0 4px 12px rgba(0,0,0,.08);
transition: all 0.3s ease;
}
.job-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.job-card .card-title {
color: var(--primary);
}
.job-card .badge {
background-color: rgba(62, 102, 248, 0.1);
color: var(--primary);
font-weight: 600;
}
.btn-primary {
background-color: var(--primary);
border-color: var(--primary);
border-radius: var(--radius);
padding: 0.75rem 1.5rem;
font-weight: 600;
}
.btn-primary:hover {
opacity: 0.9;
}
.form-control-lg {
border-radius: var(--radius);
}
.footer {
background-color: var(--surface);
padding: 2rem 0;
margin-top: 4rem;
border-top: 1px solid #e9ecef;
}

1
assets/js/main.js Normal file
View File

@ -0,0 +1 @@
// Custom JavaScript will go here

View File

@ -0,0 +1,18 @@
CREATE TABLE IF NOT EXISTS jobs (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
company VARCHAR(255) NOT NULL,
location VARCHAR(255) NOT NULL,
description TEXT,
salary VARCHAR(100),
job_type VARCHAR(50),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Insert dummy data
INSERT INTO jobs (title, company, location, description, salary, job_type) VALUES
('Senior Frontend Developer', 'Innovate Inc.', 'San Francisco, CA', 'Join our team to build next-gen web applications with React and TypeScript.', '$120,000 - $150,000', 'Full-time'),
('UX/UI Designer', 'Creative Solutions', 'New York, NY', 'Design beautiful and intuitive interfaces for our mobile and web products.', '$90,000 - $110,000', 'Full-time'),
('Data Scientist', 'Analytics Co.', 'Remote', 'Analyze large datasets to extract meaningful insights and drive business decisions.', '$130,000 - $160,000', 'Remote'),
('Product Manager', 'AppMakers LLC', 'Austin, TX', 'Lead the product lifecycle from conception to launch for our flagship mobile app.', '$115,000 - $140,000', 'Full-time'),
('Backend Engineer (PHP)', 'Legacy Systems', 'Chicago, IL', 'Maintain and improve our existing PHP codebase, ensuring reliability and performance.', '$100,000 - $125,000', 'Contract');

28
db/setup.php Normal file
View File

@ -0,0 +1,28 @@
<?php
require_once __DIR__ . '/config.php';
function run_migrations() {
try {
$pdo = db();
$sql_file = __DIR__ . '/migrations/001_create_jobs_table.sql';
if (!file_exists($sql_file)) {
return ['success' => false, 'error' => 'Migration file not found.'];
}
$sql = file_get_contents($sql_file);
$pdo->exec($sql);
return ['success' => true, 'message' => 'Database setup and seeding completed successfully.'];
} catch (PDOException $e) {
return ['success' => false, 'error' => 'Database error: ' . $e->getMessage()];
}
}
// If this script is run directly from the command line, execute the migrations.
if (php_sapi_name() === 'cli') {
$result = run_migrations();
echo $result['message'] ?? $result['error'];
echo "\n";
}

254
index.php
View File

@ -1,150 +1,124 @@
<?php
declare(strict_types=1);
@ini_set('display_errors', '1');
@error_reporting(E_ALL);
@date_default_timezone_set('UTC');
$phpVersion = PHP_VERSION;
$now = date('Y-m-d H:i:s');
?>
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>New Style</title>
<?php
// Read project preview data from environment
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
?>
<?php if ($projectDescription): ?>
<!-- Meta description -->
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
<!-- Open Graph meta tags -->
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<!-- Twitter meta tags -->
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<?php endif; ?>
<?php if ($projectImageUrl): ?>
<!-- Open Graph image -->
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<!-- Twitter image -->
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<?php endif; ?>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<style>
:root {
--bg-color-start: #6a11cb;
--bg-color-end: #2575fc;
--text-color: #ffffff;
--card-bg-color: rgba(255, 255, 255, 0.01);
--card-border-color: rgba(255, 255, 255, 0.1);
}
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
text-align: center;
overflow: hidden;
position: relative;
}
body::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
animation: bg-pan 20s linear infinite;
z-index: -1;
}
@keyframes bg-pan {
0% { background-position: 0% 0%; }
100% { background-position: 100% 100%; }
}
main {
padding: 2rem;
}
.card {
background: var(--card-bg-color);
border: 1px solid var(--card-border-color);
border-radius: 16px;
padding: 2rem;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}
.loader {
margin: 1.25rem auto 1.25rem;
width: 48px;
height: 48px;
border: 3px solid rgba(255, 255, 255, 0.25);
border-top-color: #fff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.hint {
opacity: 0.9;
}
.sr-only {
position: absolute;
width: 1px; height: 1px;
padding: 0; margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap; border: 0;
}
h1 {
font-size: 3rem;
font-weight: 700;
margin: 0 0 1rem;
letter-spacing: -1px;
}
p {
margin: 0.5rem 0;
font-size: 1.1rem;
}
code {
background: rgba(0,0,0,0.2);
padding: 2px 6px;
border-radius: 4px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
footer {
position: absolute;
bottom: 1rem;
font-size: 0.8rem;
opacity: 0.7;
}
</style>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Connect - Find Your Next Opportunity</title>
<meta name="description" content="AI-Powered Job Search & Resume Builder Platform. Find jobs, create resumes, and apply seamlessly.">
<meta name="keywords" content="job search, resume builder, career, employment, jobs, tech jobs, remote work, job listings, Built with Flatlogic Generator">
<!-- Social Media Meta Tags -->
<meta property="og:title" content="Connect - Find Your Next Opportunity">
<meta property="og:description" content="AI-Powered Job Search & Resume Builder Platform. Find jobs, create resumes, and apply seamlessly.">
<meta property="og:image" content="">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="">
<!-- Bootstrap 5 CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap Icons -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" rel="stylesheet">
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<main>
<div class="card">
<h1>Analyzing your requirements and generating your website…</h1>
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
<span class="sr-only">Loading…</span>
<!-- Header -->
<nav class="navbar navbar-expand-lg navbar-light sticky-top">
<div class="container">
<a class="navbar-brand fw-bold" href="#">Connect</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link active" href="#">Jobs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Employers</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Sign In</a>
</li>
<li class="nav-item">
<a class="btn btn-primary ms-lg-2" href="#">Sign Up</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Main Content -->
<main>
<!-- Hero Section -->
<header class="hero">
<div class="container">
<h1 class="display-4 fw-bold">Find Your Next Opportunity</h1>
<p class="lead mb-4">The AI-powered platform to discover jobs and build your career.</p>
<div class="row justify-content-center">
<div class="col-md-8">
<div class="input-group input-group-lg">
<input type="text" class="form-control" placeholder="Job title, keyword, or company" disabled>
<button class="btn btn-light" type="button" disabled>Search</button>
</div>
</div>
</div>
</div>
</header>
<!-- Job Listings -->
<div class="container py-5">
<div class="row g-4">
<?php
require_once 'db/config.php';
try {
$pdo = db();
$stmt = $pdo->query('SELECT * FROM jobs ORDER BY created_at DESC');
$jobs = $stmt->fetchAll();
if (empty($jobs)) {
echo "<div class='col-12'><p class='text-center'>No job listings found at the moment. Please check back later.</p></div>";
} else {
foreach ($jobs as $job) {
echo '
<div class="col-lg-4 col-md-6">
<div class="card h-100 job-card">
<div class="card-body d-flex flex-column">
<h5 class="card-title fw-bold">' . htmlspecialchars($job['title']) . '</h5>
<h6 class="card-subtitle mb-2 text-muted">' . htmlspecialchars($job['company']) . '</h6>
<p class="card-text text-muted small"><i class="bi bi-geo-alt-fill"></i> ' . htmlspecialchars($job['location']) . '</p>
<p class="card-text flex-grow-1">' . substr(htmlspecialchars($job['description']), 0, 100) . '...</p>
<div class="d-flex justify-content-between align-items-center mb-3">
<span class="badge rounded-pill">' . htmlspecialchars($job['job_type']) . '</span>
<span class="fw-bold text-success">' . htmlspecialchars($job['salary']) . '</span>
</div>
<button class="btn btn-primary w-100" disabled>Quick Apply</button>
</div>
</div>
</div>';
}
}
} catch (PDOException $e) {
// In a real app, log this error. For now, show a friendly message.
echo "<div class='col-12'><p class='text-center text-danger'>Error: Could not connect to the database to fetch jobs.</p></div>";
}
?>
</div>
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
<p class="hint">This page will update automatically as the plan is implemented.</p>
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
</div>
</main>
<footer>
Page updated: <?= htmlspecialchars($now) ?> (UTC)
<!-- Footer -->
<footer class="footer">
<div class="container text-center">
<p class="mb-0">&copy; <?php echo date("Y"); ?> Connect. All Rights Reserved. Built with Flatlogic.</p>
</div>
</footer>
<!-- Bootstrap 5 JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body>
</html>

281
mobile_app/lib/main.dart Normal file
View File

@ -0,0 +1,281 @@
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
import 'src/calendar_screen.dart';
import 'src/education_screen.dart';
import 'src/resume_screen.dart';
import 'src/settings_screen.dart';
void main() {
runApp(const MyApp());
}
// Color Palette
const Color darkJungleGreen = Color(0xFF000505);
const Color englishViolet = Color(0xFF3B3355);
const Color slateGray = Color(0xFF5D5D81);
const Color lightSteelBlue = Color(0xFFBFCDE0);
const Color ghostWhite = Color(0xFFFEFCFD);
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
bool _isDarkMode = false;
void _toggleTheme(bool isDark) {
setState(() {
_isDarkMode = isDark;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Connect',
theme: ThemeData(
brightness: Brightness.light,
primaryColor: englishViolet,
scaffoldBackgroundColor: ghostWhite,
colorScheme: const ColorScheme.light(
primary: englishViolet,
secondary: slateGray,
surface: ghostWhite,
background: ghostWhite,
onPrimary: ghostWhite,
onSecondary: darkJungleGreen,
onSurface: darkJungleGreen,
onBackground: darkJungleGreen,
error: Colors.red,
onError: ghostWhite,
),
appBarTheme: const AppBarTheme(
backgroundColor: englishViolet,
foregroundColor: ghostWhite,
titleTextStyle: TextStyle(fontFamily: 'Poppins', fontSize: 20, fontWeight: FontWeight.bold),
),
textTheme: const TextTheme(
bodyLarge: TextStyle(color: darkJungleGreen),
titleLarge: TextStyle(color: darkJungleGreen, fontWeight: FontWeight.bold),
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
backgroundColor: englishViolet,
foregroundColor: ghostWhite,
),
),
darkTheme: ThemeData(
brightness: Brightness.dark,
primaryColor: lightSteelBlue,
scaffoldBackgroundColor: darkJungleGreen,
colorScheme: const ColorScheme.dark(
primary: lightSteelBlue,
secondary: slateGray,
surface: darkJungleGreen,
background: darkJungleGreen,
onPrimary: darkJungleGreen,
onSecondary: ghostWhite,
onSurface: ghostWhite,
onBackground: ghostWhite,
error: Colors.red,
onError: ghostWhite,
),
appBarTheme: const AppBarTheme(
backgroundColor: slateGray,
foregroundColor: ghostWhite,
titleTextStyle: TextStyle(fontFamily: 'Poppins', fontSize: 20, fontWeight: FontWeight.bold),
),
textTheme: const TextTheme(
bodyLarge: TextStyle(color: ghostWhite),
titleLarge: TextStyle(color: ghostWhite, fontWeight: FontWeight.bold),
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
backgroundColor: lightSteelBlue,
foregroundColor: darkJungleGreen,
),
),
themeMode: _isDarkMode ? ThemeMode.dark : ThemeMode.light,
home: JobListingScreen(isDarkMode: _isDarkMode, onThemeChanged: _toggleTheme),
);
}
}
class JobListingScreen extends StatefulWidget {
final bool isDarkMode;
final ValueChanged<bool> onThemeChanged;
const JobListingScreen({
Key? key,
required this.isDarkMode,
required this.onThemeChanged,
}) : super(key: key);
@override
_JobListingScreenState createState() => _JobListingScreenState();
}
class _JobListingScreenState extends State<JobListingScreen> {
List<dynamic> jobs = [];
bool isLoading = true;
String? error;
@override
void initState() {
super.initState();
fetchJobs();
}
Future<void> fetchJobs() async {
// IMPORTANT: Replace with your actual IP/domain in a real environment.
// 10.0.2.2 is the special alias for the host machine's localhost in the Android emulator.
const String apiUrl = 'http://10.0.2.2/api.php';
try {
final response = await http.get(Uri.parse(apiUrl));
if (response.statusCode == 200) {
final result = json.decode(response.body);
if (result['success'] == true) {
setState(() {
jobs = result['data'];
isLoading = false;
});
} else {
setState(() {
error = result['error'] ?? 'An unknown error occurred.';
isLoading = false;
});
}
} else {
setState(() {
error = 'Failed to load jobs. Status code: ${response.statusCode}';
isLoading = false;
});
}
} catch (e) {
setState(() {
error = 'Failed to connect to the server. Please check your network connection and the API endpoint. Details: $e';
isLoading = false;
});
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Connect'),
),
drawer: Drawer( // Vertical navigation drawer
child: ListView(
padding: EdgeInsets.zero,
children: [
const DrawerHeader(
decoration: BoxDecoration(
color: englishViolet,
),
child: Text(
'Connect',
style: TextStyle(color: Colors.white, fontSize: 24),
),
),
ListTile(
leading: const Icon(Icons.school),
title: const Text('Education/Information'),
onTap: () {
Navigator.pop(context);
Navigator.push(context, MaterialPageRoute(builder: (context) => const EducationScreen()));
},
),
ListTile(
leading: const Icon(Icons.description),
title: const Text('Resume/Job Letter'),
onTap: () {
Navigator.pop(context);
Navigator.push(context, MaterialPageRoute(builder: (context) => const ResumeScreen()));
},
),
ListTile(
leading: const Icon(Icons.calendar_today),
title: const Text('Calendar'),
onTap: () {
Navigator.pop(context);
Navigator.push(context, MaterialPageRoute(builder: (context) => const CalendarScreen()));
},
),
ListTile(
leading: const Icon(Icons.settings),
title: const Text('Settings'),
onTap: () {
Navigator.pop(context);
Navigator.push(context, MaterialPageRoute(builder: (context) => SettingsScreen(
isDarkMode: widget.isDarkMode,
onThemeChanged: widget.onThemeChanged,
)));
},
),
],
),
),
body: buildBody(),
floatingActionButton: FloatingActionButton(
onPressed: () {
// AI Chatbot action
},
child: const Icon(Icons.chat),
),
);
}
Widget buildBody() {
if (isLoading) {
return const Center(child: CircularProgressIndicator());
}
if (error != null) {
return Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
'Error: $error',
textAlign: TextAlign.center,
style: const TextStyle(color: Colors.red, fontSize: 16),
),
),
);
}
if (jobs.isEmpty) {
return const Center(child: Text('No jobs found.'));
}
return ListView.builder(
itemCount: jobs.length,
itemBuilder: (context, index) {
final job = jobs[index];
return Card(
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
elevation: 4,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: ListTile(
title: Text(job['title'] ?? 'No Title', style: Theme.of(context).textTheme.titleLarge),
subtitle: Text(
'${job['company'] ?? 'No Company'} - ${job['location'] ?? 'No Location'}',
style: Theme.of(context).textTheme.bodyLarge,
),
trailing: Text(
job['salary_range'] ?? '',
style: TextStyle(color: Theme.of(context).colorScheme.primary),
),
onTap: () {
// Show job details
},
),
);
},
);
}
}

View File

@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
class CalendarScreen extends StatelessWidget {
const CalendarScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Calendar'),
),
body: const Center(
child: Text('Calendar Screen'),
),
);
}
}

View File

@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
class EducationScreen extends StatelessWidget {
const EducationScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Education/Information'),
),
body: const Center(
child: Text('Education/Information Screen'),
),
);
}
}

View File

@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
class ResumeScreen extends StatelessWidget {
const ResumeScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Resume/Job Letter'),
),
body: const Center(
child: Text('Resume/Job Letter Screen'),
),
);
}
}

View File

@ -0,0 +1,179 @@
import 'package:flutter/material.dart';
class SettingsScreen extends StatefulWidget {
final bool isDarkMode;
final ValueChanged<bool> onThemeChanged;
const SettingsScreen({
super.key,
required this.isDarkMode,
required this.onThemeChanged,
});
@override
State<SettingsScreen> createState() => _SettingsScreenState();
}
class _SettingsScreenState extends State<SettingsScreen> {
bool _pushNotifications = true;
bool _emailNotifications = true;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Settings'),
elevation: 0,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
foregroundColor: Theme.of(context).textTheme.bodyLarge?.color,
),
body: ListView(
children: [
_buildSectionHeader('Account'),
_buildSettingsTile(
context,
icon: Icons.person_outline,
title: 'Edit Profile',
onTap: () {
// Placeholder for navigation
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Navigate to Edit Profile')),
);
},
),
_buildSettingsTile(
context,
icon: Icons.lock_outline,
title: 'Change Password',
onTap: () {
// Placeholder for navigation
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Navigate to Change Password')),
);
},
),
const Divider(),
_buildSectionHeader('Notifications'),
_buildSwitchTile(
context,
title: 'Push Notifications',
value: _pushNotifications,
onChanged: (value) {
setState(() {
_pushNotifications = value;
});
},
),
_buildSwitchTile(
context,
title: 'Email Notifications',
value: _emailNotifications,
onChanged: (value) {
setState(() {
_emailNotifications = value;
});
},
),
const Divider(),
_buildSectionHeader('Appearance'),
_buildSwitchTile(
context,
title: 'Dark Mode',
value: widget.isDarkMode,
onChanged: widget.onThemeChanged,
),
const Divider(),
_buildSectionHeader('Support'),
_buildSettingsTile(
context,
icon: Icons.help_outline,
title: 'Help Center',
onTap: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Navigate to Help Center')),
);
},
),
_buildSettingsTile(
context,
icon: Icons.contact_support_outlined,
title: 'Contact Us',
onTap: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Navigate to Contact Us')),
);
},
),
const Divider(),
_buildSectionHeader('Legal'),
_buildSettingsTile(
context,
icon: Icons.description_outlined,
title: 'Terms of Service',
onTap: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Navigate to Terms of Service')),
);
},
),
_buildSettingsTile(
context,
icon: Icons.privacy_tip_outlined,
title: 'Privacy Policy',
onTap: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Navigate to Privacy Policy')),
);
},
),
const Divider(),
ListTile(
title: Text(
'Logout',
style: TextStyle(color: Theme.of(context).colorScheme.error),
),
leading: Icon(Icons.logout, color: Theme.of(context).colorScheme.error),
onTap: () {
// Placeholder for logout logic
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('User logged out')),
);
},
),
],
),
);
}
Widget _buildSectionHeader(String title) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
child: Text(
title.toUpperCase(),
style: TextStyle(
color: Theme.of(context).textTheme.bodySmall?.color,
fontWeight: FontWeight.bold,
fontSize: 12,
),
),
);
}
Widget _buildSettingsTile(BuildContext context, {required IconData icon, required String title, required VoidCallback onTap}) {
return ListTile(
leading: Icon(icon, color: Theme.of(context).colorScheme.secondary),
title: Text(title),
trailing: const Icon(Icons.chevron_right),
onTap: onTap,
);
}
Widget _buildSwitchTile(BuildContext context, {required String title, required bool value, required ValueChanged<bool> onChanged}) {
return SwitchListTile(
title: Text(title),
value: value,
onChanged: onChanged,
activeColor: Theme.of(context).colorScheme.primary,
);
}
}

23
mobile_app/pubspec.yaml Normal file
View File

@ -0,0 +1,23 @@
name: connect_app
description: A new Flutter project.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: '>=2.19.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
http: ^0.13.5
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter:
uses-material-design: true