-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [MDS-800] Make relevant changes to use the latest moon_icons_fl…
…utter library in moon_flutter (#287)
- Loading branch information
Showing
28 changed files
with
247 additions
and
1,365 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import 'package:example/src/storybook/common/widgets/text_divider.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class IconsSegment extends StatelessWidget { | ||
final Map<String, IconData> segmentMap; | ||
|
||
const IconsSegment({ | ||
super.key, | ||
required this.segmentMap, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
String createSegmentTitle(String text) { | ||
final String title = text.split('_').first; | ||
return title[0].toUpperCase() + title.substring(1); | ||
} | ||
|
||
return SliverPadding( | ||
padding: const EdgeInsets.symmetric(vertical: 64.0, horizontal: 16.0), | ||
sliver: SliverMainAxisGroup( | ||
slivers: [ | ||
SliverToBoxAdapter( | ||
child: TextDivider(text: createSegmentTitle(segmentMap.keys.first)), | ||
), | ||
SliverGrid.builder( | ||
itemCount: segmentMap.length, | ||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( | ||
crossAxisCount: 3, | ||
crossAxisSpacing: 8, | ||
mainAxisExtent: 104, | ||
), | ||
itemBuilder: (BuildContext context, int index) { | ||
return Column( | ||
mainAxisSize: MainAxisSize.min, | ||
mainAxisAlignment: MainAxisAlignment.end, | ||
children: [ | ||
if (segmentMap.keys.toList()[index].contains("16")) | ||
Icon(segmentMap.values.toList()[index], size: 16) | ||
else if (segmentMap.keys.toList()[index].contains("24")) | ||
Icon(segmentMap.values.toList()[index], size: 24) | ||
else | ||
Icon(segmentMap.values.toList()[index], size: 32), | ||
const SizedBox(height: 20), | ||
Text( | ||
segmentMap.keys.toList()[index], | ||
style: TextStyle( | ||
fontSize: 12, | ||
color: Colors.grey[600], | ||
), | ||
), | ||
], | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.