Advertisement
pedroremedios

Untitled

Jul 18th, 2021
1,428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 3.59 KB | None | 0 0
  1. Container(
  2.           //width: MediaQuery.of(context).size.width * 0.85,
  3.           margin: EdgeInsets.only(
  4.               left: enableCarouselMode ? 8 : 16,
  5.               right: enableCarouselMode ? 8 : 16),
  6.           child: Column(
  7.             mainAxisSize: MainAxisSize.max,
  8.             crossAxisAlignment: CrossAxisAlignment.start,
  9.             mainAxisAlignment: MainAxisAlignment.start,
  10.             children: [
  11.               Container(
  12.                   margin: EdgeInsets.only(bottom: 16),
  13.                   child: ClipRRect(
  14.                     borderRadius: BorderRadius.all(Radius.circular(8)),
  15.                     child: Image.network(
  16.                       viewModel.itemImageURL,
  17.                       fit: BoxFit.cover,
  18.                       height: (MediaQuery.of(context).size.width * 0.85) * 0.56,
  19.                       width: enableCarouselMode
  20.                           ? MediaQuery.of(context).size.width * 0.85
  21.                           : MediaQuery.of(context).size.width,
  22.                     ),
  23.                   )),
  24.               Container(
  25.                 margin: EdgeInsets.only(bottom: 14),
  26.                 child: Text(viewModel.itemDate,
  27.                     style: GoogleFonts.cabin(
  28.                         color: Color(0xFF9F9F9F),
  29.                         fontSize: FontSize.small.size,
  30.                         fontWeight: FontWeight.w300)),
  31.               ),
  32.               titleHasHTML
  33.                   ? Html(data: viewModel.itemTitle, style: {
  34.                       "p": Style(
  35.                           fontFamily: "Cabin-Regular",
  36.                           fontSize: FontSize.xLarge,
  37.                           fontWeight: FontWeight.w700,
  38.                           color: Colors.white),
  39.                       "body": Style(
  40.                           margin: EdgeInsets.zero, padding: EdgeInsets.zero)
  41.                     })
  42.                   : Container(
  43.                       child: Text(viewModel.itemTitle,
  44.                           style: GoogleFonts.cabin(
  45.                               color: Colors.white,
  46.                               fontSize: FontSize.xLarge.size,
  47.                               fontWeight: FontWeight.w700),
  48.                           maxLines: 2),
  49.                     ),
  50.               Flexible(
  51.                 child: Container(
  52.                   //height: (MediaQuery.of(context).size.width * 0.85) * 0.30,
  53.                   child: Html(data: viewModel.itemExcerptText, customRender: {
  54.                     "p": (RenderContext context, Widget child) {
  55.                       Flexible(
  56.                         child: Text(
  57.                           context.parser.htmlData.text ?? "",
  58.                           maxLines: 4,
  59.                           overflow: TextOverflow.ellipsis,
  60.                         ),
  61.                       );
  62.                     }
  63.                   }, style: {
  64.                     "p": Style(
  65.                         fontFamily: "Cabin-Regular",
  66.                         fontSize: FontSize.large,
  67.                         fontWeight: FontWeight.w400,
  68.                         color: Color(0xFF9F9F9F),
  69.                         padding: EdgeInsets.zero,
  70.                         lineHeight: LineHeight(1.5),
  71.                         maxLines: 4,
  72.                         textOverflow: TextOverflow.ellipsis),
  73.                     "body": Style(
  74.                         margin: EdgeInsets.zero, padding: EdgeInsets.zero),
  75.                     "html":
  76.                         Style(margin: EdgeInsets.zero, padding: EdgeInsets.zero)
  77.                   }),
  78.                 ),
  79.               )
  80.             ],
  81.           ),
  82.         )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement