platty library

Flutter widget library utilize Platform-switching widgets. To use, import package:platty/platty.dart.

Classes

MaterialPatcher
Useful helper class that checks if we have material ancestor. If we don't, we wrap the widget in a Material object.
PActivityIndicator
PAlertData
PAlertDialog
PBackButton
PButton
A Platform-Specific Button that conforms to iOS and Android as appropriate. On Android, this is RaisedButton On iOS, this is a CupertinoButton
PFlatButton
A Platform-Specific Button that conforms to iOS and Android as appropriate. On Android this is FlatButton On iOS this is CupertinoButton
PlatformAdaptingWidget
PlatformApp
This class adapts the app theme to the specified platform. On Android this is MaterialApp On iOS this is CupertinoApp.
PNavigationBar
A widget that attempts to consolidate the different behaviors of each platform into one single, PlatformAdaptingWidget.
PNavigationBarBase
PRoute
PScaffold
Adapts the widget to a Scaffold on Android and CupertinoPageScaffold on iOS. This widget does not attempt to provide FloatingActionButton support on Android. If you need that, use the Scaffold directly.
PSlider
A PlatformAdaptingWidget that renders a Slider on Android and CupertinoSlider on iOS.
PSliverNavigationBar
Sliver implementation of the PNavigationBar.
PSwitch
PTabBar
PTextField
PTheme
PThemeData

Functions

platformSelect<T>(BuildContext context, {TargetPlatform renderPlatform, PlatformBuilder<T> renderMaterial, PlatformBuilder<T> renderCupertino, PlatformBuilder<T> renderFuchsia}) → T
Allows you to arbitrarily return a value from this method based on the PTheme or renderPlatform specified. It allows you to efficiently choose a widget, property, or object to return based on current platform in a unified way. [...]
platformWrap<T extends Widget>(BuildContext context, {T child, TargetPlatform renderPlatform, ChildPlatformBuilder<T> renderMaterial, ChildPlatformBuilder<T> renderCupertino, ChildPlatformBuilder<T> renderFuchsia}) → T
Similiar to platformSelect except it provides a way to wrap the passed child on a certain platform while enabling on other platforms simply returning the child. [...]
showPlatformDialog<T>({BuildContext context, bool androidBarrierDismissible: true, WidgetBuilder builder, TargetPlatform renderPlatform}) Future<T>

Typedefs

ChildPlatformBuilder<T extends Widget>(BuildContext context, T child) → T
PlatformBuilder<T>(BuildContext context) → T