Added option to share the app via qr-code

This commit is contained in:
2023-09-17 17:41:37 +02:00
parent 7b18fed51d
commit a479fc5ebd
6 changed files with 132 additions and 17 deletions

View File

@ -0,0 +1,41 @@
import 'package:flutter/material.dart';
import 'package:qr_flutter/qr_flutter.dart';
class AppSharePlatformView extends StatelessWidget {
final String title;
final String url;
const AppSharePlatformView(this.title, this.url, {super.key});
@override
Widget build(BuildContext context) {
Color foregroundColor = Theme.of(context).colorScheme.onBackground;
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(title, style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
const SizedBox(height: 30),
Container(
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(color: foregroundColor, width: 10),
),
child: QrImageView(
data: url,
version: QrVersions.auto,
size: 200,
dataModuleStyle: QrDataModuleStyle(
color: foregroundColor,
dataModuleShape: QrDataModuleShape.square
),
eyeStyle: QrEyeStyle(
color: foregroundColor,
eyeShape: QrEyeShape.square,
),
),
),
],
);
}
}