Flutter Forensics Control Center App – Clone, Backup & Restore Tool (Full Source Code)
Demo :
Click Video 👇👇👇
📌 Blogger Features to Enable:
✔ Allow Comments
✔ Enable Search Description
✔ Custom Robots Tags → index, follow
✔ Add Structured Data (Article)
Code :
pubspec.yaml
dependencies:
flutter:
sdk: flutter
# External packages (placed CORRECTLY here)
shared_preferences: ^2.2.2
path_provider: ^2.1.5
archive: ^4.0.7
cupertino_icons: ^1.0.8
main.dart
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:path_provider/path_provider.dart';
import 'package:archive/archive_io.dart';
void main() {
runApp(const AppClonerUI());
}
class AppClonerUI extends StatelessWidget {
const AppClonerUI({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: const Color(0xFF05070D),
),
home: const DashboardScreen(),
);
}
}
// ------------------------------------------------------------
// 🎨 PREMIUM FUTURISTIC DASHBOARD (ATTRACTIVE UI)
// ------------------------------------------------------------
class DashboardScreen extends StatelessWidget {
const DashboardScreen({super.key});
@override
Widget build(BuildContext context) {
final tiles = [
("Clone App Folder", Icons.copy, Colors.pinkAccent),
("Backup Folder (ZIP)", Icons.archive, Colors.cyanAccent),
("Restore Backup", Icons.restore, Colors.orangeAccent),
("Forensics Explorer", Icons.folder_open, Colors.greenAccent),
];
return Scaffold(
body: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFF0A0E1A), Color(0xFF0F1224)],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
),
child: Column(
children: [
const SizedBox(height: 60),
Text(
"Forensics Control Center",
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
foreground: Paint()
..shader = const LinearGradient(
colors: [Colors.tealAccent, Colors.blueAccent],
).createShader(const Rect.fromLTWH(0, 0, 300, 30)),
),
),
const SizedBox(height: 10),
const Text(
"Clone • Backup • Restore • Explore",
style: TextStyle(color: Colors.white60, fontSize: 15),
),
const SizedBox(height: 35),
// Animated Grid
Expanded(
child: GridView.builder(
padding: const EdgeInsets.all(20),
itemCount: tiles.length,
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, childAspectRatio: .95),
itemBuilder: (_, i) {
return _AnimatedTile(
title: tiles[i].$1,
icon: tiles[i].$2,
neonColor: tiles[i].$3,
onTap: () {
if (i == 0) Navigator.push(context, _route(const CloneScreen()));
if (i == 1) Navigator.push(context, _route(const BackupScreen()));
if (i == 2) Navigator.push(context, _route(const RestoreScreen()));
if (i == 3) Navigator.push(context, _route(const ForensicsExplorerScreen()));
},
);
},
),
),
],
),
),
);
}
}
// ------------------------------------------------------------
// 🔮 Animated Glassmorphic Tile Widget
// ------------------------------------------------------------
class _AnimatedTile extends StatefulWidget {
final String title;
final IconData icon;
final Color neonColor;
final Function() onTap;
const _AnimatedTile({
required this.title,
required this.icon,
required this.neonColor,
required this.onTap,
});
@override
State<_AnimatedTile> createState() => _AnimatedTileState();
}
class _AnimatedTileState extends State<_AnimatedTile>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _scale;
@override
void initState() {
super.initState();
_controller =
AnimationController(vsync: this, duration: const Duration(milliseconds: 250));
_scale = Tween<double>(begin: 1, end: .95).animate(_controller);
}
@override
Widget build(BuildContext context) {
return ScaleTransition(
scale: _scale,
child: GestureDetector(
onTapDown: (_) => _controller.forward(),
onTapUp: (_) {
_controller.reverse();
widget.onTap();
},
onTapCancel: () => _controller.reverse(),
child: Container(
margin: const EdgeInsets.all(12),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22),
gradient: LinearGradient(
colors: [
widget.neonColor.withOpacity(.15),
Colors.white.withOpacity(.05),
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
border: Border.all(
color: widget.neonColor.withOpacity(.6),
width: 1.3,
),
boxShadow: [
BoxShadow(
color: widget.neonColor.withOpacity(.3),
blurRadius: 20,
spreadRadius: 1,
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(widget.icon, size: 55, color: widget.neonColor),
const SizedBox(height: 15),
Text(
widget.title,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 17, fontWeight: FontWeight.bold),
),
],
),
),
),
);
}
}
// ------------------------------------------------------------
// 📱 Page Transition Animation
// ------------------------------------------------------------
Route _route(Widget screen) {
return PageRouteBuilder(
transitionsBuilder: (context, animation, sec, child) {
return FadeTransition(
opacity: animation,
child: Transform.scale(
scale: 0.95 + (animation.value * .05),
child: child,
),
);
},
pageBuilder: (_, __, ___) => screen,
);
}
// ------------------------------------------------------------
// 🔵 SCREENS (Logic Same — UI Upgraded)
// ------------------------------------------------------------
class CloneScreen extends StatefulWidget {
const CloneScreen({super.key});
@override
State<CloneScreen> createState() => _CloneScreenState();
}
class _CloneScreenState extends State<CloneScreen> {
String status = "Ready";
Future<void> cloneFolder() async {
final Directory base = await getApplicationDocumentsDirectory();
final source = Directory("${base.path}/original_app/");
final target = Directory("${base.path}/cloned_app/");
if (!await source.exists()) {
await source.create(recursive: true);
File("${source.path}/demo.txt").writeAsString("Sample App Data");
}
if (!await target.exists()) {
await target.create(recursive: true);
}
for (var file in source.listSync()) {
final newFile = File("${target.path}/${file.uri.pathSegments.last}");
await newFile.writeAsBytes(await File(file.path).readAsBytes());
}
setState(() => status = "Folder cloned successfully!");
}
@override
Widget build(BuildContext context) {
return _fancyScreen(
title: "Clone App Folder",
status: status,
buttonText: "CLONE NOW",
onPressed: cloneFolder,
);
}
}
// ------------------------------------------------------------
class BackupScreen extends StatefulWidget {
const BackupScreen({super.key});
@override
State<BackupScreen> createState() => _BackupScreenState();
}
class _BackupScreenState extends State<BackupScreen> {
String status = "Ready";
Future<void> backupFolder() async {
final Directory base = await getApplicationDocumentsDirectory();
final source = Directory("${base.path}/cloned_app/");
final backupFile = File("${base.path}/backup.zip");
final encoder = ZipFileEncoder();
encoder.create(backupFile.path);
encoder.addDirectory(source);
encoder.close();
setState(() => status = "Backup ZIP created!");
}
@override
Widget build(BuildContext context) {
return _fancyScreen(
title: "Backup Folder",
status: status,
buttonText: "CREATE BACKUP",
onPressed: backupFolder,
);
}
}
// ------------------------------------------------------------
class RestoreScreen extends StatefulWidget {
const RestoreScreen({super.key});
@override
State<RestoreScreen> createState() => _RestoreScreenState();
}
class _RestoreScreenState extends State<RestoreScreen> {
String status = "Ready";
Future<void> restoreBackup() async {
final Directory base = await getApplicationDocumentsDirectory();
final zipFile = File("${base.path}/backup.zip");
final target = Directory("${base.path}/restored_app/");
if (!await zipFile.exists()) {
setState(() => status = "No backup.zip found!");
return;
}
if (!await target.exists()) {
await target.create(recursive: true);
}
final bytes = zipFile.readAsBytesSync();
final archive = ZipDecoder().decodeBytes(bytes);
for (var file in archive) {
if (file.isFile) {
final outFile = File("${target.path}/${file.name}");
await outFile.create(recursive: true);
await outFile.writeAsBytes(file.content);
}
}
setState(() => status = "Backup restored successfully!");
}
@override
Widget build(BuildContext context) {
return _fancyScreen(
title: "Restore Backup",
status: status,
buttonText: "RESTORE NOW",
onPressed: restoreBackup,
);
}
}
// ------------------------------------------------------------
class ForensicsExplorerScreen extends StatelessWidget {
const ForensicsExplorerScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Forensics Explorer"),
),
body: Container(
padding: const EdgeInsets.all(20),
child: ListView(
children: List.generate(
12,
(i) => Card(
color: Colors.white.withOpacity(.05),
child: ListTile(
leading: const Icon(Icons.folder, color: Colors.tealAccent),
title: Text("Virtual App Folder $i"),
subtitle: const Text("Size: 4.2MB"),
),
),
),
),
),
);
}
}
// ------------------------------------------------------------
// 🌈 Beautiful Screen Template
// ------------------------------------------------------------
Widget _fancyScreen({
required String title,
required String status,
required String buttonText,
required Function() onPressed,
}) {
return Scaffold(
body: Container(
width: double.infinity,
padding: const EdgeInsets.all(25),
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFF0A0E1A), Color(0xFF0F152B)],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(title,
style: const TextStyle(
fontSize: 28, fontWeight: FontWeight.bold)),
const SizedBox(height: 20),
Text(status,
style: const TextStyle(fontSize: 18, color: Colors.white60)),
const SizedBox(height: 40),
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.tealAccent,
foregroundColor: Colors.black,
padding:
const EdgeInsets.symmetric(vertical: 15, horizontal: 50),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
onPressed: onPressed,
child: Text(buttonText,
style: const TextStyle(
fontSize: 18, fontWeight: FontWeight.bold)),
),
],
),
),
);
}
Comments
Post a Comment