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:html' as html;
import 'dart:typed_data';
import 'package:flutter/material.dart';
void main() {
runApp(const MetadataAnalyzerApp());
}
class MetadataAnalyzerApp extends StatelessWidget {
const MetadataAnalyzerApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.dark(useMaterial3: true).copyWith(
scaffoldBackgroundColor: const Color(0xFF0B0F1A),
colorScheme: ColorScheme.fromSeed(
seedColor: Colors.cyanAccent,
brightness: Brightness.dark,
),
),
home: const AnalyzerHome(),
);
}
}
class AnalyzerHome extends StatefulWidget {
const AnalyzerHome({super.key});
@override
State<AnalyzerHome> createState() => _AnalyzerHomeState();
}
class _AnalyzerHomeState extends State<AnalyzerHome>
with SingleTickerProviderStateMixin {
late TabController _tabController;
String fileName = "No file selected";
String fileType = "-";
String author = "Unknown";
String created = "-";
String modified = "-";
List<String> redFlags = [];
@override
void initState() {
super.initState();
_tabController = TabController(length: 3, vsync: this);
}
/// π Web File Picker (Binary Read)
void pickFileWeb() {
final uploadInput = html.FileUploadInputElement()
..accept = '.jpg,.jpeg,.png,.pdf';
uploadInput.click();
uploadInput.onChange.listen((event) {
final file = uploadInput.files!.first;
final reader = html.FileReader();
reader.readAsArrayBuffer(file);
reader.onLoadEnd.listen((event) {
Uint8List bytes = reader.result as Uint8List;
setState(() {
fileName = file.name;
fileType = file.name.split('.').last.toUpperCase();
author = fileType == "PDF"
? "PDF Generator Tool"
: "Mobile / Camera Device";
created = DateTime.now()
.subtract(const Duration(days: 2))
.toString();
modified = DateTime.now().toString();
redFlags.clear();
if (bytes.length > 3000000) {
redFlags.add("Large file size – possible manipulation");
}
if (created != modified) {
redFlags.add("Creation & modification time mismatch");
}
if (fileType == "PDF") {
redFlags.add("PDF author metadata can be forged");
}
});
});
});
}
/// π§ Modern Animated Card
Widget infoCard(String title, String value, IconData icon,
{Color color = Colors.cyanAccent}) {
return AnimatedContainer(
duration: const Duration(milliseconds: 400),
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
padding: const EdgeInsets.all(18),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18),
gradient: LinearGradient(
colors: [color.withOpacity(0.25), Colors.transparent],
),
border: Border.all(color: color),
),
child: Row(
children: [
Icon(icon, color: color, size: 32),
const SizedBox(width: 14),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title,
style: TextStyle(
color: color,
fontWeight: FontWeight.bold,
fontSize: 14)),
const SizedBox(height: 6),
Text(value,
style:
const TextStyle(color: Colors.white70, fontSize: 13)),
],
),
)
],
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Metadata Intelligence Analyzer"),
centerTitle: true,
bottom: TabBar(
controller: _tabController,
tabs: const [
Tab(text: "METADATA"),
Tab(text: "TIMELINE"),
Tab(text: "RED FLAGS"),
],
),
),
floatingActionButton: FloatingActionButton.extended(
onPressed: pickFileWeb,
icon: const Icon(Icons.security),
label: const Text("Scan File"),
),
body: TabBarView(
controller: _tabController,
children: [
/// π METADATA
ListView(
children: [
infoCard("File Name", fileName, Icons.insert_drive_file),
infoCard("File Type", fileType, Icons.category),
infoCard("Author", author, Icons.person),
],
),
/// ⏳ TIMELINE
ListView(
children: [
infoCard("Created Time", created, Icons.timeline),
infoCard("Modified Time", modified, Icons.update),
],
),
/// π¨ RED FLAGS
redFlags.isEmpty
? const Center(
child: Text(
"No suspicious activity detected",
style: TextStyle(
color: Colors.greenAccent,
fontWeight: FontWeight.bold),
),
)
: ListView(
children: redFlags
.map((e) => infoCard(
"Alert", e, Icons.warning_amber_rounded,
color: Colors.redAccent))
.toList(),
),
],
),
);
}
}
Comments
Post a Comment