|
|
@ -84,17 +84,28 @@ class _CreatorPageState extends State<CreatorPage> { |
|
|
|
Row( |
|
|
|
Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
|
|
|
children: <Widget>[ |
|
|
|
children: <Widget>[ |
|
|
|
ElevatedButton( |
|
|
|
Builder(builder: (BuildContext context) { |
|
|
|
|
|
|
|
return ElevatedButton( |
|
|
|
onPressed: () { |
|
|
|
onPressed: () { |
|
|
|
// Save image to device |
|
|
|
// Save image to device |
|
|
|
final File file = File(tempPath); |
|
|
|
final File file = File(tempPath); |
|
|
|
file.writeAsBytesSync(encode?.data ?? Uint8List(0)); |
|
|
|
file.writeAsBytesSync(encode?.data ?? Uint8List(0)); |
|
|
|
final String path = file.path; |
|
|
|
final String path = file.path; |
|
|
|
|
|
|
|
|
|
|
|
// Share image |
|
|
|
// Share image |
|
|
|
Share.shareFiles(<String>[path]); |
|
|
|
final RenderBox? box = |
|
|
|
|
|
|
|
context.findRenderObject() as RenderBox?; |
|
|
|
|
|
|
|
if (box != null) { |
|
|
|
|
|
|
|
Share.shareFiles( |
|
|
|
|
|
|
|
<String>[path], |
|
|
|
|
|
|
|
sharePositionOrigin: |
|
|
|
|
|
|
|
box.localToGlobal(Offset.zero) & box.size, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: const Text('Share'), |
|
|
|
child: const Text('Share'), |
|
|
|
), |
|
|
|
); |
|
|
|
|
|
|
|
}), |
|
|
|
ElevatedButton( |
|
|
|
ElevatedButton( |
|
|
|
onPressed: () async { |
|
|
|
onPressed: () async { |
|
|
|
if (encode != null) { |
|
|
|
if (encode != null) { |
|
|
|