Skip to content

Commit f39a069

Browse files
GestureDetector and fixes (#459)
* 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
1 parent 05a6e8c commit f39a069

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2455
-504
lines changed

.appveyor.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ environment:
5858
job_depends_on: build_flet_package
5959
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
6060

61-
# - job_name: Test Python 3.7
62-
# job_group: python_tests
63-
# job_depends_on: build_flet
64-
# python_stack: python 3.7
65-
# APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
61+
- job_name: Test Python 3.7
62+
job_group: python_tests
63+
job_depends_on: build_flet
64+
python_stack: python 3.7
65+
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
6666

6767
- job_name: Test Python 3.8
6868
job_group: python_tests
@@ -144,7 +144,8 @@ for:
144144

145145
build_script:
146146
- cd client
147-
- flutter build windows
147+
- ps: if ($env:APPVEYOR_REPO_TAG_NAME -match "[0-9\.]+") { $env:FLET_VER=$Matches.0 } else { $env:FLET_VER=$env:APPVEYOR_BUILD_VERSION }
148+
- flutter build windows --build-name=%FLET_VER%
148149
- set RELEASE_DIR=build\windows\runner\Release
149150
- copy "%VC_REDIST_DIR%\msvcp140.dll" %RELEASE_DIR%
150151
- copy "%VC_REDIST_DIR%\vcruntime140.dll" %RELEASE_DIR%
@@ -190,7 +191,8 @@ for:
190191
build_script:
191192
# Flutter macOS client
192193
- cd client
193-
- flutter build macos
194+
- if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then export FLET_VER="${BASH_REMATCH[1]}"; else export FLET_VER="$APPVEYOR_BUILD_VERSION"; fi
195+
- flutter build macos --build-name=$FLET_VER
194196
- tar -czvf flet-macos-amd64.tar.gz -C build/macos/Build/Products/Release Flet.app
195197

196198
artifacts:
@@ -226,7 +228,8 @@ for:
226228

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

@@ -263,7 +266,8 @@ for:
263266

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

@@ -433,7 +437,7 @@ for:
433437
# patch version
434438
$env:PACKAGE_VERSION = $ver
435439
(Get-Content pyproject.toml).replace("version = `"0.1.0`"", "version = `"$ver`"") | Set-Content pyproject.toml
436-
("# this file was auto-generated by CI", "version = '$ver'") | Set-Content flet/version.py
440+
(Get-Content flet/version.py).replace("version = `"`"", "version = `"$ver`"") | Set-Content flet/version.py
437441
438442
# build package
439443
- pdm build
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import 'dart:io';
2+
3+
import 'package:flet_client/main.dart' as app;
4+
import 'package:flutter/cupertino.dart';
5+
import 'package:flutter_test/flutter_test.dart';
6+
import 'package:integration_test/integration_test.dart';
7+
8+
void main() {
9+
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
10+
11+
tearDown(() {
12+
debugPrint("TEAR DOWN");
13+
});
14+
15+
group('end-to-end test', () {
16+
testWidgets('tap on the floating action button, verify counter',
17+
(tester) async {
18+
var dir = Directory.current.path;
19+
debugPrint("Current dir: $dir");
20+
app.main();
21+
await tester.pumpAndSettle(const Duration(milliseconds: 100),
22+
EnginePhase.sendSemanticsUpdate, const Duration(seconds: 20));
23+
24+
// Verify the counter starts at 0.
25+
expect(find.text('0'), findsOneWidget);
26+
27+
// Finds the floating action button to tap on.
28+
final Finder fab = find.byTooltip('Increment');
29+
30+
// Emulate a tap on the floating action button.
31+
await tester.tap(fab);
32+
33+
// Trigger a frame.
34+
await tester.pumpAndSettle();
35+
36+
// Verify the counter increments by 1.
37+
expect(find.text('1'), findsOneWidget);
38+
});
39+
});
40+
}

client/lib/main.dart

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,22 @@ void main([List<String>? args]) async {
4141

4242
debugPrint("Page URL: $pageUrl");
4343

44-
runApp(FletApp(title: 'Flet', pageUrl: pageUrl));
44+
FletAppErrorsHandler errorsHandler = FletAppErrorsHandler();
45+
46+
if (!kDebugMode) {
47+
FlutterError.onError = (details) {
48+
errorsHandler.onError(details.exceptionAsString());
49+
};
50+
51+
PlatformDispatcher.instance.onError = (error, stack) {
52+
errorsHandler.onError(error.toString());
53+
return true;
54+
};
55+
}
56+
57+
runApp(FletApp(
58+
title: 'Flet',
59+
pageUrl: pageUrl,
60+
errorsHandler: errorsHandler,
61+
));
4562
}

client/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<BuildableReference
1616
BuildableIdentifier = "primary"
1717
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
18-
BuildableName = "flet.app"
18+
BuildableName = "Flet.app"
1919
BlueprintName = "Runner"
2020
ReferencedContainer = "container:Runner.xcodeproj">
2121
</BuildableReference>
@@ -31,7 +31,7 @@
3131
<BuildableReference
3232
BuildableIdentifier = "primary"
3333
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
34-
BuildableName = "flet.app"
34+
BuildableName = "Flet.app"
3535
BlueprintName = "Runner"
3636
ReferencedContainer = "container:Runner.xcodeproj">
3737
</BuildableReference>
@@ -54,7 +54,7 @@
5454
<BuildableReference
5555
BuildableIdentifier = "primary"
5656
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
57-
BuildableName = "flet.app"
57+
BuildableName = "Flet.app"
5858
BlueprintName = "Runner"
5959
ReferencedContainer = "container:Runner.xcodeproj">
6060
</BuildableReference>
@@ -71,7 +71,7 @@
7171
<BuildableReference
7272
BuildableIdentifier = "primary"
7373
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
74-
BuildableName = "flet.app"
74+
BuildableName = "Flet.app"
7575
BlueprintName = "Runner"
7676
ReferencedContainer = "container:Runner.xcodeproj">
7777
</BuildableReference>
1.79 KB
Loading
-69 Bytes
Loading
6 Bytes
Loading
394 Bytes
Loading
-34 Bytes
Loading
762 Bytes
Loading

0 commit comments

Comments
 (0)