-
Notifications
You must be signed in to change notification settings - Fork 486
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
20ab93c
commit 38c5482
Showing
14 changed files
with
413 additions
and
91 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
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,31 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../models/control.dart'; | ||
import '../utils/colors.dart'; | ||
import 'create_control.dart'; | ||
|
||
class DividerControl extends StatelessWidget { | ||
final Control? parent; | ||
final Control control; | ||
|
||
const DividerControl({Key? key, this.parent, required this.control}) | ||
: super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
debugPrint("Divider build: ${control.id}"); | ||
|
||
var height = control.attrDouble("height"); | ||
var thickness = control.attrDouble("thickness"); | ||
var color = HexColor.fromString(context, control.attrString("color", "")!); | ||
|
||
return baseControl( | ||
Divider( | ||
height: height, | ||
thickness: thickness, | ||
color: color, | ||
), | ||
parent, | ||
control); | ||
} | ||
} |
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,31 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../models/control.dart'; | ||
import '../utils/colors.dart'; | ||
import 'create_control.dart'; | ||
|
||
class VerticalDividerControl extends StatelessWidget { | ||
final Control? parent; | ||
final Control control; | ||
|
||
const VerticalDividerControl({Key? key, this.parent, required this.control}) | ||
: super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
debugPrint("VerticalDivider build: ${control.id}"); | ||
|
||
var width = control.attrDouble("width"); | ||
var thickness = control.attrDouble("thickness"); | ||
var color = HexColor.fromString(context, control.attrString("color", "")!); | ||
|
||
return baseControl( | ||
VerticalDivider( | ||
width: width, | ||
thickness: thickness, | ||
color: color, | ||
), | ||
parent, | ||
control); | ||
} | ||
} |
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
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,66 @@ | ||
from typing import Union | ||
|
||
import beartype | ||
|
||
from flet.control import Control, OptionalNumber | ||
from flet.ref import Ref | ||
|
||
|
||
class Divider(Control): | ||
def __init__( | ||
self, | ||
ref: Ref = None, | ||
opacity: OptionalNumber = None, | ||
visible: bool = None, | ||
data: any = None, | ||
# | ||
# Specific | ||
# | ||
height: OptionalNumber = None, | ||
thickness: OptionalNumber = None, | ||
color: str = None, | ||
): | ||
|
||
Control.__init__( | ||
self, | ||
ref=ref, | ||
opacity=opacity, | ||
visible=visible, | ||
data=data, | ||
) | ||
|
||
self.height = height | ||
self.thickness = thickness | ||
self.color = color | ||
|
||
def _get_control_name(self): | ||
return "divider" | ||
|
||
# height | ||
@property | ||
def height(self): | ||
return self._get_attr("height") | ||
|
||
@height.setter | ||
@beartype | ||
def height(self, value: OptionalNumber): | ||
self._set_attr("height", value) | ||
|
||
# thickness | ||
@property | ||
def thickness(self): | ||
return self._get_attr("thickness") | ||
|
||
@thickness.setter | ||
@beartype | ||
def thickness(self, value: OptionalNumber): | ||
self._set_attr("thickness", value) | ||
|
||
# color | ||
@property | ||
def color(self): | ||
return self._get_attr("color") | ||
|
||
@color.setter | ||
def color(self, value): | ||
self._set_attr("color", 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
Oops, something went wrong.