redacted 1.0.12 redacted: ^1.0.12 copied to clipboard
A package that automatically generate a loading widget from your own widget.
import 'package:example/headphone_widget.dart';
import 'package:flutter/material.dart';
import 'package:redacted/redacted.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: const Text("Redacted Example"),
),
body: Column(
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
const Expanded(child: HeadphoneWidget()),
const SizedBox(
width: 16,
),
Expanded(
child: const HeadphoneWidget().redacted(
context: context,
redact: true,
),
)
],
),
)
],
),
);
}
}