Skip to content

Instantly share code, notes, and snippets.

@shivanchalaeologic
Last active August 2, 2020 05:36
Show Gist options
  • Save shivanchalaeologic/1c0b1e0ed8a414e5e364004e222a31c5 to your computer and use it in GitHub Desktop.
Save shivanchalaeologic/1c0b1e0ed8a414e5e364004e222a31c5 to your computer and use it in GitHub Desktop.
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