Skip to content

Commit

Permalink
GestureDetector and fixes (#459)
Browse files Browse the repository at this point in the history
* Make `cryptography` dependency optional

* Setting Flet client build number

* Do not set build-number

* Update Flet macOS icons

* Clipboard re-done to support Safari

* Make crypto utils optional

Fix #417

* Re-enable Python 3.7 as PDM fixed the issue

pdm-project/pdm#1411 (comment)

* Fix #431 - Handling Flutter and platform errors

* Added additional styles to TextField and Dropdown

* label_style
* hint_style
* helper_style
* counter_style
* error_style
* prefix_style
* suffix_style

Fix #446

* Fix CI

* Add an ability to hide automatic back button in AppBar

Fix #209

* Added `SnackBar.action_color`

Fix #364

* Control TextFields cursor presentation

Fix #356

* Add x and y to DropTarget.on_accept event

#329

* Customize colors of Checkbox and Radio

Fix #320

* Restore `websocket.defaulttimeout` on connect

Fix #413

* `Audio.get_current_position` and `Audio.get_duration` returns `int`

Fix #440

* Update container.dart

* GestureDetector control started

* `Audio.playback_rate` added

Fix #451

* All Tap gestures

* Gesture detector ready but without throttling

* Throttling of drag and hover events

* Get version from Git repo

* Fix gesture handlers

* Added a simple integration test - just for fun

* ElevatedButton must show error if only icon specified without text

Fix #357

* Display an error when left, top, right or bottom are used not in Stack

Fix #296

* Shrink wrap ListView and GridView if bounds are unlimited

Fix #331

* Fix #303 - NavigationRail is not shown in a parent without fixed height

* Do not bind session value to the IP

Fix #457

* Fix path traversal in tar unpack (CVE-2007-4559)

* Added `Container.shape` property

* Fix the rest of warnings

* Remove ControlType enum

* Fix flutter tests

* Fix MouseCursor enum

* Added Flutter package readme
  • Loading branch information
FeodorFitsner authored Oct 11, 2022
1 parent 05a6e8c commit f39a069
Show file tree
Hide file tree
Showing 80 changed files with 2,455 additions and 504 deletions.
24 changes: 14 additions & 10 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ environment:
job_depends_on: build_flet_package
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu

# - job_name: Test Python 3.7
# job_group: python_tests
# job_depends_on: build_flet
# python_stack: python 3.7
# APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Test Python 3.7
job_group: python_tests
job_depends_on: build_flet
python_stack: python 3.7
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu

- job_name: Test Python 3.8
job_group: python_tests
Expand Down Expand Up @@ -144,7 +144,8 @@ for:

build_script:
- cd client
- flutter build windows
- ps: if ($env:APPVEYOR_REPO_TAG_NAME -match "[0-9\.]+") { $env:FLET_VER=$Matches.0 } else { $env:FLET_VER=$env:APPVEYOR_BUILD_VERSION }
- flutter build windows --build-name=%FLET_VER%
- set RELEASE_DIR=build\windows\runner\Release
- copy "%VC_REDIST_DIR%\msvcp140.dll" %RELEASE_DIR%
- copy "%VC_REDIST_DIR%\vcruntime140.dll" %RELEASE_DIR%
Expand Down Expand Up @@ -190,7 +191,8 @@ for:
build_script:
# Flutter macOS client
- cd client
- flutter build macos
- if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then export FLET_VER="${BASH_REMATCH[1]}"; else export FLET_VER="$APPVEYOR_BUILD_VERSION"; fi
- flutter build macos --build-name=$FLET_VER
- tar -czvf flet-macos-amd64.tar.gz -C build/macos/Build/Products/Release Flet.app

artifacts:
Expand Down Expand Up @@ -226,7 +228,8 @@ for:

build_script:
- cd client
- flutter build linux
- if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then export FLET_VER="${BASH_REMATCH[1]}"; else export FLET_VER="$APPVEYOR_BUILD_VERSION"; fi
- flutter build linux --build-name=$FLET_VER
- mv build/linux/x64/release/bundle build/linux/x64/release/flet
- tar -czvf flet-linux-amd64.tar.gz -C build/linux/x64/release flet

Expand Down Expand Up @@ -263,7 +266,8 @@ for:

build_script:
- cd client
- flutter build linux
- if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then export FLET_VER="${BASH_REMATCH[1]}"; else export FLET_VER="$APPVEYOR_BUILD_VERSION"; fi
- flutter build linux --build-name=$FLET_VER
- mv build/linux/arm64/release/bundle build/linux/arm64/release/flet
- tar -czvf flet-linux-arm64.tar.gz -C build/linux/arm64/release flet

Expand Down Expand Up @@ -433,7 +437,7 @@ for:
# patch version
$env:PACKAGE_VERSION = $ver
(Get-Content pyproject.toml).replace("version = `"0.1.0`"", "version = `"$ver`"") | Set-Content pyproject.toml
("# this file was auto-generated by CI", "version = '$ver'") | Set-Content flet/version.py
(Get-Content flet/version.py).replace("version = `"`"", "version = `"$ver`"") | Set-Content flet/version.py
# build package
- pdm build
Expand Down
40 changes: 40 additions & 0 deletions client/integration_test/app_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import 'dart:io';

import 'package:flet_client/main.dart' as app;
import 'package:flutter/cupertino.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

tearDown(() {
debugPrint("TEAR DOWN");
});

group('end-to-end test', () {
testWidgets('tap on the floating action button, verify counter',
(tester) async {
var dir = Directory.current.path;
debugPrint("Current dir: $dir");
app.main();
await tester.pumpAndSettle(const Duration(milliseconds: 100),
EnginePhase.sendSemanticsUpdate, const Duration(seconds: 20));

// Verify the counter starts at 0.
expect(find.text('0'), findsOneWidget);

// Finds the floating action button to tap on.
final Finder fab = find.byTooltip('Increment');

// Emulate a tap on the floating action button.
await tester.tap(fab);

// Trigger a frame.
await tester.pumpAndSettle();

// Verify the counter increments by 1.
expect(find.text('1'), findsOneWidget);
});
});
}
19 changes: 18 additions & 1 deletion client/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,22 @@ void main([List<String>? args]) async {

debugPrint("Page URL: $pageUrl");

runApp(FletApp(title: 'Flet', pageUrl: pageUrl));
FletAppErrorsHandler errorsHandler = FletAppErrorsHandler();

if (!kDebugMode) {
FlutterError.onError = (details) {
errorsHandler.onError(details.exceptionAsString());
};

PlatformDispatcher.instance.onError = (error, stack) {
errorsHandler.onError(error.toString());
return true;
};
}

runApp(FletApp(
title: 'Flet',
pageUrl: pageUrl,
errorsHandler: errorsHandler,
));
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "flet.app"
BuildableName = "Flet.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
Expand All @@ -31,7 +31,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "flet.app"
BuildableName = "Flet.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
Expand All @@ -54,7 +54,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "flet.app"
BuildableName = "Flet.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
Expand All @@ -71,7 +71,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "flet.app"
BuildableName = "Flet.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 45 additions & 16 deletions client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
clock:
dependency: transitive
description:
Expand All @@ -112,7 +105,7 @@ packages:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
version: "3.0.2"
equatable:
dependency: transitive
description:
Expand Down Expand Up @@ -140,7 +133,7 @@ packages:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.4"
version: "6.1.2"
file_picker:
dependency: transitive
description:
Expand All @@ -160,6 +153,11 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_driver:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
flutter_launcher_icons_maker:
dependency: "direct dev"
description:
Expand All @@ -180,7 +178,7 @@ packages:
name: flutter_markdown
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.10+3"
version: "0.6.12"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
Expand Down Expand Up @@ -212,6 +210,11 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
fuchsia_remote_debug_protocol:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: transitive
description:
Expand All @@ -233,6 +236,11 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.0"
integration_test:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
js:
dependency: transitive
description:
Expand All @@ -253,7 +261,7 @@ packages:
name: markdown
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0"
version: "6.0.1"
matcher:
dependency: transitive
description:
Expand All @@ -267,7 +275,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
version: "0.1.5"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -454,7 +462,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.1"
version: "1.9.0"
stack_trace:
dependency: transitive
description:
Expand All @@ -476,6 +484,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
sync_http:
dependency: transitive
description:
name: sync_http
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.1"
term_glyph:
dependency: transitive
description:
Expand All @@ -489,14 +504,14 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.14"
version: "0.4.12"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.3.1"
url_launcher:
dependency: transitive
description:
Expand Down Expand Up @@ -573,14 +588,28 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.1.2"
vm_service:
dependency: transitive
description:
name: vm_service
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.0"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
webdriver:
dependency: transitive
description:
name: webdriver
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
win32:
dependency: transitive
description:
Expand Down
2 changes: 2 additions & 0 deletions client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ dependencies:
path: ../package/

url_strategy: ^0.2.0
integration_test:
sdk: flutter

dev_dependencies:
flutter_test:
Expand Down
2 changes: 1 addition & 1 deletion package/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 0.0.1
## 0.1.62

* Initial release of Flet package.
33 changes: 6 additions & 27 deletions package/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,18 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.

For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
# Flet

For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->
Provides an interactive Flutter widget which contents is controlled by a remote Python script running on a web server.

TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.
Flet provides a very approachable Python library, so developers without prior Flutter experience can easily build parts of your bigger Flutter app or develop their own mobile apps from scratch.

## Features

TODO: List what your package can do. Maybe include images, gifs, or videos.

## Getting started

TODO: List prerequisites and provide or point to information on how to
start using the package.
Flet implements Server-Driven UI (SDUI) approach reducing application release cycle.

## Usage

TODO: Include short and useful examples for package users. Add longer examples

to `/example` folder.

```dart
const like = 'sample';
```

## Additional information

TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.
```
Loading

0 comments on commit f39a069

Please sign in to comment.