|
| 1 | +import 'package:flutter/material.dart'; |
| 2 | +import 'touchable.dart'; |
| 3 | + |
| 4 | +class Info extends StatelessWidget { |
| 5 | + Info({Key key, this.children}) : super(key: key); |
| 6 | + final List<Widget> children; |
| 7 | + @override |
| 8 | + Widget build(BuildContext context) { |
| 9 | + return Padding( |
| 10 | + padding: const EdgeInsets.only(top: 10), |
| 11 | + child: Row( |
| 12 | + children: children, |
| 13 | + ), |
| 14 | + ); |
| 15 | + } |
| 16 | +} |
| 17 | + |
| 18 | +class Meta extends StatelessWidget { |
| 19 | + Meta({Key key, this.text}) : super(key: key); |
| 20 | + final String text; |
| 21 | + @override |
| 22 | + Widget build(BuildContext context) { |
| 23 | + TextStyle textStyle = TextStyle(color: Color(0xFFCECECE), fontSize: 13); |
| 24 | + return Padding( |
| 25 | + padding: const EdgeInsets.only(right: 8), |
| 26 | + child: Text(text, style: textStyle), |
| 27 | + ); |
| 28 | + } |
| 29 | +} |
| 30 | + |
| 31 | +class MetaExtra extends StatelessWidget { |
| 32 | + MetaExtra({Key key, this.text}) : super(key: key); |
| 33 | + final String text; |
| 34 | + @override |
| 35 | + Widget build(BuildContext context) { |
| 36 | + TextStyle textStyle = TextStyle(color: Color(0xFFCECECE), fontSize: 13); |
| 37 | + return Container( |
| 38 | + padding: const EdgeInsets.only(left: 8), |
| 39 | + decoration: BoxDecoration(border: Border(left: BorderSide(color: const Color(0xffcecece)))), |
| 40 | + child: Text(text, style: textStyle), |
| 41 | + ); |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | +class MediaBox extends StatelessWidget { |
| 46 | + MediaBox({Key key, this.thumb, this.title = "", this.desc = "", this.info}) : super(key: key); |
| 47 | + final Widget thumb; |
| 48 | + final String title; |
| 49 | + final String desc; |
| 50 | + final Info info; |
| 51 | + |
| 52 | + @override |
| 53 | + Widget build(BuildContext context) { |
| 54 | + TextStyle titleStyle = TextStyle(fontSize: 17, fontWeight: FontWeight.w400, color: Colors.black); |
| 55 | + TextStyle descStyle = TextStyle(fontSize: 13, color: Color(0xFF808080)); |
| 56 | + return TouchableHighlight( |
| 57 | + child: Container( |
| 58 | + padding: const EdgeInsets.all(15), |
| 59 | + child: Column( |
| 60 | + children: <Widget>[ |
| 61 | + Row( |
| 62 | + children: <Widget>[ |
| 63 | + Offstage( |
| 64 | + child: Container( |
| 65 | + height: 60, |
| 66 | + width: 60, |
| 67 | + margin: const EdgeInsets.only(right: 10), |
| 68 | + child: thumb, |
| 69 | + ), |
| 70 | + offstage: thumb == null, |
| 71 | + ), |
| 72 | + Expanded( |
| 73 | + child: Column( |
| 74 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 75 | + children: <Widget>[Text(title, style: titleStyle), Text(desc, style: descStyle)], |
| 76 | + ), |
| 77 | + ) |
| 78 | + ], |
| 79 | + ), |
| 80 | + Offstage( |
| 81 | + child: info, |
| 82 | + offstage: info == null, |
| 83 | + ) |
| 84 | + ], |
| 85 | + ), |
| 86 | + ), |
| 87 | + ); |
| 88 | + } |
| 89 | +} |
0 commit comments