Giter VIP home page Giter VIP logo

davinci's Introduction

Hi , I'm Sai Gokula Krishnan

I code stuff

  • πŸ”­ I’m currently building EventFlux, Davinci, Anim Search Bar and InitialCommit

  • 🌱 I’m currently learning Swift, Typescript

  • πŸ‘¨β€πŸ’» Check out my portfolio, Gokula.dev

  • πŸ’¬ Ask me about Flutter, Dart, Swift

  • πŸ“« How to reach me? [email protected]

  • I'm most comfortable in that weird, funky world between design and developmentβ€”that's where the most fun, creative, boundary-breaking work happens.

Languages and Tools:

flutter dart firebase git swift swift swift

davinci's People

Contributors

coronon avatar gsoykan avatar imgkl avatar mhbdev avatar microprogramer avatar saigkl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

davinci's Issues

Error: Undefined name 'View'.

Using davinci and Flutter version 3.7.0 (FVM) I'm getting this error undefined name "View"

Output
Launching lib\main.dart on TECNO KD7 in debug mode...
main.dart:1
: Error: Undefined name 'View'.
davinci_capture.dart:31
pixelRatio ??= View.of(context).devicePixelRatio;
^^^^
: Error: Undefined name 'View'.
davinci_capture.dart:80
View.of(context).physicalSize / View.of(context).devicePixelRatio;

    ^^^^

: Error: Undefined name 'View'.
davinci_capture.dart:80
View.of(context).physicalSize / View.of(context).devicePixelRatio;

                                    ^^^^

: Error: Undefined name 'View'.
davinci_capture.dart:81
pixelRatio ??= View.of(context).devicePixelRatio;

               ^^^^

: Error: Undefined name 'View'.
davinci_capture.dart:84
view: View.of(context),

          ^^^^

: Error: No named parameter with the name 'view'.
davinci_capture.dart:84
view: View.of(context),
^^^^
: Context: Found this candidate, but the arguments don't match.
view.dart:68
RenderView({
^^^^^^^^^^
Target kernel_snapshot failed: Exception
2

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\Users\Dammy Richie\fvm\versions\3.7.0\packages\flutter_tools\gradle\flutter.gradle' line: 1151

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\Users\Dammy Richie\fvm\versions\3.7.0\bin\flutter.bat'' finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 14s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Flutter 3.10.0 ui.window issue

Using Davinci 2.0.10 and Flutter 3.10.0 and getting this error building my app on android.

/C:/Users/MonoBit/AppData/Local/Pub/Cache/hosted/pub.dev/davinci-2.0.10/lib/core/davinci_capture.dart:79:9: Error: No named parameter with the name 'window'.
        window: ui.window,
        ^^^^^^
/C:/FlutterStable/flutter/packages/flutter/lib/src/rendering/view.dart:68:3: Context: Found this candidate, but the arguments don't match.
  RenderView({
  ^^^^^^^^^^

DavinciCapture.offStage is Producting Black Screenshot

            Button(
                      onPress: () async {
                        try {
                          var ssResult = await DavinciCapture.offStage(
                            WidgetToPrint( ),
                            returnImageUint8List: true,
                          );
                          final directory =
                              await getApplicationDocumentsDirectory();
                          final imagePath =
                              await File('${directory.path}/image.png')
                                  .create();
                          imagePath.writeAsBytes(ssResult);
                          Share.shareFiles([imagePath.path], text: "SS");
                        } catch (e) {
                          ScaffoldMessenger.of(context).showSnackBar(
                              SnackBar(content: Text("Fail To Share SS $e")));
                        }
                      },
                    ),

This generates a completly black Screenshot.

Error: No named parameter with the name 'size'. size: logicalSize. Flutter 3.2+ and Davinci 2.1.1 issue

Using Davinci 2.1.1 and Flutter 3.2.0 and getting this error building my app for web.

../../../.pub-cache/hosted/pub.dev/davinci-2.1.1/lib/core/davinci_capture.dart:88:11: Error: No named parameter with the name 'size'. size: logicalSize, ^^^^ ../../../Library/flutter/packages/flutter/lib/src/rendering/view.dart:28:9: Info: Found this candidate, but the arguments don't match. const ViewConfiguration({ ^^^^^^^^^^^^^^^^^
Anyone having this issue? It is now preventing me to release :(

`DavinciCapture.click` returning `null`

Hi! Firstly, thank you for your awesome package :bowtie:

Problem

I am trying to get the Uint8List data from the DavinciCapture.click on the initState of an StatefulWidget like this:

WidgetsBinding.instance!.addPostFrameCallback((timeStamp) async {
      if (mounted && pictureKey.isNotNull) {
        
        pictureBytes = await DavinciCapture.click(
          pictureKey!,
          fileName: 'diven',
          returnImageUint8List: true,
          openFilePreview: false,
          saveToDevice: false,
        );

      }
    });

but pictureBytes is always null. Am I doing something wrong? Is it a bug?

Full Widget code
class ShareModal extends StatefulWidget {
  const ShareModal({Key? key, required this.plan}) : super(key: key);

  final PlanDTO plan;

  @override
  _ShareModalState createState() => _ShareModalState();
}

class _ShareModalState extends State<ShareModal> with Utils, ShareableMixin {
  late final Future<Uri> uri;
  bool isLinkLoading = true;
  Uri? url;

  bool isScreenshotLoading = true;
  late Widget widgetPreview;
  // late final Future<dynamic> picture;
  Uint8List? pictureBytes;
  GlobalKey? pictureKey;

  @override
  void initState() {
    super.initState();

    uri = generatePlanLink(plan: widget.plan);
    uri.whenComplete(
      () async {
        if (mounted) {
          url = (await uri);
          setState(() {
            isLinkLoading = false;
          });
        }
      },
    );

    WidgetsBinding.instance!.addPostFrameCallback((_) async {
      if (mounted && pictureKey.isNotNull) {
        pictureBytes = await DavinciCapture.click(
          pictureKey!,
          fileName: 'diven',
          returnImageUint8List: true,
          openFilePreview: false,
          saveToDevice: false,
        );
      }
    });
  }

  @override
  Widget build(BuildContext context) {
    final imageHeight = context.screen.height * .7;
    return ListView(
      physics: const NeverScrollableScrollPhysics(),
      shrinkWrap: true,
      padding: const EdgeInsets.symmetric(horizontal: 10.0),
      children: [
        if (isScreenshotLoading)
          Davinci(
            builder: (key) {
              pictureKey = key;

              return _PlanSharePreview(
                plan: widget.plan,
              );
            },
          )
        else
          Center(
            child: ScaleOnTap(
              onTap: () => context.navigator.push(
                HeroDialogRoute(
                  builder: (_) => HeroInteractiveViewerDialog(
                      tag: 'planPreview', child: Image.memory(pictureBytes!)),
                ),
              ),
              child: Hero(
                tag: 'planPreview',
                child: Image.memory(
                  pictureBytes!,
                  height: imageHeight,
                ),
              ),
            ),
          ),
        const SizedBox(
          height: 10,
        ),
        ...
      ],
    );
  }
}

Environment

Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel stable, 2.0.4, on macOS 11.1 20C69 darwin-x64, locale es-ES)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[βœ“] Xcode - develop for iOS and macOS
[βœ“] Chrome - develop for the web
[βœ“] Android Studio (version 4.1)
[βœ“] VS Code (version 1.58.2)
[βœ“] Connected device (2 available)

β€’ No issues found!

Version

davinci: ^2.0.5

How to use this Plugin in ListView Builder

This is My HomeScreen,

homepage

There is the More Button, Which Captures the ScreenShot. code

I can Easily with the Plugin Capture ScreenShot, But the Issue Coming is when I added the New Element the Plugin Captures the Screenshot of new element and when I add again a new element the plugin captures the screenshot the new one and forgets about the old. like this,

last photo

Support Dart 3 [ANALYSIS ISSUE]

Error: No named parameter with the name 'window'.
window: ui.window,
^^^^^^
Flutter Version 3.10.0 Dart version 3.0.0
Breaking Changes: Window singleton is deprecated in preparation for multi-window support. Android Studio's Flamingo upgrade might cause some errors due to Java SDK and Gradle version mismatch.

Black Border with the Image?

The Plugin is very beautiful it removed my major issues and there is always big praise to its creators,
I always Believe in this kind of Humanful - Opensource. My Experience with this Opensource is very beautiful.
And I am also dedicated to helping grow this Plugin, Amen.

My Issue
When I am Capturing Something, it is giving a black border as outputs,
How can I fix these?

i love opensource

Unable to save offstage images without openFilePreview

When offstage is used with these options. it works as expected, previews the image and saves a new file.

        openFilePreview: true,
        returnImageUint8List: false,
        saveToDevice: true

But I just want to save the file and not preview it. So when I turn openFilePreview=false. Not only is the preview gone. But the file isn't being saved. Expected behavior: No Preview and local saved file.

        openFilePreview: false,
        returnImageUint8List: true,
        saveToDevice: true

I even tired to get the Uint8List in return to manually save. But the object returned null.

        openFilePreview: false,
        returnImageUint8List: true,
        saveToDevice: false

Just save generated images

It is only possible to choose between return uint8 list and open preview.
There is no way to just save the file.

I know that having the uint8list i can save the file. But i think it would be nice if the package did it.
The share package accepts a path for sharing files. I want to just share the image without previewing it.

DavinciCapture.offStage , Uint8List object returned null when built in physic device .

Unhandled Exception: type 'Null' is not a subtype of type 'Uint8List'

As the topic says, i got an error when running debug test in physic device(iphone XR , Ios 17)
but it works properly on both iphone 15 and iphone XR simulator (ios 17)

my code

static Future<void> update(context, Widget widget) async {
    Uint8List bytes = await DavinciCapture.offStage(widget,
        context: context,
        returnImageUint8List: true,
        wait: const Duration(seconds: 1),
        openFilePreview: true);
    final directory = await getApplicationSupportDirectory();
    File tempFile =
        File("${directory.path}/${DateTime.now().toIso8601String()}.png");
    await tempFile.writeAsBytes(bytes);

screenshots

iphone 15 Simulator
image

iphone XR Simulator
image

iphone XR physic device
image

Appreciated for developed this awesome pkg.

Ability to capture the widget which is outside the viewport.

If the widget is outside the viewport, meaning the entire widget comes into view only if we have to scroll, Then this package fails.

This can be achieved by converting the entire widget into a canvas and then export it as image.

Check if the widget is in viewport, i.e key.currentContext.findRenderObject is not null or doesn't throw any exception

  • If yes, use the existing method to export the widget into a image.
  • If not, convert the widget to canvas then export it as image.

OffStage not working: RawKeyboard.instance.keyEventHandler == null

After my own implementation had the exact same problem I decided to switch to this package. Sadly, it has the exact same problem.

This happens whenn calling as follows:

Future<dynamic> image = DavinciCapture.offStage(
    widget,
    logicalSize: logicalSize,
    imageSize: imageSize,
    openFilePreview: false,
    fileName: fileName,
    returnImageUint8List: true,
  );

(await image) // <- Error
E/flutter ( 7481): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: 'package:flutter/src/widgets/focus_manager.dart': Failed assertion: line 1463 pos 12: 'RawKeyboard.instance.keyEventHandler == null': is not true.
E/flutter ( 7481): #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)
E/flutter ( 7481): #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
E/flutter ( 7481): #2      FocusManager.registerGlobalHandlers
package:flutter/…/widgets/focus_manager.dart:1463
E/flutter ( 7481): #3      new BuildOwner
package:flutter/…/widgets/framework.dart:2355
E/flutter ( 7481): #4      DavinciCapture.offStage
package:davinci/core/davinci_capture.dart:76

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.