-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c79054b
commit 8635793
Showing
7 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:flutter/widgets.dart'; | ||
|
||
import '../models/control.dart'; | ||
|
||
class ClipboardControl extends StatelessWidget { | ||
final Control? parent; | ||
final Control control; | ||
|
||
const ClipboardControl({Key? key, this.parent, required this.control}) | ||
: super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
debugPrint("Clipboard build: ${control.id}"); | ||
|
||
var value = control.attrString("value"); | ||
|
||
if (value != null) { | ||
debugPrint("Clipboard value: $value"); | ||
} | ||
|
||
return const SizedBox.shrink(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ enum ControlType { | |
alertDialog, | ||
banner, | ||
checkbox, | ||
clipboard, | ||
column, | ||
container, | ||
dropdown, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from flet.control import Control | ||
from flet.ref import Ref | ||
|
||
|
||
class Clipboard(Control): | ||
def __init__( | ||
self, | ||
ref: Ref = None, | ||
data: any = None, | ||
# | ||
# Specific | ||
# | ||
value: str = None, | ||
): | ||
|
||
Control.__init__( | ||
self, | ||
ref=ref, | ||
data=data, | ||
) | ||
|
||
self.value = value | ||
|
||
def _get_control_name(self): | ||
return "clipboard" | ||
|
||
# value | ||
@property | ||
def value(self): | ||
return self._get_attr("value") | ||
|
||
@value.setter | ||
def value(self, value): | ||
self._set_attr("value", value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from time import sleep | ||
|
||
import flet | ||
from flet import Page, Text | ||
|
||
|
||
def main(page: Page): | ||
txt1 = Text("Line 1") | ||
txt2 = Text("Line 2") | ||
txt3 = Text("Line 3") | ||
|
||
page.add(txt1, txt2, txt3) | ||
|
||
sleep(4) | ||
|
||
txt2.visible = False | ||
# page.content.pop(1) | ||
page.update() | ||
|
||
|
||
flet.app(name="test1", port=8550, target=main, view=flet.FLET_APP) |