Created
July 24, 2019 12:32
-
-
Save gladimdim/5b419d7178b654f846ea1fb14d25404c to your computer and use it in GitHub Desktop.
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
Expanded( | |
child: SingleChildScrollView( | |
controller: _passageScrollController, | |
child: Column( | |
children: [ | |
...widget.currentStory.storyHistory.getHistory().map((var passageItem) { | |
if (passageItem == null) { | |
return Container(); | |
} | |
Widget container; | |
switch (passageItem.type) { | |
case PassageTypes.IMAGE: | |
container = BorderedRandomImageByPath(passageItem.value); | |
break; | |
case PassageTypes.TEXT: | |
container = Container( | |
alignment: Alignment.topCenter, | |
padding: EdgeInsets.all(8.0), | |
margin: EdgeInsets.all(8.0), | |
width: MediaQuery.of(context).size.width * 0.95, | |
decoration: BoxDecoration( | |
color: Theme.of(context).backgroundColor, | |
border: Border.all( | |
color: Theme.of(context).primaryColor, | |
width: 3.0, | |
), | |
), | |
child: Text( | |
passageItem.value == "" ? "Початок" : passageItem.value, | |
style: TextStyle( | |
fontFamily: "Raleway-Bold", | |
fontSize: 18, | |
), | |
), | |
); | |
} | |
return container; | |
}), | |
if (widget.currentStory.theEnd || widget.currentStory.toBeContinued) | |
..._buildTheEnd(context), | |
], | |
), | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment