| 48 | self.apply_theme() |
| 49 | |
| 50 | def init_ui(self): |
| 51 | self.label = f" {self.label}" |
| 52 | self.label_style = ft.TextStyle(color=self.colors.label_text_color, size=15) |
| 53 | self.value = self.value |
| 54 | self.track_outline_color = { |
| 55 | ft.MaterialState.DEFAULT: self.colors.default_outline_color, |
| 56 | ft.MaterialState.SELECTED: self.colors.selected_outline_color, |
| 57 | } |
| 58 | self.thumb_color = { |
| 59 | ft.MaterialState.DEFAULT: self.colors.default_thumb_color, |
| 60 | ft.MaterialState.SELECTED: self.colors.selected_thumb_color, |
| 61 | } |
| 62 | |
| 63 | self.track_color = { |
| 64 | ft.MaterialState.DEFAULT: self.colors.default_track_color, |
| 65 | ft.MaterialState.SELECTED: self.colors.selected_track_color, |
| 66 | } |
| 67 | self.overlay_color = ft.colors.with_opacity(0, "white") |
| 68 | self.on_change = self.on_change |
| 69 | |
| 70 | def apply_theme(self): |
| 71 | self.colors = ( |