-
-
Save shivanchalaeologic/1c0b1e0ed8a414e5e364004e222a31c5 to your computer and use it in GitHub Desktop.
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
import 'package:dough/dough.dart'; | |
import 'package:flutter/material.dart'; | |
class PressableDoughDemo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
centerContainer() => Container( | |
width: 100, | |
height: 100, | |
child: Center( | |
child: Text( | |
'Drag me around!', | |
textAlign: TextAlign.center, | |
style: Theme.of(context).accentTextTheme.bodyText2, | |
), | |
), | |
decoration: BoxDecoration( | |
color: Colors.green, | |
borderRadius: BorderRadius.circular(10), | |
), | |
); | |
doughCenterContainer() => DoughRecipe( | |
data: DoughRecipeData( | |
viscosity: 7000, | |
expansion: 1.025, | |
), | |
child: PressableDough( | |
child: centerContainer(), | |
onReleased: (details) {}, | |
), | |
); | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Pressable Dough'), | |
), | |
body: Center( | |
child: doughCenterContainer(), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment