Flet Controls

Flet offers a rich set of controls for building cross-platform applications using Python. The controls are categorized and can be used to construct user interfaces for web, desktop, and mobile applications without requiring frontend expertise.

Control Categories

  • **Ads:** Controls for displaying advertisements (e.g., BannerAd, InterstitialAd).
  • **Basic UI Elements:** Core components like Text, Icon, Image, Button variants (TextButton, FilledButton, IconButton, etc.), Checkbox, Radio, Switch, Slider, TextField, Dropdown.
  • **Layout & Containers:** Controls for structuring the UI, such as Column, Row, Stack, Container, Card, GridView, ListView, ResponsiveRow, SafeArea, WindowDragArea.
  • **Navigation:** Components for app navigation, including AppBar, BottomAppBar, NavigationBar, NavigationDrawer, NavigationRail, Tabs, TabBar, TabBarView, Menu related controls (MenuBar, MenuItemButton, SubmenuButton, PopupMenuButton).
  • **Input & Selection:** Controls for user input and selection like AutoComplete, DatePicker, DateRangePicker, Dropdown, RadioGroup, RangeSlider, SearchBar, SegmentedButton, TextField, TimePicker.
  • **Feedback & Dialogs:** Components for user feedback and interaction, such as AlertDialog, BottomSheet, CupertinoActionSheet, CupertinoAlertDialog, SnackBar, ExpansionPanel, ExpansionTile.
  • **Data Display:** Controls for presenting data, including DataTable, DataTable2, ListTile, Markdown.
  • **Animation & Effects:** Controls for visual effects like AnimatedSwitcher, Shimmer, ShaderMask.
  • **Platform-Specific (Cupertino):** A set of controls mimicking iOS design (CupertinoActionSheet, CupertinoActivityIndicator, CupertinoButton, etc.).
  • **Advanced/Specialized:** Controls for specific functionalities like Canvas (for custom drawing), Charts (various chart types), GestureDetector, KeyboardListener, Lottie (for animations), Map (interactive maps), Rive (runtime animations), WebView.
  • **App Structure:** FletApp for the main application entry point, Page for individual screens, Pagelet for reusable UI sections.
  • Key Concepts

  • **Nesting:** Controls can be nested within each other to build complex UI hierarchies.
  • **Properties:** Each control has a set of properties that define its appearance and behavior.
  • **Events:** Controls can trigger events that your Python code can respond to (e.g., button clicks, text changes).
  • **Cross-Platform:** Controls are designed to render consistently across web, desktop, and mobile platforms.