Skip to content

Commit 134e39b

Browse files
committed
Modularised new folder
1 parent 166695c commit 134e39b

File tree

1 file changed

+38
-26
lines changed

1 file changed

+38
-26
lines changed

lib/screens/new/new_service_screen.dart

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -300,34 +300,22 @@ class NewServiceScreen extends StatelessWidget {
300300
color: desaturatedGreyColor,
301301
child: Column(
302302
children: [
303-
Row(
304-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
305-
children: [
306-
Text(
307-
'Subtotal (XAF): ',
308-
style: captionTextStyle
309-
.merge(TextStyle(color: lightGreyColor)),
310-
),
311-
Expanded(
312-
child: Text(
313-
'0',
314-
textAlign: TextAlign.end,
315-
style: captionTextStyle
316-
.merge(TextStyle(color: lightGreyColor)),
317-
),
318-
),
319-
],
303+
_buildRowPrice(
304+
title: 'Subtotal (XAF): ',
305+
price: '0',
306+
titleTextStyle: captionTextStyle.merge(
307+
TextStyle(color: lightGreyColor),
308+
),
309+
priceTextStyle: captionTextStyle.merge(
310+
TextStyle(color: lightGreyColor),
311+
),
320312
),
321313
SizedBox(height: 10),
322-
Row(
323-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
324-
children: [
325-
Text('Total (XAF): ', style: bodyBoldTextStyle),
326-
Expanded(
327-
child: Text('0',
328-
textAlign: TextAlign.end, style: bodyBoldTextStyle),
329-
),
330-
],
314+
_buildRowPrice(
315+
title: 'Total (XAF): ',
316+
price: '0',
317+
titleTextStyle: bodyBoldTextStyle,
318+
priceTextStyle: bodyBoldTextStyle,
331319
),
332320
SizedBox(height: 20),
333321
InkWell(
@@ -353,4 +341,28 @@ class NewServiceScreen extends StatelessWidget {
353341
],
354342
);
355343
}
344+
345+
Widget _buildRowPrice({
346+
required String title,
347+
required String price,
348+
required TextStyle titleTextStyle,
349+
required TextStyle priceTextStyle,
350+
}) {
351+
return Row(
352+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
353+
children: [
354+
Text(
355+
title,
356+
style: titleTextStyle,
357+
),
358+
Expanded(
359+
child: Text(
360+
price,
361+
textAlign: TextAlign.end,
362+
style: priceTextStyle,
363+
),
364+
),
365+
],
366+
);
367+
}
356368
}

0 commit comments

Comments
 (0)