Line data Source code
1 : import 'package:flutter/material.dart'; 2 : import 'package:flutter/widgets.dart'; 3 : import 'package:google_fonts/google_fonts.dart'; 4 : import 'package:pal/src/ui/client/widgets/animated/animated_translate.dart'; 5 : import 'package:pal/src/ui/shared/helper_shared_viewmodels.dart'; 6 : 7 : class ReleaseNoteCell extends StatelessWidget { 8 : final int index; 9 : final HelperTextViewModel customLabel; 10 : final AnimationController animationController; 11 : final Curve positionCurve; 12 : final Curve opacityCurve; 13 : 14 1 : const ReleaseNoteCell({ 15 : Key key, 16 : @required this.index, 17 : @required this.customLabel, 18 : @required this.animationController, 19 : this.positionCurve, 20 : this.opacityCurve, 21 1 : }) : super(key: key); 22 : 23 1 : @override 24 : Widget build(BuildContext context) { 25 2 : Color fontColorDefault = this.customLabel.fontColor ?? Colors.white; 26 2 : double fontSizeDefault = this.customLabel.fontSize ?? 15.0; 27 : FontWeight fontWeightDefault = 28 2 : this.customLabel.fontWeight ?? FontWeight.normal; 29 2 : String fontFamilyDefault = this.customLabel.fontFamily ?? 'Montserrat'; 30 : 31 1 : return Padding( 32 : padding: const EdgeInsets.only(bottom: 8.0), 33 1 : child: AnimatedTranslateWidget( 34 1 : animationController: animationController, 35 1 : positionCurve: positionCurve, 36 1 : opacityCurve: opacityCurve, 37 1 : widget: RichText( 38 3 : key: ValueKey('pal_UserUpdateHelperWidget_ReleaseNotes_List_$index'), 39 : textAlign: TextAlign.center, 40 1 : text: TextSpan( 41 : text: '• ', 42 1 : style: TextStyle( 43 : color: fontColorDefault, 44 : fontSize: fontSizeDefault, 45 : fontWeight: FontWeight.w900, 46 1 : ).merge( 47 1 : GoogleFonts.getFont(fontFamilyDefault), 48 : ), 49 1 : children: <TextSpan>[ 50 1 : TextSpan( 51 2 : text: this.customLabel.text, 52 1 : style: TextStyle( 53 : color: fontColorDefault, 54 : fontSize: fontSizeDefault, 55 : fontWeight: fontWeightDefault, 56 1 : ).merge( 57 1 : GoogleFonts.getFont(fontFamilyDefault), 58 : ), 59 : ), 60 : ], 61 : ), 62 : ), 63 : ), 64 : ); 65 : } 66 : }