Why KivyMD adding to icons and to check boxes in the lest item

i I followed the kivymd 1.1.1 docs for how to make a list and add an item to it and i spent to days trying to fix the it and i did not found any solution that is my code what’s the problem in the code


from kivymd.app import MDApp 
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen
from kivymd.uix.list import IRightBodyTouch, ThreeLineAvatarIconListItem
from kivymd.uix.pickers import MDDatePicker
from kivymd.uix.selectioncontrol import MDCheckbox
from kivy.properties import StringProperty


class TaskScreen(Screen):pass

class AddTask(Screen):pass

class Manager(ScreenManager):pass

class ListItemWithCheckbox(ThreeLineAvatarIconListItem):
    """'''Custom list item.'''
    The list item will be added to the task list"""
    icon = StringProperty("android")

class RightCheckbox(IRightBodyTouch, MDCheckbox):
    '''Custom right container.'''


class TasksApp(MDApp):
    # def __init__(self, **kwargs):
    #     super().__init__(**kwargs)
    def add_task(self,title, task, date):
        title = self.root.ids.add_task.ids.title.text
        task = self.root.ids.add_task.ids.task.text
        date = self.root.ids.add_task.ids.date.text
        task_item =ListItemWithCheckbox(text=title,
                                        secondary_text=task,
                                        tertiary_text=date,
                                        )
        self.root.ids.task_screen.ids.container.add_widget(task_item)
        
        self.clean_fields(title,task,date)

    def clean_fields(self,title,task,date):
        self.root.ids.add_task.ids.title.text = ''
        self.root.ids.add_task.ids.task.text = ''
        self.root.ids.add_task.ids.date.text = ''
    
    def open_date_picker(self):
        date_dialog = MDDatePicker()
        date_dialog.bind(on_save=self.on_save)
        date_dialog.open()
    
    def on_save(self, instance, value, date_range):
        value = value.strftime('%A %d %B %Y')
        self.root.ids.add_task.ids.date.text = str(value)
    
    def remove_item(self,task_item):
        self.root.ids.task_screen.ids.container.remove_widget(task_item)
        
    
    def build(self):
        self.theme_cls.primary_palette = 'Teal'
        return Builder.load_file('tasks.kv')


TasksApp().run()

and the kv file:


#: import CardTransition kivy.uix.screenmanager.CardTransition
#: import datetime datetime
# :set date_text datetime.now().strftime('%A %d %B %Y')


Manager:
    id:sm
    TaskScreen:
        id: task_screen
    AddTask:
        id: add_task

<TaskScreen>:
    name: 'task_screen'
    MDFloatLayout:
        orientation:'vertical'
        MDLabel:
            text: "[size=40][u][b]Tasks[/b][/u][/size]"
            color: 'teal'
            markup:True
            halign: 'center'
            pos_hint: {'center_x': 0.5,'center_y': 0.95}
        MDLabel:
            id: date_now
            text:str(datetime.datetime.now().strftime('[b][size=25]Today: [/size][/b][b][size=20]%A %d %B %Y -%I:%M[/size][/b]'))
            color: 'teal'
            markup:True
            halign: 'center'
            pos_hint: {'center_x': 0.5,'center_y': 0.88}

    ScrollView:
        MDList:
            id: container

    MDFloatingActionButton:
        elevation:3
        icon: 'plus-outline'
        pos_hint: {'center_x': 0.5,'center_y': 0.09}
        on_release:
            # app.root.transition.direction = 'left'
            app.root.transition = CardTransition(mode='pop')
            app.root.current = 'add_task'

<AddTask>:
    name: 'add_task'

    MDLabel:
        text: "[size=40][u][b]Add Task[/b][/u][/size]"
        color: 'teal'
        markup:True
        halign: 'center'
        pos_hint: {'center_x': 0.5,'center_y': 0.95}

    MDLabel:
        id: date_now
        text:str(datetime.datetime.now().strftime('[b][size=25]Today: [/size][/b][b][size=20]%A %d %B %Y - %I:%M[/size][/b]'))
        color: 'teal'
        markup:True
        halign: 'center'
        pos_hint: {'center_x': 0.5,'center_y': 0.88}
    MDLabel:
        id: date
        text: '[u][size=15]___[/size][/u]'
        color: 'teal'
        markup:True
        pos_hint: {'center_x': 0.65,'center_y': 0.75}
    MDIconButton:
        icon:'calendar-multiselect'
        icon_size:'48sp'
        theme_icon_color: "Custom"
        icon_color: app.theme_cls.primary_color
        pos_hint: {'center_x':0.75,'center_y': 0.75}
        on_release: app.open_date_picker()

    MDLabel:
        text: "[size=20][u][b]Title[/b][/u][/size]"
        color: 'teal'
        markup: True
        pos_hint: {'center_x': 0.65,'center_y': 0.6}

    MDTextField:
        id: title
        pos_hint:{"center_x": 0.5,'center_y': 0.5}
        size_hint_x: 0.7
        max_text_length: 20
        font_size: 20
        bold:True

    MDLabel:
        text: "[size=20][u][b]Enter Task[/b][/u][/size]"
        color: 'teal'
        markup:True
        pos_hint: {'center_x': 0.65,'center_y': 0.4}

    MDTextField:
        id: task
        pos_hint:{"center_x": 0.5,'center_y': 0.3}
        size_hint_x: 0.7
        max_text_length:60
        font_size:19
        bold:True

    MDRaisedButton:
        text:'Save'
        pos_hint:{"center_x": 0.72,'center_y': 0.15}
        on_release:
            app.add_task(title, task, date)
            app.root.transition = CardTransition(mode='pop')
            app.root.current = 'task_screen'

    MDIconButton:
        icon: 'arrow-u-right-top'
        icon_size:'48sp'
        theme_icon_color: "Custom"
        icon_color: app.theme_cls.primary_color
        pos_hint:{'center_x':0.5,'center_y': 0.15}
        on_release:
            # app.root.transition.direction = 'right'
            app.root.transition = CardTransition(mode='pop')
            app.root.current = 'task_screen'
            app.clean_fields(title, task, date)

<ListItemWithCheckbox>:
    id: task_item


    RightCheckbox:
        id : checbox

    IconLeftWidget:
        icon: 'trash-can-outline'
        theme_text_color: "Custom"
        text_color: 'teal' #1, 0, 0, 1
        on_release:app.remove_item(task_item)

and the pic for the app to icons and to check boxes

search on the web reading docs try to change the list items and positions of widgets and check for any code mistakes or typo ….

New contributor

ELMOSAFER is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật