更新抽屉打开的方式

null_safety
小赖 4 years ago
parent 6c27b312fd
commit 579fb8e260

@ -28,7 +28,15 @@ class _ExampleDrawerState extends State<ExampleDrawer> {
return ASLongButton.solid( return ASLongButton.solid(
title: 'DRAWER', title: 'DRAWER',
onPressed: () { onPressed: () {
Scaffold.of(context).openEndDrawer(); showASDrawer(ASDrawer(
children: [
Text('title'),
],
bottom: ASLongButton.solid(
title: '确定',
onPressed: () {},
),
));
}, },
); );
}, },

@ -1,8 +1,36 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ansu_ui/utils/screen_adapter.dart'; import 'package:ansu_ui/utils/screen_adapter.dart';
import 'package:get/get.dart';
///
Future showASDrawer(Widget drawer) async {
return await Get.generalDialog(
pageBuilder: (context, animation, secondAnimation) {
return drawer;
},
transitionBuilder: (context, animation, secondaryAnimation, child) {
return SlideTransition(
position: Tween(
end: Offset(0, 0),
begin: Offset(1, 0),
).animate(
CurvedAnimation(
parent: animation,
curve: Curves.easeInOutCubic,
),
),
child: child,
);
},
barrierDismissible: true,
barrierLabel: 'filter',
);
}
/// ///
///
///使`showASDrawer`使`Scaffold``drawer``endDrawer`
class ASDrawer extends StatefulWidget { class ASDrawer extends StatefulWidget {
///List Children ///List Children
/// ///

@ -118,6 +118,13 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
get:
dependency: "direct main"
description:
name: get
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.25.6"
http: http:
dependency: transitive dependency: transitive
description: description:

@ -20,6 +20,7 @@ dependencies:
aku_ui: aku_ui:
git: git:
url: http://test.akuhotel.com:8099/aku_fe/aku_ui.git url: http://test.akuhotel.com:8099/aku_fe/aku_ui.git
get:
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

Loading…
Cancel
Save