|
|
@ -6,6 +6,7 @@ import 'package:flutter_zxing/flutter_zxing.dart'; |
|
|
|
import 'package:flutter_zxing_example/configs/constants.dart'; |
|
|
|
import 'package:flutter_zxing_example/configs/constants.dart'; |
|
|
|
import 'package:flutter_zxing_example/models/encode.dart'; |
|
|
|
import 'package:flutter_zxing_example/models/encode.dart'; |
|
|
|
import 'package:flutter_zxing_example/utils/db_service.dart'; |
|
|
|
import 'package:flutter_zxing_example/utils/db_service.dart'; |
|
|
|
|
|
|
|
import 'package:flutter_zxing_example/utils/extensions.dart'; |
|
|
|
import 'package:flutter_zxing_example/widgets/common_widgets.dart'; |
|
|
|
import 'package:flutter_zxing_example/widgets/common_widgets.dart'; |
|
|
|
import 'package:path_provider/path_provider.dart'; |
|
|
|
import 'package:path_provider/path_provider.dart'; |
|
|
|
import 'package:share_plus/share_plus.dart'; |
|
|
|
import 'package:share_plus/share_plus.dart'; |
|
|
@ -51,7 +52,7 @@ class _CreatorPageState extends State<CreatorPage> { |
|
|
|
child: ContainerX( |
|
|
|
child: ContainerX( |
|
|
|
child: Column( |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
ZxingWriterWidget( |
|
|
|
WriterWidget( |
|
|
|
onSuccess: (result, bytes) { |
|
|
|
onSuccess: (result, bytes) { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
encode = Encode.fromEncodeResult(result, bytes); |
|
|
|
encode = Encode.fromEncodeResult(result, bytes); |
|
|
@ -61,18 +62,7 @@ class _CreatorPageState extends State<CreatorPage> { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
encode = null; |
|
|
|
encode = null; |
|
|
|
}); |
|
|
|
}); |
|
|
|
ScaffoldMessenger.of(context).hideCurrentSnackBar(); |
|
|
|
context.showToast(error); |
|
|
|
ScaffoldMessenger.of(context).showSnackBar( |
|
|
|
|
|
|
|
SnackBar( |
|
|
|
|
|
|
|
content: Padding( |
|
|
|
|
|
|
|
padding: const EdgeInsets.only(bottom: 30.0), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
error, |
|
|
|
|
|
|
|
textAlign: TextAlign.center, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
if (encode != null) buildWriteResult(), |
|
|
|
if (encode != null) buildWriteResult(), |
|
|
|