Skip to content

Commit

Permalink
[Presentation] Added missing electro icon in the "Elements" section
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfteam committed May 12, 2021
1 parent c0c7033 commit 132676a
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions lib/presentation/home/widgets/sliver_elements_card.dart
Expand Up @@ -15,32 +15,23 @@ class SliverElementsCard extends StatelessWidget {
clipBehavior: Clip.hardEdge,
margin: Styles.edgeInsetAll15,
shape: RoundedRectangleBorder(borderRadius: Styles.homeCardItemBorderRadius),
child: SizedBox(
height: 170,
child: Stack(
alignment: Alignment.center,
children: [
_buildIcon(ElementType.anemo, const Offset(0, -1)),
_buildIcon(ElementType.cryo, const Offset(-1.4, -0.6)),
_buildIcon(ElementType.dendro, const Offset(-1.4, 0.6)),
_buildIcon(ElementType.geo, const Offset(0, 1)),
_buildIcon(ElementType.hydro, const Offset(1.4, -0.6)),
_buildIcon(ElementType.pyro, const Offset(1.4, 0.6)),
],
child: Container(
margin: const EdgeInsets.symmetric(vertical: 10),
constraints: const BoxConstraints(minHeight: 80),
child: Wrap(
runAlignment: WrapAlignment.center,
alignment: WrapAlignment.center,
crossAxisAlignment: WrapCrossAlignment.center,
children: ElementType.values
.map((type) => Padding(padding: const EdgeInsets.symmetric(horizontal: 5), child: ElementImage.fromType(type: type)))
.toList(),
),
),
),
),
);
}

Widget _buildIcon(ElementType type, Offset offset) {
return FractionalTranslation(
translation: offset,
child: ElementImage.fromType(type: type),
);
}

Future<void> _gotoElementsPage(BuildContext context) async {
await Navigator.push(context, MaterialPageRoute(builder: (c) => ElementsPage()));
}
Expand Down

0 comments on commit 132676a

Please sign in to comment.