53 lines
1.6 KiB
Dart
53 lines
1.6 KiB
Dart
|
|
import 'package:design/design.dart';
|
||
|
|
import 'package:example/pages/toast/toast_controller.dart';
|
||
|
|
import 'package:guru_widgets/guru_widgets.dart';
|
||
|
|
import 'package:guru_popup/guru_popup.dart';
|
||
|
|
|
||
|
|
class ToastPage extends GetWidget<ToastController> {
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return Scaffold(
|
||
|
|
backgroundColor: const Color(0xFF121212),
|
||
|
|
appBar: AppBar(
|
||
|
|
title: const Text('Guru Toast'),
|
||
|
|
backgroundColor: Colors.transparent,
|
||
|
|
elevation: 0,
|
||
|
|
centerTitle: true,
|
||
|
|
),
|
||
|
|
body: Column(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||
|
|
children: [
|
||
|
|
const SizedBox(height: 10),
|
||
|
|
GuruButton(
|
||
|
|
size: const Size(80, 48),
|
||
|
|
fillType: GuruButtonFillType.solid,
|
||
|
|
action: '短提示',
|
||
|
|
onPressed: () {
|
||
|
|
GuruPopup.instance.showCommonToast('A message');
|
||
|
|
},
|
||
|
|
),
|
||
|
|
const SizedBox(height: 10),
|
||
|
|
GuruButton(
|
||
|
|
size: const Size(80, 48),
|
||
|
|
fillType: GuruButtonFillType.solid,
|
||
|
|
action: '中长提示',
|
||
|
|
onPressed: () {
|
||
|
|
GuruPopup.instance.showCommonToast('A message should be a short');
|
||
|
|
},
|
||
|
|
),
|
||
|
|
const SizedBox(height: 10),
|
||
|
|
GuruButton(
|
||
|
|
size: const Size(80, 48),
|
||
|
|
fillType: GuruButtonFillType.solid,
|
||
|
|
action: '长提示',
|
||
|
|
onPressed: () {
|
||
|
|
GuruPopup.instance
|
||
|
|
.showCommonToast('A message should be a long long long long long long');
|
||
|
|
},
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|