|
|
|
@ -1,6 +1,7 @@
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:signature/signature.dart';
|
|
|
|
import 'package:signature/signature.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
@ -15,6 +16,7 @@ class ESignature extends StatefulWidget {
|
|
|
|
final Function(Uint8List) onSaved;
|
|
|
|
final Function(Uint8List) onSaved;
|
|
|
|
final Function(Uint8List) onChange;
|
|
|
|
final Function(Uint8List) onChange;
|
|
|
|
final String title;
|
|
|
|
final String title;
|
|
|
|
|
|
|
|
|
|
|
|
const ESignature({Key key, this.title, this.oldSignature, this.onSaved, this.onChange, this.newSignature}) : super(key: key);
|
|
|
|
const ESignature({Key key, this.title, this.oldSignature, this.onSaved, this.onChange, this.newSignature}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
@ -50,6 +52,7 @@ class _ESignatureState extends State<ESignature> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
print(widget.oldSignature);
|
|
|
|
return FormField<String>(onSaved: (_) async {
|
|
|
|
return FormField<String>(onSaved: (_) async {
|
|
|
|
widget.onSaved(signature);
|
|
|
|
widget.onSaved(signature);
|
|
|
|
}, builder: (FormFieldState<String> state) {
|
|
|
|
}, builder: (FormFieldState<String> state) {
|
|
|
|
@ -98,7 +101,7 @@ class _ESignatureState extends State<ESignature> {
|
|
|
|
height: 135.toScreenHeight,
|
|
|
|
height: 135.toScreenHeight,
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
padding: const EdgeInsets.only(bottom: 8),
|
|
|
|
padding: const EdgeInsets.only(bottom: 8),
|
|
|
|
child: signature != null ? Image.memory(signature) : ImageLoader(boxFit: BoxFit.contain, url: widget.oldSignature),
|
|
|
|
child: signature != null ? Image.memory(signature) : ImageLoader(boxFit: BoxFit.contain, url: URLs.getFileUrl(widget.oldSignature)),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: AbsorbPointer(
|
|
|
|
: AbsorbPointer(
|
|
|
|
absorbing: !_editable,
|
|
|
|
absorbing: !_editable,
|
|
|
|
|