visual_cache 1.0.0-betta.2 visual_cache: ^1.0.0-betta.2 copied to clipboard
Visual Cache was created to help you see how much cache your application has accumulated.
import 'package:flutter/material.dart';
import 'package:visual_cache/widget/visual_widget.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Visual cache Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.greenAccent),
useMaterial3: true,
),
home: const MyHomePage(title: 'Visual cache Demo'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Cache size',
style: TextStyle(fontSize: 24),
),
SizedBox(height: 70,),
VisualCacheWidget(subdirectories: ['NewFolder','NewFolder2', 'NewFolder3'],)
],
),
),
);
}
}