Skip to content

Commit c76c394

Browse files
Sandip KakadiyaSandip Kakadiya
authored andcommitted
typography code formatted
1 parent c5226a7 commit c76c394

1 file changed

Lines changed: 73 additions & 68 deletions

File tree

lib/components/typography/gf_typography.dart

Lines changed: 73 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ import 'package:getflutter/getflutter.dart';
44
class GFTypography extends StatelessWidget {
55
/// Creates simple title with underline. Style of title can be changed using [GFTypographyType]
66
/// showDivider is default true, can be set false.
7-
const GFTypography(
8-
{Key key,
9-
this.type = GFTypographyType.typo4,
10-
this.child,
11-
this.text,
12-
this.icon,
13-
this.dividerBorderRadius,
14-
this.textColor,
15-
this.dividerAlignment,
16-
this.dividerColor,
17-
this.showDivider = true,
18-
this.dividerWidth,
19-
this.backgroundImage,
20-
this.backgroundImagecolorFilter})
21-
: super(key: key);
7+
const GFTypography({
8+
Key key,
9+
this.type = GFTypographyType.typo4,
10+
this.child,
11+
this.text,
12+
this.icon,
13+
this.dividerBorderRadius,
14+
this.textColor,
15+
this.dividerAlignment,
16+
this.dividerColor,
17+
this.showDivider = true,
18+
this.dividerWidth,
19+
this.backgroundImage,
20+
this.backgroundImagecolorFilter,
21+
}) : super(key: key);
2222

2323
/// child of type [Widget] is alternative to text key. text will get priority over child
2424
final Widget child;
@@ -76,62 +76,67 @@ class GFTypography extends StatelessWidget {
7676
}
7777

7878
return Container(
79-
padding: EdgeInsets.all(backgroundImage != null ? 10 : 0),
80-
decoration: BoxDecoration(
81-
image: backgroundImage != null
82-
? DecorationImage(
83-
image: backgroundImage,
84-
fit: BoxFit.cover,
85-
colorFilter: backgroundImagecolorFilter ??
86-
ColorFilter.mode(Colors.black54, BlendMode.darken),
87-
)
88-
: null,
89-
),
90-
child: Column(
91-
crossAxisAlignment: CrossAxisAlignment.start,
92-
children: <Widget>[
93-
Row(
94-
children: <Widget>[
95-
icon != null ? icon : Container(),
96-
icon != null
97-
? Padding(padding: EdgeInsets.only(left: 10))
98-
: Container(),
99-
text != null
100-
? Expanded(
101-
child: Text(
102-
text,
103-
style: TextStyle(
104-
color: textColor != null
105-
? GFColors.getGFColor(textColor)
106-
: backgroundImage != null
107-
? Colors.white
108-
: Colors.black,
109-
fontSize: fontSize,
110-
letterSpacing: 0.3,
111-
fontWeight: FontWeight.w500),
112-
))
113-
: child
114-
],
115-
),
116-
showDivider
117-
? Container(
118-
margin: EdgeInsets.only(top: 3, bottom: 3),
119-
alignment: dividerAlignment,
120-
child: Container(
121-
width: dividerWidth != null ? dividerWidth : 70,
122-
height: fontSize / 5,
123-
decoration: BoxDecoration(
124-
color: dividerColor != null
125-
? GFColors.getGFColor(dividerColor)
79+
padding: EdgeInsets.all(backgroundImage != null ? 10 : 0),
80+
decoration: BoxDecoration(
81+
image: backgroundImage != null
82+
? DecorationImage(
83+
image: backgroundImage,
84+
fit: BoxFit.cover,
85+
colorFilter: backgroundImagecolorFilter ??
86+
ColorFilter.mode(Colors.black54, BlendMode.darken),
87+
)
88+
: null,
89+
),
90+
child: Column(
91+
crossAxisAlignment: CrossAxisAlignment.start,
92+
children: <Widget>[
93+
Row(
94+
children: <Widget>[
95+
icon ?? Container(),
96+
icon != null
97+
? const Padding(padding: EdgeInsets.only(left: 10))
98+
: Container(),
99+
text != null
100+
? Expanded(
101+
child: Text(
102+
text,
103+
style: TextStyle(
104+
color: textColor != null
105+
? GFColors.getGFColor(textColor)
126106
: backgroundImage != null
127107
? Colors.white
128108
: Colors.black,
129-
borderRadius: dividerBorderRadius != null
130-
? dividerBorderRadius
131-
: BorderRadius.all(Radius.circular(5))),
109+
fontSize: fontSize,
110+
letterSpacing: 0.3,
111+
fontWeight: FontWeight.w500),
132112
))
133-
: Container()
134-
],
135-
));
113+
: child
114+
],
115+
),
116+
showDivider
117+
? Container(
118+
margin: const EdgeInsets.only(top: 3, bottom: 3),
119+
alignment: dividerAlignment,
120+
child: Container(
121+
width: dividerWidth != null ? dividerWidth : 70,
122+
height: fontSize / 5,
123+
decoration: BoxDecoration(
124+
color: dividerColor != null
125+
? GFColors.getGFColor(dividerColor)
126+
: backgroundImage != null
127+
? Colors.white
128+
: Colors.black,
129+
borderRadius: dividerBorderRadius != null
130+
? dividerBorderRadius
131+
: const BorderRadius.all(
132+
Radius.circular(5),
133+
),
134+
),
135+
),
136+
)
137+
: Container()
138+
],
139+
),
140+
);
136141
}
137142
}

0 commit comments

Comments
 (0)