@@ -7,47 +7,83 @@ import 'package:date_time_format/date_time_format.dart';
7
7
import 'package:flutter/material.dart' ;
8
8
9
9
import 'package:hooks_riverpod/hooks_riverpod.dart' ;
10
+ import 'package:sidekick/utils/layout_size.dart' ;
10
11
11
12
class ChannelShowcase extends StatelessWidget {
12
13
final ChannelDto channel;
13
14
const ChannelShowcase (this .channel, {Key key}) : super (key: key);
14
15
15
16
@override
16
17
Widget build (BuildContext context) {
17
- return OutlinedButton (
18
- onPressed: () {
19
- context.read (selectedInfoProvider).selectVersion (channel);
20
- },
21
- child: Container (
22
- padding: const EdgeInsets .all (20 ),
23
- child: Row (
24
- crossAxisAlignment: CrossAxisAlignment .stretch,
25
- children: [
26
- Column (
27
- crossAxisAlignment: CrossAxisAlignment .start,
28
- mainAxisAlignment: MainAxisAlignment .center,
18
+ return Container (
19
+ decoration: BoxDecoration (
20
+ border: Border (
21
+ left: BorderSide (color: Theme .of (context).dividerColor),
22
+ bottom: BorderSide (color: Theme .of (context).dividerColor),
23
+ top: BorderSide (color: Theme .of (context).dividerColor),
24
+ // TODO: quite a hacky way to achieve this
25
+ right: channel.name == "dev"
26
+ ? BorderSide (color: Theme .of (context).dividerColor)
27
+ : BorderSide .none),
28
+ ),
29
+ child: OutlinedButton (
30
+ onPressed: () {
31
+ context.read (selectedInfoProvider).selectVersion (channel);
32
+ },
33
+ style: ButtonStyle (
34
+ shape: MaterialStateProperty .resolveWith (
35
+ (states) => const RoundedRectangleBorder (
36
+ borderRadius: BorderRadius .zero,
37
+ ),
38
+ ),
39
+ side: MaterialStateProperty .resolveWith ((states) => BorderSide .none),
40
+ ),
41
+ child: LayoutBuilder (builder: (context, layout) {
42
+ return Container (
43
+ padding: const EdgeInsets .all (20 ),
44
+ child: Row (
45
+ crossAxisAlignment: CrossAxisAlignment .stretch,
29
46
children: [
30
- Heading (channel.name),
31
- Subheading (channel.release.version),
32
- const SizedBox (height: 5 ),
33
- Caption (
34
- DateTimeFormat .relative (
35
- channel.release.releaseDate,
36
- appendIfAfter: 'ago' ,
37
- ),
47
+ Column (
48
+ crossAxisAlignment: CrossAxisAlignment .start,
49
+ mainAxisAlignment: MainAxisAlignment .center,
50
+ children: [
51
+ Heading (channel.name),
52
+ Tooltip (
53
+ message: channel.release.version,
54
+ child: ConstrainedBox (
55
+ constraints: const BoxConstraints (maxWidth: 65 ),
56
+ child: Text (
57
+ channel.release.version,
58
+ style: Theme .of (context).textTheme.subtitle1,
59
+ maxLines: 1 ,
60
+ overflow: TextOverflow .ellipsis,
61
+ ),
62
+ ),
63
+ ),
64
+ const SizedBox (height: 5 ),
65
+ Caption (
66
+ DateTimeFormat .relative (
67
+ channel.release.releaseDate,
68
+ appendIfAfter: 'ago' ,
69
+ ),
70
+ ),
71
+ ],
38
72
),
73
+ LayoutSize .isSmall ? Container () : const Spacer (),
74
+ LayoutSize .isSmall
75
+ ? Container ()
76
+ : Column (
77
+ mainAxisAlignment: MainAxisAlignment .center,
78
+ crossAxisAlignment: CrossAxisAlignment .end,
79
+ children: [
80
+ VersionInstallButton (channel),
81
+ ],
82
+ )
39
83
],
40
84
),
41
- const Spacer (),
42
- Column (
43
- mainAxisAlignment: MainAxisAlignment .center,
44
- crossAxisAlignment: CrossAxisAlignment .end,
45
- children: [
46
- VersionInstallButton (channel),
47
- ],
48
- )
49
- ],
50
- ),
85
+ );
86
+ }),
51
87
),
52
88
);
53
89
}
0 commit comments