1+ import 'package:example/app_user.dart' ;
2+ import 'package:flutter/foundation.dart' ;
13import 'package:flutter/material.dart' ;
24import 'package:stream_feed/stream_feed.dart' ;
35import 'package:timeago/timeago.dart' as timeago;
46
5- import 'app_user.dart' ;
6-
7+ //ignore: public_member_api_docs
78class ActivityCard extends StatelessWidget {
8- final Activity activity;
9+ //ignore: public_member_api_docs
10+ const ActivityCard ({
11+ required this .activity,
12+ Key ? key,
13+ }) : super (key: key);
914
10- const ActivityCard ({Key ? key, required this .activity}) : super (key: key);
15+ //ignore: public_member_api_docs
16+ final Activity activity;
1117
1218 @override
1319 Widget build (BuildContext context) {
1420 final user = appUsers
1521 .firstWhere ((it) => createUserReference (it.id) == activity.actor);
1622 return Padding (
17- padding: const EdgeInsets .symmetric (horizontal: 16.0 , vertical: 8 ),
23+ padding: const EdgeInsets .symmetric (horizontal: 16 , vertical: 8 ),
1824 child: Column (
1925 crossAxisAlignment: CrossAxisAlignment .start,
2026 children: [
@@ -23,14 +29,14 @@ class ActivityCard extends StatelessWidget {
2329 CircleAvatar (
2430 child: Text (user.name[0 ]),
2531 ),
26- SizedBox (width: 16 ),
32+ const SizedBox (width: 16 ),
2733 Expanded (
2834 child: Column (
2935 crossAxisAlignment: CrossAxisAlignment .start,
3036 children: [
3137 Text (
3238 user.name,
33- style: TextStyle (
39+ style: const TextStyle (
3440 fontSize: 18 ,
3541 ),
3642 ),
@@ -39,7 +45,7 @@ class ActivityCard extends StatelessWidget {
3945 activity .time !,
4046 allowFromNow : true ,
4147 )}' ,
42- style: TextStyle (
48+ style: const TextStyle (
4349 fontWeight: FontWeight .w300,
4450 ),
4551 ),
@@ -48,15 +54,21 @@ class ActivityCard extends StatelessWidget {
4854 )
4955 ],
5056 ),
51- SizedBox (height: 16 ),
57+ const SizedBox (height: 16 ),
5258 Text (
53- activity.extraData! ['tweet' ] as String ,
54- style: TextStyle (
59+ activity.extraData! ['tweet' ]. toString () ,
60+ style: const TextStyle (
5561 fontSize: 24 ,
5662 ),
5763 ),
5864 ],
5965 ),
6066 );
6167 }
68+
69+ @override
70+ void debugFillProperties (DiagnosticPropertiesBuilder properties) {
71+ super .debugFillProperties (properties);
72+ properties.add (DiagnosticsProperty <Activity >('activity' , activity));
73+ }
6274}
0 commit comments