Created
July 7, 2021 20:01
-
-
Save unacorbatanegra/9fb86142cca94deaa7d0491b4746da46 to your computer and use it in GitHub Desktop.
stepper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:cryptericon/common.dart'; | |
class StatusStepper extends StatelessWidget { | |
final List<DocumentStatus> status; | |
const StatusStepper({ | |
Key? key, | |
required this.status, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Row( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
Column( | |
children: List.generate( | |
status.length, | |
(index) { | |
if (index == 0) { | |
return _Step(status: getDocumentStatus(status[index])); | |
} | |
return Column( | |
children: List.generate( | |
7, | |
(idx) { | |
if (idx == 6) { | |
return _Step(status: getDocumentStatus(status[index])); | |
} | |
return _MiniStep(); | |
}, | |
), | |
); | |
}, | |
), | |
// ); | |
).paddingOnly(top: 4.0), | |
kGap8, | |
Expanded( | |
child: Column( | |
children: List.generate( | |
status.length, | |
(index) => _StepData(status: getDocumentStatus(status[index])), | |
), | |
), | |
), | |
], | |
); | |
} | |
} | |
class _MiniStep extends StatelessWidget { | |
const _MiniStep({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
width: 2, | |
height: 2, | |
margin: const EdgeInsets.all(1.0), | |
decoration: BoxDecoration( | |
shape: BoxShape.circle, | |
boxShadow: [ | |
BoxShadow( | |
color: const Color(0x29000000), | |
offset: Offset(0, 0), | |
blurRadius: 2, | |
spreadRadius: 0, | |
) | |
], | |
color: AppColors.identificationNewRequestColor, | |
), | |
); | |
} | |
} | |
class _Step extends StatelessWidget { | |
final DocumentStatusVo status; | |
const _Step({ | |
Key? key, | |
required this.status, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
width: 8, | |
height: 8, | |
margin: const EdgeInsets.all(4.0), | |
decoration: BoxDecoration( | |
shape: BoxShape.circle, | |
boxShadow: [ | |
BoxShadow( | |
color: const Color(0x29000000), | |
offset: Offset(0, 0), | |
blurRadius: 2, | |
spreadRadius: 0, | |
) | |
], | |
color: status.color, | |
), | |
); | |
} | |
} | |
class _StepData extends StatelessWidget { | |
final DocumentStatusVo status; | |
const _StepData({ | |
Key? key, | |
required this.status, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Row( | |
crossAxisAlignment: CrossAxisAlignment.center, | |
children: [ | |
Icon( | |
status.icon, | |
color: status.color, | |
size: 18, | |
), | |
kGap8, | |
Expanded( | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: [ | |
Flexible( | |
child: Text( | |
status.name, | |
style: Styles.documentStatus.copyWith(color: status.color), | |
), | |
), | |
Flexible( | |
child: Text.rich( | |
TextSpan( | |
text: '13.04.2021 ', | |
style: Styles.documentStatusDate, | |
children: [ | |
TextSpan( | |
text: '23:50:13', | |
style: Styles.documentStatusHour, | |
), | |
], | |
), | |
), | |
) | |
], | |
), | |
), | |
], | |
).paddingOnly(bottom: 24); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment