Last updated:
0 purchases
flutter ritl alert
flutter_ritl_alert #
青岛地铁APP中使用的AlertController flutter版本
引用 #
dependencies:
flutter_ritl_alert: ^0.0.1
copied to clipboard
or
dependencies:
flutter_ritl_alert:
git: [email protected]:RITL/flutter_ritl_alert.git
copied to clipboard
then run flutter packages get
无按钮 #
RITLAlert(
context: context,
title: "我是RITLAlert",
message: "开启一下GPS定位吧。",
).show();
copied to clipboard
默认方式 #
RITLAlert(
context: context,
title: "我是RITLAlert",
message: "开启一下GPS定位吧。",
buttons: [
RITLAlertAction(
title: "知道啦",
type: RITLAlertActionType.normal,
onPressed: (alert, action) => print("我点击啦知道啦"),
),
RITLAlertAction(
title: "取消吧",
type: RITLAlertActionType.destructive,
onPressed: (alert, action) => print("我点击啦取消吧"),
),
],
).show();
copied to clipboard
自定义方式 #
RITLAlert(
context: context,
title: "我是RITLAlert",
message: "开启一下GPS定位吧。",
buttons: [
RITLAlertAction(
title: "自定义啦",
type: RITLAlertActionType.custom,
style: TextStyle(
color: Color.fromRGBO(47, 189, 75, 1),
fontWeight: FontWeight.w500,
),
onPressed: (alert, action) => print("我点击自定义"),
),
RITLAlertAction(
title: "知道啦",
type: RITLAlertActionType.normal,
onPressed: (alert, action) => print("我点击啦知道啦"),
),
RITLAlertAction(
title: "取消吧",
type: RITLAlertActionType.destructive,
onPressed: (alert, action) => print("我点击啦取消吧"),
),
]).show();
copied to clipboard
自定义Style #
RITLAlert(
context: context,
title: "我是RITLAlert",
message: "开启一下GPS定位吧。",
buttons: [
RITLAlertAction(
title: "知道啦",
type: RITLAlertActionType.normal,
onPressed: (alert, action) => print("我点击啦知道啦"),
),
RITLAlertAction(
title: "取消吧",
type: RITLAlertActionType.destructive,
onPressed: (alert, action) => print("我点击啦取消吧"),
),
],
style: RITLAlertStyle(
backgroundColor: CupertinoColors.black,
separateColor: CupertinoColors.white,
titleStyle: TextStyle(color: CupertinoColors.white),
messageStyle: TextStyle(color: CupertinoColors.white),
),
).show();
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.