flutter-elinux icon indicating copy to clipboard operation
flutter-elinux copied to clipboard

Passing flutter-embedded-linux flags

Open psstoyanov opened this issue 3 years ago • 5 comments

Overview

flutter-embedded-linux has several flags to control certain aspects of the behaviour.

They can't be used with flutter-elinux and at least some are overlapping (example with -d used for targeting the device and enabling decorations in flutter-elinux and flutter-embedded-linux respectively).

Question

Is it within the scope of this project to enable the use of the additional flags from flutter-embedded-linux?

psstoyanov avatar Jan 13 '22 10:01 psstoyanov

Yes, currently some command-line options are not supported yet in flutter-elinux. I welcome your contribution to flutter-elinux.

HidenoriMatsubayashi avatar Jan 14 '22 03:01 HidenoriMatsubayashi

Great!

I will try to familiarize myself with the code to see how this can be achieved in the next week or so. Probably I will also check with the Flutter Study Group for ideas on how to do it?

psstoyanov avatar Jan 14 '22 11:01 psstoyanov

@HidenoriMatsubayashi , if you have the time, I have a small question for the generation of the tool:

  • Which flutter tools are we looking for on this line? https://github.com/sony/flutter-elinux/blob/490317ad3eee0745027d1675986e1d5f6e727e22/pubspec.yaml#L12
    • Should those be the ones provided from depot_tools ?
    • Could I use the installed flutter version in /opt/flutter

psstoyanov avatar Jan 25 '22 17:01 psstoyanov

Which flutter tools are we looking for on this line?

https://github.com/flutter/flutter/tree/master/packages/flutter_tools

Should those be the ones provided from depot_tools ?

What does it mean?

Could I use the installed flutter version in /opt/flutter

No. flutter-elinux automatically downloads the corresponding flutter_tools version. See: https://github.com/sony/flutter-elinux/blob/main/bin/internal/shared.sh

HidenoriMatsubayashi avatar Jan 27 '22 04:01 HidenoriMatsubayashi

Thank you, @HidenoriMatsubayashi ! That was silly of me, I was trying to do dart pub get instead of letting the tool do it's job...

psstoyanov avatar Jan 27 '22 16:01 psstoyanov

We can add new arguments for building:

  • https://github.com/sony/flutter-elinux/blob/2b8096b0983c4312673b96aa921bb42d1badb9e1/lib/commands/build.dart#L38
Example build flags
  argParser.addFlag(
      'onscreen-keyboard',
      help: 'Enables onscreen-keyboard support.',
    );
    argParser.addFlag(
      'fullscreen',
      help: 'Sets the app to fullscreen.',
    );

and running:

  • https://github.com/sony/flutter-elinux/blob/2b8096b0983c4312673b96aa921bb42d1badb9e1/lib/commands/run.dart#L14
Example run flags
  ELinuxRunCommand({super.verboseHelp}) {
    argParser.addFlag(
      'onscreen-keyboard',
      help: 'Enables onscreen-keyboard support.',
    );
    argParser.addFlag(
      'fullscreen',
      help: 'Sets the app to fullscreen.',
    );
  }

Now to find how to pass them further down the stack.

psstoyanov avatar May 28 '23 09:05 psstoyanov

Closing.

HidenoriMatsubayashi avatar Aug 14 '23 06:08 HidenoriMatsubayashi