Skip to content

Commit

Permalink
Fix setting clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
FeodorFitsner committed May 16, 2022
1 parent afc67a5 commit 6a6ae7f
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 36 deletions.
2 changes: 1 addition & 1 deletion client/lib/controls/banner.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flet_view/utils/colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';

import '../models/app_state.dart';
import '../models/control.dart';
import '../utils/colors.dart';
import '../utils/edge_insets.dart';
import 'create_control.dart';
import 'error.dart';
Expand Down
5 changes: 4 additions & 1 deletion client/lib/controls/clipboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ class ClipboardControl extends StatelessWidget {
debugPrint("Clipboard JSON value: $value");

var jv = json.decode(value);
Clipboard.setData(ClipboardData(text: jv["d"] as String?));
var text = jv["d"] as String?;
if (text != null) {
Clipboard.setData(ClipboardData(text: text));
}
}

return const SizedBox.shrink();
Expand Down
1 change: 0 additions & 1 deletion client/lib/controls/container.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

import '../models/control.dart';
import '../utils/alignment.dart';
Expand Down
17 changes: 3 additions & 14 deletions client/lib/controls/create_control.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import 'card.dart';
import 'list_tile.dart';
import 'navigation_rail.dart';

import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';

Expand All @@ -11,6 +7,7 @@ import '../models/control_type.dart';
import '../models/control_view_model.dart';
import 'alert_dialog.dart';
import 'banner.dart';
import 'card.dart';
import 'checkbox.dart';
import 'circle_avatar.dart';
import 'clipboard.dart';
Expand All @@ -24,7 +21,9 @@ import 'grid_view.dart';
import 'icon.dart';
import 'icon_button.dart';
import 'image.dart';
import 'list_tile.dart';
import 'list_view.dart';
import 'navigation_rail.dart';
import 'outlined_button.dart';
import 'page.dart';
import 'popup_menu_button.dart';
Expand All @@ -43,16 +42,6 @@ import 'text_button.dart';
import 'textfield.dart';
import 'vertical_divider.dart';

// abstract class ControlWidget extends Widget {
// const ControlWidget(
// {Key? key,
// required Control parent,
// required Control control,
// required List<Control> children,
// required bool parentDisabled})
// : super(key: key);
// }

Widget createControl(Control? parent, String id, bool parentDisabled) {
//debugPrint("createControl(): $id");
return StoreConnector<AppState, ControlViewModel>(
Expand Down
2 changes: 1 addition & 1 deletion client/lib/controls/form_field.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flet_view/controls/create_control.dart';
import 'package:flutter/material.dart';

import '../models/control.dart';
import '../utils/edge_insets.dart';
import '../utils/icons.dart';
import 'create_control.dart';

enum FormFieldInputBorder { outline, underline, none }

Expand Down
1 change: 0 additions & 1 deletion client/lib/controls/icon.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

import '../models/control.dart';
import '../utils/colors.dart';
Expand Down
1 change: 0 additions & 1 deletion client/lib/controls/list_view.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

import '../models/control.dart';
import '../utils/edge_insets.dart';
Expand Down
2 changes: 1 addition & 1 deletion client/lib/controls/navigation_rail.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flet_view/utils/icons.dart';
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';

Expand All @@ -9,6 +8,7 @@ import '../models/controls_view_model.dart';
import '../protocol/update_control_props_payload.dart';
import '../utils/colors.dart';
import '../utils/edge_insets.dart';
import '../utils/icons.dart';
import '../web_socket_client.dart';
import 'create_control.dart';

Expand Down
11 changes: 4 additions & 7 deletions client/lib/controls/page.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import 'package:flet_view/controls/app_bar.dart';
import 'package:flet_view/models/control_view_model.dart';

import '../models/control_type.dart';
import '../models/controls_view_model.dart';
import '../utils/desktop.dart';
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';

import '../models/app_state.dart';
import '../models/control.dart';
import '../models/control_children_view_model.dart';
import '../models/control_type.dart';
import '../models/controls_view_model.dart';
import '../utils/alignment.dart';
import '../utils/colors.dart';
import '../utils/desktop.dart';
import '../utils/edge_insets.dart';
import '../utils/theme.dart';
import '../widgets/screen_size.dart';
import 'app_bar.dart';
import 'create_control.dart';
import 'scrollable_control.dart';

Expand Down
2 changes: 1 addition & 1 deletion client/lib/controls/popup_menu_button.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:flet_view/utils/icons.dart';
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';

import '../models/app_state.dart';
import '../models/control.dart';
import '../models/controls_view_model.dart';
import '../utils/icons.dart';
import '../web_socket_client.dart';
import 'create_control.dart';

Expand Down
6 changes: 3 additions & 3 deletions client/lib/controls/radio.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import 'package:flet_view/controls/error.dart';
import 'package:flet_view/models/control_ancestor_view_model.dart';
import 'package:flet_view/models/control_type.dart';
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';

import '../actions.dart';
import '../models/app_state.dart';
import '../models/control.dart';
import '../models/control_ancestor_view_model.dart';
import '../models/control_type.dart';
import '../protocol/update_control_props_payload.dart';
import '../web_socket_client.dart';
import 'create_control.dart';
import 'error.dart';

enum LabelPosition { right, left }

Expand Down
2 changes: 1 addition & 1 deletion client/lib/controls/radio_group.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flet_view/controls/error.dart';
import 'package:flutter/material.dart';

import '../models/control.dart';
import 'create_control.dart';
import 'error.dart';

class RadioGroupControl extends StatelessWidget {
final Control? parent;
Expand Down
2 changes: 1 addition & 1 deletion client/lib/controls/tabs.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flet_view/utils/icons.dart';
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';

Expand All @@ -7,6 +6,7 @@ import '../models/app_state.dart';
import '../models/control.dart';
import '../models/controls_view_model.dart';
import '../protocol/update_control_props_payload.dart';
import '../utils/icons.dart';
import '../web_socket_client.dart';
import 'create_control.dart';

Expand Down
4 changes: 2 additions & 2 deletions sdk/python/playground/icons-browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,5 @@ def search_click(e):
)


# flet.app(name="test1", port=8550, target=main, view=flet.WEB_BROWSER)
flet.app(port=8550, target=main, view=flet.WEB_BROWSER)
flet.app(name="test1", port=8550, target=main, view=flet.WEB_BROWSER)
# flet.app(port=8550, target=main, view=flet.WEB_BROWSER)

0 comments on commit 6a6ae7f

Please sign in to comment.