1
0
mirror of https://github.com/git-touch/git-touch synced 2025-02-22 14:27:46 +01:00

32 lines
683 B
Dart
Raw Normal View History

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