base library

One code, two mode, use cupertino's widgets on ios, use material's widget on android or fuchsia.

Classes

BaseActionSheet
BaseAppBar use CupertinoActionSheet by cupertino *** use cupertino = { forceUseMaterial: true } force use custom BottomSheet on cuperitno. use custom BottomSheet by material *** use material = { forceUseCupertino: true } force use CupertinoActionSheet on material.
BaseActionSheetAction
BaseAppBar use CupertinoActionSheetAction by cupertino *** use cupertino = { forceUseMaterial: true } force use FlatButton on cuperitno. use InkWell by material, must has a Material Widget ancestor *** use material = { forceUseCupertino: true } force use CupertinoActionSheetAction on material.
BaseAlertDialog
BaseAlertDialog use CupertinoAlertDialog by cupertino *** use cupertino = { forceUseMaterial: true } force use AlertDialog on cuperitno. use AlertDialog by material *** use material = { forceUseCupertino: true } force use CupertinoAlertDialog on material.
BaseApp
BaseAppBar theme, use cupertinoTheme by cupertino,use materialTheme by material. use CupertinoApp by cupertino *** use cupertino = { forceUseMaterial: true } force use MaterialApp on cuperitno. use MaterialApp by material *** use material = { forceUseCupertino: true } force use CupertinoApp on material.
BaseAppBar
BaseAppBar [...]
BaseBarItem
BaseBarItem use BottomNavigationBarItem by cupertino *** use cupertino = { forceUseMaterial: true } force use BottomNavigationBarItem on cuperitno. use BottomNavigationBarItem by material *** use material = { forceUseCupertino: true } force use BottomNavigationBarItem on material.
BaseButton
BaseButton use CupertinoButton or CupertinoButton.filled by cupertino *** use cupertino = { forceUseMaterial: true } force use MaterialButton or FlatButton or OutlineButton or RaisedButton on cuperitno. use MaterialButton or FlatButton or OutlineButton or RaisedButton by material *** use material = { forceUseCupertino: true } force use CupertinoButton or CupertinoButton.filled on material.
BaseClass
基础类 cupertino使用buildByCupertino方法构建,material使用buildByMaterial方法构建 *** 参数 1、cupertino模式:从cupertino里取对应的值,取不到则取公共参数 2、material模式:从material里取对应的值,取不到则取公共参数 3、cupertino模式下可以使用 cupertino = { forceUseMaterial: true } 强制使用material模式构建 使用 cupertino = { disabled: true } 禁止构建 4、material模式下可以使用 material = { forceUseCupertino: true } 强制使用cupertino模式构建 使用 material = { disabled: true } 禁止构建 [...]
BaseColor
Brightness.light, Brightness.dark 分别使用2种颜色 [...]
BaseDialogAction
BaseDialogAction use CupertinoDialogAction by cupertino *** use cupertino = { forceUseMaterial: true } force use FlatButton on cuperitno. use FlatButton by material *** use material = { forceUseCupertino: true } force use CupertinoDialogAction on material.
BaseDrawer
自定义drawer 不可指定起点位置跟终点位置 default is 304 width or height
BaseDrawerState
BaseExpansion
伸缩面板,目前还很不完善 可以指定位置画滑出
BaseExpansionState
BaseIcon
use Icon by cupertino *** use cupertino = { forceUseMaterial: true } force use Icon on cuperitno. use Icon by material *** use material = { forceUseCupertino: true } force use Icon on material.
BaseIconButton
BaseIconButton use CupertinoButton by cupertino *** use cupertino = { forceUseMaterial: true } force use IconButton on cuperitno. use IconButton by material *** use material = { forceUseCupertino: true } force use CupertinoButton on material.
BaseIndicator
BaseIndicator use CupertinoActivityIndicator by cupertino *** use cupertino = { forceUseMaterial: true } force use CircularProgressIndicator on cuperitno. use CircularProgressIndicator by material *** use material = { forceUseCupertino: true } force use CupertinoActivityIndicator on material.
BaseMaterialWidget
自定义SplashFactory的Material组件
BaseRefresh
BaseIndicator use CustomScrollView + CupertinoSliverRefreshControl by cupertino *** use cupertino = { forceUseMaterial: true } force use RefreshIndicator on cuperitno. use RefreshIndicator by material *** use material = { forceUseCupertino: true } force use CupertinoSliverRefreshControl on material.
BaseRoute<T>
BaseRoute use CupertinoPageRoute or CupertinoButton.filled by cupertino *** use cupertino = { forceUseMaterial: true } force use MaterialPageRoute on cuperitno. use MaterialPageRoute *** use material = { forceUseCupertino: true } force use CupertinoPageRoute on material.
BaseScaffold
BaseScaffold use CupertinoPageScaffold by cupertino, tab's scaffold use CupertinoTabScaffold *** use cupertino = { forceUseMaterial: true } force use Scaffold on cuperitno. use Scaffold by material *** use material = { forceUseCupertino: true } force use CupertinoPageScaffold/CupertinoTabScaffold on material.
BaseScrollBar
BaseScrollBar use CupertinoScrollbar by cupertino *** use cupertino = { forceUseMaterial: true } force use Scrollbar on cuperitno. use Scrollbar by material *** use material = { forceUseCupertino: true } force use CupertinoScrollbar on material.
BaseSection
BaseSection use custom Container by cupertino or material
BaseSectionDivider
BaseSlider
BaseSlider cupertino,use CupertinoSlider *** use cupertino = { forceUseMaterial: true } force use Slider material,use Slider *** use material = { forceUseCupertino: true } force use CupertinoSlider
BaseState<T extends BaseStatefulWidget>
BaseStatefulWidget
基础状态组件 cupertino使用buildByCupertino方法构建,material使用buildByMaterial方法构建 *** 参数 1、cupertino模式:从cupertino里取对应的值,取不到则取公共参数 2、material模式:从material里取对应的值,取不到则取公共参数 3、cupertino模式下可以使用 cupertino = { forceUseMaterial: true } 强制使用material模式构建 使用 cupertino = { disabled: true } 禁止构建 4、material模式下可以使用 material = { forceUseCupertino: true } 强制使用cupertino模式构建 使用 material = { disabled: true } 禁止构建 [...]
BaseStatelessWidget
基础无状态组件 cupertino使用buildByCupertino方法构建,material使用buildByMaterial方法构建 *** 参数 1、cupertino模式:从cupertino里取对应的值,取不到则取公共参数 2、material模式:从material里取对应的值,取不到则取公共参数 3、cupertino模式下可以使用 cupertino = { forceUseMaterial: true } 强制使用material模式构建 使用 cupertino = { disabled: true } 禁止构建 4、material模式下可以使用 material = { forceUseCupertino: true } 强制使用cupertino模式构建 使用 material = { disabled: true } 禁止构建 [...]
BaseSwitch
BaseSwitch use CupertinoSwitch by cupertino *** use cupertino = { forceUseMaterial: true } force use Switch use Switch by material *** use material = { forceUseCupertino: true } force use CupertinoSwitch
BaseTabBar
BaseTabBar use CupertinoTabBar by cupertino *** not support cupertino = { forceUseMaterial: true }. use BottomNavigationBar by material *** not support material = { forceUseCupertino: true }.
BaseTabScaffold
BaseTabScaffold use CupertinoTabScaffold by cupertino *** use cupertino = { forceUseMaterial: true } to force use Scaffold material,use Scaffold by material *** use material = { forceUseCupertino: true } to force use CupertinoTabScaffold
BaseTextField
use CupertinoTextField by cupertino *** use cupertino = { forceUseMaterial: true } force use TextField on cuperitno. use TextField by material *** use material = { forceUseCupertino: true } force use CupertinoTextField on material.
BaseTheme
Reference Theme 参考自Theme
BaseThemeData
BaseThemeData Special properties values global setting 参考 ThemeData
BaseTile
BaseTile use custom InkWell by cupertino *** use cupertino = { forceUseMaterial: true } force use ListTile on cuperitno. use ListTile by material *** use material = { forceUseCupertino: true } force use custom InkWell on material.
RandomColor
随机颜色
WithoutSplashFactory
去除水波纹效果,但还是有200毫秒的延迟高亮

Constants

disabled → const String
如何使用 cupertino: const <String, dynamic>{ disabled: true } [...]
'disabled'
forceUseCupertino → const String
material: const <String, dynamic>{ forceUseCupertino: true } 强制使用cupertino组件,在参数material中使用,慎用,后续可能会删除
'forceUseCupertino'
forceUseMaterial → const String
组件之间是有关联性的,如Material组件很多要求要有Material Widget祖先, 单组件设置forceUseMaterial或forceUseCupertino可能会发生无法预料的错误 如需更改模式,建议直接在app级别上修改整个app的模式(设置targetPlatform参数) [...]
'forceUseMaterial'

Properties

basePlatform ↔ TargetPlatform
read / write
useCupertino → bool
build by Cupertino
read-only
useMaterial → bool
build by Material
read-only
withoutSplashOnCupertino ↔ bool
read / write

Functions

argbToColor(String argb) → Color
argb转成Color
closeBaseDrawer(GlobalObjectKey<BaseDrawerState> drawerKey) → void
closeBaseExpansion(GlobalKey<BaseExpansionState> key) → void
colorToArgb(Color color) → String
颜色转成argb格式
colorToRgb(Color color) → String
Color转成rgb格式
colorToRgba(Color color) → String
颜色转成rgba格式
isDark(Color color) → bool
是否暗颜色
isLight(Color color) → bool
是否亮颜色
openBaseDrawer<T>(BuildContext context, BaseDrawer drawer, {bool rootNavigator = true}) → Future<T>
openBaseExpansion<T>(BuildContext context, BaseExpansion baseExpansion) → Future<T>
pushBaseRoute<T extends Object>(BaseRoute<T> baseRoute, BuildContext context, {bool rootNavigator = false, bool nullOk = false}) → Future<T>
Navigator.push
pushBaseRouteAndRemoveUntil<T extends Object>(BaseRoute<T> baseRoute, BuildContext context, {bool rootNavigator = false, bool nullOk = false, RoutePredicate predicate}) → Future<T>
Navigator.pushAndRemoveUntil
rgbaToColor(String rgba) → Color
rgba转成Color
rgbToColor(String rgb) → Color
rgb转成Color
setPlatform({TargetPlatform targetPlatform, bool withoutSplashOnCupertino = true}) → void
set the platform
showBaseAlertDialog<T>(BaseAlertDialog alertDialog, BuildContext context, {bool barrierDismissible = true, bool useRootNavigator = true}) → Future<T>
showDialog