Creating a screen that creates E-Signature and then uploading it to a file server and ofcourse renaming the file name

134 views
Skip to first unread message

potato gaming

unread,
Apr 9, 2021, 2:04:03 AM4/9/21
to Flutter Development (flutter-dev)
any answer will be of help thanks!

Suzuki Tomohiro

unread,
Apr 9, 2021, 8:07:48 AM4/9/21
to Flutter Development (flutter-dev)
What’s requirement for an E-signature? Is it a drawing?

On Fri, Apr 9, 2021 at 02:04 potato gaming <bbsq...@gmail.com> wrote:
any answer will be of help thanks!

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/c6d088d1-6ae3-4c16-873a-b1374dd50f07n%40googlegroups.com.

potato gaming

unread,
Apr 9, 2021, 8:10:30 PM4/9/21
to Flutter Development (flutter-dev)
yup, a drawing.

Suzuki Tomohiro

unread,
Apr 9, 2021, 8:32:33 PM4/9/21
to potato gaming, Flutter Development (flutter-dev)

potato gaming

unread,
Apr 11, 2021, 8:37:07 PM4/11/21
to Flutter Development (flutter-dev)
i already have this one. but the problem is i dont know how to save it to a file server. its from a tutorial site btw


import 'dart:typed_data';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:signature/signature.dart';

/// example widget showing how to use signature widget
class Sign extends StatefulWidget {
  @override
  _SignState createState() => _SignState();
}

class _SignState extends State<Sign> {
  final SignatureController _controller = SignatureController(
    penStrokeWidth: 1,
    penColor: Colors.red,
    exportBackgroundColor: Colors.blue,
  );

  @override
  void initState() {
    super.initState();
    _controller.addListener(() => print('Value changed'));
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Builder(
        builder: (BuildContext context) => Scaffold(
          body: ListView(
            children: <Widget>[
              Container(
                height: 300,
                child: const Center(
                  child: Text('Big container to test scrolling issues'),
                ),
              ),
              //SIGNATURE CANVAS
              Signature(
                controller: _controller,
                height: 300,
                backgroundColor: Colors.lightBlueAccent,
              ),
              //OK AND CLEAR BUTTONS
              Container(
                decoration: const BoxDecoration(color: Colors.black),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  mainAxisSize: MainAxisSize.max,
                  children: <Widget>[
                    //SHOW EXPORTED IMAGE IN NEW ROUTE
                    IconButton(
                      icon: const Icon(Icons.check),
                      color: Colors.blue,
                      onPressed: () async {
                        if (_controller.isNotEmpty) {
                          final Uint8List data = await _controller.toPngBytes();
                          await Navigator.of(context).push(
                            MaterialPageRoute<void>(
                              builder: (BuildContext context) {
                                return Scaffold(
                                  appBar: AppBar(),
                                  body: Center(
                                    child: Container(
                                      color: Colors.grey[300],
                                      child: Image.memory(data),
                                    ),
                                  ),
                                );
                              },
                            ),
                          );
                        }
                      },
                    ),
                    //CLEAR CANVAS
                    IconButton(
                      icon: const Icon(Icons.clear),
                      color: Colors.blue,
                      onPressed: () {
                        setState(() => _controller.clear());
                      },
                    ),
                  ],
                ),
              ),
              Container(
                height: 300,
                child: const Center(
                  child: Text('Big container to test scrolling issues'),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Suzuki Tomohiro

unread,
Apr 11, 2021, 8:50:17 PM4/11/21
to potato gaming, Flutter Development (flutter-dev)
Did the tutorial actually work for your use case?

For saving the file to your server, what do you need to do (authentication and file upload protocol)? If you don’t know, ask your teammates.

potato gaming

unread,
Apr 11, 2021, 8:54:54 PM4/11/21
to Suzuki Tomohiro, Flutter Development (flutter-dev)
yeah it is working. but i can only achieve the drawing and clear. i have no idea whatsoever if how can i get the result. then pass it to an uploading function. then to be inserted on a file server and be renamed. and sadly i dont have a team, i dont have any friends. im alone. haha.

Suzuki Tomohiro

unread,
Apr 11, 2021, 9:23:12 PM4/11/21
to potato gaming, Flutter Development (flutter-dev)
Nice can you try this? 

If that’s your solo project, what’s the authentication and protocol to upload? 

potato gaming

unread,
Apr 11, 2021, 9:39:27 PM4/11/21
to Suzuki Tomohiro, Flutter Development (flutter-dev)
i have done a basic login, my backend is php. the flow is like that in the attached file. 
just attach buttons to the function of upload. 
1.png

Suzuki Tomohiro

unread,
Apr 11, 2021, 9:45:01 PM4/11/21
to Flutter Development (flutter-dev)
Good. What’s the challenge now?

https://link.medium.com/1QViF85Nnfb explains widget to image conversion.

potato gaming

unread,
Apr 11, 2021, 9:56:40 PM4/11/21
to Suzuki Tomohiro, Flutter Development (flutter-dev)
the challenge is based on the code. i dont know how or what should i do to get the signature and then upload it on the fileserver.
im guessing that the "Image.memory(data)" is the one that i will upload right? if thats the case, my challenge is how haha.

















potato gaming

unread,
Apr 13, 2021, 3:43:49 AM4/13/21
to Suzuki Tomohiro, Flutter Development (flutter-dev)
up!

Suzuki Tomohiro

unread,
Apr 13, 2021, 7:19:24 AM4/13/21
to potato gaming, Flutter Development (flutter-dev)
my challenge is how haha

What’s haha?

potato gaming

unread,
Apr 19, 2021, 8:11:40 PM4/19/21
to Suzuki Tomohiro, Flutter Development (flutter-dev)
you misread it. i mean my challenge is "how". :)

Suzuki Tomohiro

unread,
Apr 19, 2021, 9:07:44 PM4/19/21
to potato gaming, Flutter Development (flutter-dev)
What’s the challenge now?
Reply all
Reply to author
Forward
0 new messages