|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class HomeItem extends StatelessWidget {
|
|
|
|
final String id;
|
|
|
|
final String title;
|
|
|
|
final String image;
|
|
|
|
final String link;
|
|
|
|
|
|
|
|
HomeItem(this.id, this.title, this.image, this.link);
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () => selectItem(context, link),
|
|
|
|
splashColor: Colors.red,
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
width: 1, // <--- border width here
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
// decoration: BoxDecoration(color:Colors.red),
|
|
|
|
width: 10000,
|
|
|
|
height: 60,
|
|
|
|
child: CircleAvatar(
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
child: Container(
|
|
|
|
child: Image.asset(
|
|
|
|
image,
|
|
|
|
// width 50,
|
|
|
|
scale: 0.6,
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(fontSize: 16),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
void selectItem(BuildContext ctx, route) {
|
|
|
|
print(route);
|
|
|
|
Navigator.of(ctx).pushNamed(route, arguments: {
|
|
|
|
'id': id,
|
|
|
|
'title': title,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|