|
@@ -3,6 +3,8 @@ import 'package:go_router/go_router.dart';
|
|
import 'package:namer_app/data.dart';
|
|
import 'package:namer_app/data.dart';
|
|
import 'package:date_format/date_format.dart';
|
|
import 'package:date_format/date_format.dart';
|
|
|
|
|
|
|
|
+var date = formatDate(DateTime.now(), [HH, ':', nn]);
|
|
|
|
+
|
|
class ListPage extends StatelessWidget {
|
|
class ListPage extends StatelessWidget {
|
|
const ListPage({Key? key}) : super(key: key);
|
|
const ListPage({Key? key}) : super(key: key);
|
|
|
|
|
|
@@ -63,10 +65,12 @@ class ListPage extends StatelessWidget {
|
|
(i) => SizedBox(
|
|
(i) => SizedBox(
|
|
child: ListTile(
|
|
child: ListTile(
|
|
leading: gambar(items[i]),
|
|
leading: gambar(items[i]),
|
|
- title: Text(items[i].type),
|
|
|
|
|
|
+ title: Text(items[i]['type']),
|
|
subtitle: Text(
|
|
subtitle: Text(
|
|
- 'Description of ${items[i].type.toLowerCase()}'),
|
|
|
|
- trailing: IconDelete(),
|
|
|
|
|
|
+ 'Description of ${items[i]['type'].toLowerCase()}'),
|
|
|
|
+ trailing: IconDelete(
|
|
|
|
+ items: items[i],
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
)),
|
|
)),
|
|
),
|
|
),
|
|
@@ -80,9 +84,9 @@ class ListPage extends StatelessWidget {
|
|
(i) => SizedBox(
|
|
(i) => SizedBox(
|
|
child: ListTile(
|
|
child: ListTile(
|
|
leading: gambar(items[i]),
|
|
leading: gambar(items[i]),
|
|
- title: Text(items[i].type),
|
|
|
|
|
|
+ title: Text(items[i]['type']),
|
|
subtitle: Text(
|
|
subtitle: Text(
|
|
- 'Description of ${items[i].type.toLowerCase()}'),
|
|
|
|
|
|
+ 'Description of ${items[i]['type'].toLowerCase()}'),
|
|
trailing: IconAdd(),
|
|
trailing: IconAdd(),
|
|
),
|
|
),
|
|
)),
|
|
)),
|
|
@@ -97,12 +101,12 @@ class ListPage extends StatelessWidget {
|
|
Container gambar(items) {
|
|
Container gambar(items) {
|
|
return Container(
|
|
return Container(
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
- border: Border.all(color: items.color),
|
|
|
|
|
|
+ border: Border.all(color: items['color']),
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
- color: items.color.withOpacity(0.4)),
|
|
|
|
|
|
+ color: items['color'].withOpacity(0.4)),
|
|
padding: const EdgeInsets.all(5.0),
|
|
padding: const EdgeInsets.all(5.0),
|
|
child: Image.asset(
|
|
child: Image.asset(
|
|
- items.image,
|
|
|
|
|
|
+ items['image'],
|
|
width: 36,
|
|
width: 36,
|
|
height: 36,
|
|
height: 36,
|
|
fit: BoxFit.cover,
|
|
fit: BoxFit.cover,
|
|
@@ -111,16 +115,6 @@ class ListPage extends StatelessWidget {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-class Data {
|
|
|
|
- String type;
|
|
|
|
- Color color;
|
|
|
|
- String image;
|
|
|
|
-
|
|
|
|
- Data({required this.type, required this.color, required this.image});
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-var date = formatDate(DateTime.now(), [HH, ':', nn]);
|
|
|
|
-
|
|
|
|
class AvailableMenu extends StatelessWidget {
|
|
class AvailableMenu extends StatelessWidget {
|
|
const AvailableMenu({
|
|
const AvailableMenu({
|
|
Key? key,
|
|
Key? key,
|
|
@@ -193,7 +187,9 @@ class IconAdd extends StatelessWidget {
|
|
}
|
|
}
|
|
|
|
|
|
class IconDelete extends StatelessWidget {
|
|
class IconDelete extends StatelessWidget {
|
|
- const IconDelete({
|
|
|
|
|
|
+ final Map<String, dynamic> items;
|
|
|
|
+ IconDelete({
|
|
|
|
+ required this.items,
|
|
Key? key,
|
|
Key? key,
|
|
}) : super(key: key);
|
|
}) : super(key: key);
|
|
|
|
|
|
@@ -205,11 +201,11 @@ class IconDelete extends StatelessWidget {
|
|
IconButton(
|
|
IconButton(
|
|
icon: Icon(Icons.remove_circle),
|
|
icon: Icon(Icons.remove_circle),
|
|
color: Colors.red,
|
|
color: Colors.red,
|
|
- onPressed: () {},
|
|
|
|
|
|
+ onPressed: () {print(items);},
|
|
),
|
|
),
|
|
SizedBox(width: 10),
|
|
SizedBox(width: 10),
|
|
IconButton(
|
|
IconButton(
|
|
- onPressed: () {},
|
|
|
|
|
|
+ onPressed: () => context.goNamed('detail', queryParams: items),
|
|
icon: Icon(Icons.menu),
|
|
icon: Icon(Icons.menu),
|
|
)
|
|
)
|
|
],
|
|
],
|