From c480f83f6d8b98b5d6e7185b9a0f6c4bdcc26d60 Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Thu, 2 Mar 2023 20:20:17 +0100 Subject: [PATCH] outsource todoicon --- lib/pages/main_page.dart | 20 ++------------------ lib/widgets/todo_icon.dart | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 lib/widgets/todo_icon.dart diff --git a/lib/pages/main_page.dart b/lib/pages/main_page.dart index 82b4990..ce6a1ff 100644 --- a/lib/pages/main_page.dart +++ b/lib/pages/main_page.dart @@ -5,6 +5,8 @@ import 'package:smoke_cess_app/providers/tasks_provider.dart'; import 'package:smoke_cess_app/services/pages_service.dart'; import 'package:smoke_cess_app/providers/settings_provider.dart'; +import '../widgets/todo_icon.dart'; + class MyHomePage extends StatefulWidget { const MyHomePage({super.key}); @@ -54,21 +56,3 @@ class MyHomePageState extends State { ); } } - -class MyToDoIcon extends StatelessWidget { - final Icon _icon; - const MyToDoIcon(this._icon, {super.key}); - - @override - Widget build(BuildContext context) { - return Stack(children: [ - _icon, - const Positioned( - // draw a red marble - top: 0.0, - right: 0.0, - child: Icon(Icons.brightness_1, size: 10.0, color: Colors.redAccent), - ) - ]); - } -} diff --git a/lib/widgets/todo_icon.dart b/lib/widgets/todo_icon.dart new file mode 100644 index 0000000..e5c82b6 --- /dev/null +++ b/lib/widgets/todo_icon.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; + +class MyToDoIcon extends StatelessWidget { + final Icon _icon; + const MyToDoIcon(this._icon, {super.key}); + + @override + Widget build(BuildContext context) { + return Stack(children: [ + _icon, + const Positioned( + // draw a red marble + top: 0.0, + right: 0.0, + child: Icon(Icons.brightness_1, size: 10.0, color: Colors.redAccent), + ) + ]); + } +}