You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.0 KiB
Dart
44 lines
1.0 KiB
Dart
5 years ago
|
import 'package:doctor_app_flutter/routes.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
class HomeItem extends StatelessWidget {
|
||
|
final String id;
|
||
|
final String title;
|
||
|
final String image;
|
||
|
HomeItem(this.id, this.title, this.image);
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return InkWell(
|
||
|
onTap: () => selectItem(context,id),
|
||
|
splashColor: Colors.red,
|
||
|
child: Container(
|
||
|
child: Column(
|
||
|
children: <Widget>[
|
||
|
Container(
|
||
|
child: CircleAvatar(
|
||
|
backgroundColor: Colors.white,
|
||
|
child: Image.asset(
|
||
|
|
||
|
image,
|
||
|
color: Theme.of(context).primaryColor,
|
||
|
),
|
||
|
)),
|
||
|
Text(title,style: TextStyle(fontSize: 20),)
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
|
||
|
void selectItem(BuildContext ctx, id ) {
|
||
|
String route;
|
||
|
if (id =='c2') {
|
||
|
route = PATIENT_SEARCH;
|
||
|
}
|
||
|
Navigator.of(ctx).pushNamed(route, arguments: {
|
||
|
'id': id,
|
||
|
'title': title,
|
||
|
});
|
||
|
}
|
||
|
}
|