You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansu_ui/example/lib/widgets/example_toast.dart

33 lines
905 B

import 'package:ansu_ui/toast/as_toast.dart';
import 'package:example/codeviewer/code_segments.dart';
import 'package:example/component/example_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
class ExampleToast extends StatelessWidget {
const ExampleToast({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return ExampleScaffold(
title: 'Toast',
text: (context) => CodeSegments.toast(context),
children: [
// BEGIN toast
ListTile(
title: 'Toast'.text.make(),
onTap: () => ASToast.show('Toast!'),
),
ListTile(
title: 'Toast'.text.make(),
onTap: () {
Function cancel = ASToast.loading;
Future.delayed(Duration(seconds: 2), () => cancel());
},
),
// END
],
);
}
}