Metadata Intelligence Analyzer – Reveal Hidden Image & PDF Data
Demo :
Click Video πππ
✨ Features Section
-
Image & PDF metadata scanner
-
Timeline analysis
-
Red-flag detection
-
Flutter Web compatible
-
Modern forensic UI
Code :
import 'dart:async';
import 'package:flutter/material.dart';
void main() {
runApp(const SecureFileAccessApp());
}
class SecureFileAccessApp extends StatelessWidget {
const SecureFileAccessApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: const Color(0xFF0B0F1A),
colorScheme: const ColorScheme.dark(
primary: Color(0xFF00E5FF),
secondary: Color(0xFF1DE9B6),
),
),
home: const SecurityDashboard(),
);
}
}
class SecurityDashboard extends StatefulWidget {
const SecurityDashboard({super.key});
@override
State<SecurityDashboard> createState() => _SecurityDashboardState();
}
class _SecurityDashboardState extends State<SecurityDashboard> {
final TextEditingController _passwordController = TextEditingController();
final List<String> _auditLogs = [];
bool _accessGranted = false;
int _countdown = 15;
Timer? _timer;
static const String _securePassword = "Fuzzu";
static const int _autoLockSeconds = 15;
void _log(String message) {
final time = DateTime.now().toString().substring(0, 19);
_auditLogs.insert(0, "[$time] $message");
}
void _requestAccess() {
if (_passwordController.text == _securePassword) {
setState(() {
_accessGranted = true;
_countdown = _autoLockSeconds;
});
_log("ACCESS GRANTED | SecureFile.pdf");
_startTimer();
} else {
_log("ACCESS DENIED | Invalid password");
_showAlert("Access Denied", "Security policy check failed.");
}
}
void _startTimer() {
_timer?.cancel();
_timer = Timer.periodic(const Duration(seconds: 1), (timer) {
if (_countdown == 0) {
timer.cancel();
setState(() => _accessGranted = false);
_log("AUTO-LOCK | Session expired");
} else {
setState(() => _countdown--);
}
});
}
void _showAlert(String title, String msg) {
showDialog(
context: context,
builder: (_) => AlertDialog(
backgroundColor: const Color(0xFF11162A),
title: Text(title),
content: Text(msg),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: const Text("OK"),
),
],
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Secure File Access Controller"),
backgroundColor: const Color(0xFF11162A),
centerTitle: true,
),
body: Padding(
padding: const EdgeInsets.all(16),
child: Column(
children: [
_fileSecurityCard(),
const SizedBox(height: 16),
_auditLogCard(),
],
),
),
);
}
Widget _fileSecurityCard() {
return Container(
padding: const EdgeInsets.all(16),
decoration: _cardStyle(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
"Protected File",
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
const SizedBox(height: 6),
const Text("SecureFile.pdf"),
const Divider(),
_accessGranted ? _accessView() : _loginView(),
],
),
);
}
Widget _loginView() {
return Column(
children: [
TextField(
controller: _passwordController,
obscureText: true,
decoration: const InputDecoration(
labelText: "Security Password",
border: OutlineInputBorder(),
),
),
const SizedBox(height: 12),
SizedBox(
width: double.infinity,
child: ElevatedButton.icon(
onPressed: _requestAccess,
icon: const Icon(Icons.lock_open),
label: const Text("Request Access"),
),
),
],
);
}
Widget _accessView() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
"ACCESS GRANTED",
style: TextStyle(
color: Colors.greenAccent,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 6),
Text("Auto-Lock in $_countdown seconds"),
const SizedBox(height: 6),
const Text(
"• Screenshot disabled\n• Audit logging active\n• Policy enforced",
style: TextStyle(color: Colors.white70),
),
],
);
}
Widget _auditLogCard() {
return Expanded(
child: Container(
decoration: _cardStyle(),
child: Column(
children: [
const ListTile(
leading: Icon(Icons.security),
title: Text("Audit Log"),
),
const Divider(height: 1),
Expanded(
child: _auditLogs.isEmpty
? const Center(child: Text("No activity recorded"))
: ListView.builder(
itemCount: _auditLogs.length,
itemBuilder: (_, i) => ListTile(
dense: true,
title: Text(
_auditLogs[i],
style: const TextStyle(fontSize: 12),
),
),
),
),
],
),
),
);
}
BoxDecoration _cardStyle() {
return BoxDecoration(
color: const Color(0xFF11162A),
borderRadius: BorderRadius.circular(14),
border: Border.all(color: Colors.white12),
boxShadow: const [
BoxShadow(
color: Colors.black54,
blurRadius: 12,
offset: Offset(0, 6),
)
],
);
}
}
Comments
Post a Comment