2019-01-27 17:37:44 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
2019-01-31 07:20:48 +01:00
|
|
|
import '../screens/screens.dart';
|
2019-01-31 07:37:25 +01:00
|
|
|
import 'link.dart';
|
2019-01-27 17:37:44 +01:00
|
|
|
|
|
|
|
class Avatar extends StatelessWidget {
|
|
|
|
final String login;
|
|
|
|
final String url;
|
2019-02-03 08:50:17 +01:00
|
|
|
final double size;
|
2019-01-27 17:37:44 +01:00
|
|
|
|
2019-02-03 08:50:17 +01:00
|
|
|
Avatar({
|
|
|
|
@required this.login,
|
|
|
|
@required this.url,
|
|
|
|
this.size = 18,
|
|
|
|
});
|
2019-01-27 17:37:44 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2019-01-31 07:37:25 +01:00
|
|
|
return Link(
|
|
|
|
onTap: () {
|
2019-02-02 17:28:51 +01:00
|
|
|
Navigator.of(context)
|
|
|
|
.push(CupertinoPageRoute(builder: (_) => UserScreen(login)));
|
2019-01-31 07:37:25 +01:00
|
|
|
},
|
|
|
|
child: CircleAvatar(
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
backgroundImage: NetworkImage(url),
|
2019-02-03 08:50:17 +01:00
|
|
|
radius: size,
|
2019-01-27 17:37:44 +01:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|