visual change to visibility button
This commit is contained in:
@@ -15,12 +15,20 @@ class _DashboardPageState extends State<DashboardPage> {
|
|||||||
bool _showDoneTodos = false;
|
bool _showDoneTodos = false;
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final screenWidth = MediaQuery.of(context).size.width;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
Padding(
|
||||||
onPressed: () => setState(() => _showDoneTodos = !_showDoneTodos),
|
padding: EdgeInsets.only(right: screenWidth * 0.05),
|
||||||
icon: const Icon(Icons.visibility),
|
child: IconButton(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
visualDensity: VisualDensity.compact,
|
||||||
|
onPressed: () => setState(() => _showDoneTodos = !_showDoneTodos),
|
||||||
|
icon: _showDoneTodos
|
||||||
|
? const Icon(Icons.visibility)
|
||||||
|
: const Icon(Icons.visibility_off),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -31,7 +39,7 @@ class _DashboardPageState extends State<DashboardPage> {
|
|||||||
),
|
),
|
||||||
body: Center(
|
body: Center(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: MediaQuery.of(context).size.width * 0.9,
|
width: screenWidth * 0.9,
|
||||||
child: TodoList(showDoneTodos: _showDoneTodos),
|
child: TodoList(showDoneTodos: _showDoneTodos),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user