Guest User

Untitled

a guest
Mar 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. abstract class EditorPageState extends NavigationPageState {
  2.  
  3. initState() {
  4. super.initState();
  5. var elements = widget.path.split('/');
  6. IconData icon;
  7.  
  8. navigationTree.add(
  9. Positioned(
  10. left: 0.0,
  11. right: 0.0,
  12. top: 0.0,
  13. bottom: 0.0,
  14. child: Hero(
  15. tag: "NavBarBackground",
  16. child: Container(
  17. color: ThemeColors.black,
  18. ),
  19. ),
  20. ),
  21. );
  22.  
  23. for (int i = 0; i < elements.length; i++) {
  24. switch (i) {
  25. case 0:
  26. icon = Icons.home;
  27. break;
  28. case 1:
  29. icon = Icons.book;
  30. break;
  31. case 2:
  32. icon = Icons.add_box;
  33. break;
  34. case 3:
  35. icon = Icons.pages;
  36. break;
  37. case 4:
  38. icon = Icons.list;
  39. break;
  40. case 5:
  41. icon = Icons.check;
  42. break;
  43. case 6:
  44. icon = Icons.note_add;
  45. break;
  46. case 7:
  47. icon = Icons.note;
  48. break;
  49. default:
  50. break;
  51. }
  52.  
  53. navigationTree.add(
  54. Positioned(
  55. top: i * 50.0,
  56. child: Hero(
  57. tag: i,
  58. child: Material(
  59. child: SizedBox(
  60. height: 50.0,
  61. width: 50.0,
  62. child: InkWell(
  63. onTap: goBackTo(i),
  64. child: Icon(icon),
  65. ),
  66. ),
  67. ),
  68. ),
  69. ),
  70. );
  71. }
  72.  
  73. navigationTree.add(
  74. Positioned(
  75. top: (elements.length * 50.0),
  76. left: 50.0,
  77. child: Hero(
  78. tag: elements.length,
  79. child: SizedBox(
  80. height: 50.0,
  81. width: 50.0,
  82. ),
  83. ),
  84. ),
  85. );
  86.  
  87. navigationTree.add(
  88. Positioned(
  89. top: (elements.length - 1) * 50.0,
  90. child: Hero(
  91. tag: "CurrentNavigationPosition",
  92. child: Container(
  93. width: 50.0,
  94. height: 50.0,
  95. color: ThemeColors.primaryTransparent,
  96. ),
  97. ),
  98. ),
  99. );
  100. }
  101. }
Add Comment
Please, Sign In to add comment