Skip to content

Instantly share code, notes, and snippets.

@tirth-aubergine
Created December 12, 2019 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tirth-aubergine/be39b28125dd8f906bd9975adbfb95d3 to your computer and use it in GitHub Desktop.
Save tirth-aubergine/be39b28125dd8f906bd9975adbfb95d3 to your computer and use it in GitHub Desktop.
Platypus - First Expanded widget (Editor)
Expanded(
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(12),
child: Screenshot(
controller: homeProvider.codeScreenshotController,
child: Container(
color: homeProvider.codeBackgroundColor,
padding: EdgeInsets.symmetric(
vertical: homeProvider
.verticalPaddingBetweenCodeAndBackground,
horizontal: homeProvider
.horizontalPaddingBetweenCodeAndBackground,
),
child: Container(
decoration: BoxDecoration(
boxShadow: [
homeProvider.showShadow
? BoxShadow(
color: Colors.black,
spreadRadius: 2,
blurRadius: 20,
)
: BoxShadow(),
],
color: themeMap[homeProvider.codeHighlightTheme]
['root']
.backgroundColor,
),
padding: EdgeInsets.all(16),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
ThreeCircles(),
homeProvider.isPreview
? Align(
alignment: Alignment.centerLeft,
child: HighlightView(
homeProvider
.codeTextEditingController.text,
language: homeProvider
.codeProgrammingLanguage,
theme: themeMap[
homeProvider.codeHighlightTheme],
padding: EdgeInsets.only(
top: 12, bottom: 12),
textStyle: TextStyle(
height:
homeProvider.codeLineHeight > 0
? homeProvider.codeLineHeight
: null,
fontSize: homeProvider.codeFontSize,
),
),
)
: TextFormField(
keyboardAppearance: Brightness.dark,
style: TextStyle(
height: homeProvider.codeLineHeight > 0
? homeProvider.codeLineHeight
: null,
fontSize: homeProvider.codeFontSize,
color: Colors.white,
fontFamily: 'monospace',
),
controller: homeProvider
.codeTextEditingController,
maxLines: 15,
),
],
),
),
),
),
),
),
),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment