Comments (2)
- 你的问题,代码实例给出了,你看下吧
class TestPage extends StatelessWidget {
const TestPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
alignment: Alignment.center,
child: ElevatedButton(
onPressed: () => _onTap(context),
child: const Text("弹窗"),
),
),
);
}
void _onTap(BuildContext context) {
SmartDialog.show(
onDismiss: () => FocusScope.of(context).requestFocus(),
builder: (context) {
return AnimatedPadding(
padding: MediaQuery.of(context).viewInsets,
duration: const Duration(milliseconds: 100),
child: Container(
height: 100,
width: 300,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
),
alignment: Alignment.center,
child: const TextField(),
),
);
},
);
}
}
from flutter_smart_dialog.
感谢,可以了!
开始试了不行,以为关键是Scaffold,然后我用的SmartDialog.showAttach,跟实例不一样。方法不对路,所以不行。
后来发现关键是MediaQuery.of(context).viewInsets。
from flutter_smart_dialog.
Related Issues (20)
- 通过smartDialog.show的形式自定义的widget上有输入框键盘遮挡问题。 HOT 3
- fluent_ui库如何初始化smartdialog? HOT 12
- SmartDialog.show时超出builder的部分无法响应点击 HOT 5
- isolate中弹窗无效,提示并未初始化,有没有什么在isolate中使用的方案 HOT 1
- visibility_detector 在iOS上 左滑返回有几率会出发两次 HOT 1
- dialog和toast交替切换操作,控制台会报以下错误,且 HOT 1
- lastToast没有在overlayEntry.remove()的时候判断mounted,导致有几率报错 HOT 3
- 需求 HOT 2
- bindWidget 没有作用 HOT 2
- 4.9.7Adaptation problem HOT 4
- Looking up a deactivated widget's ancestor is unsafe. HOT 21
- release模式dialog完全出不来 HOT 7
- 网络请求封装不显示toast HOT 11
- dialog和loading显示/隐藏 异常 HOT 1
- After upgrade, context error HOT 5
- Dialog doesn't show up HOT 4
- 和getx配合使用,最新flutter sdk有问题。 HOT 6
- showLoading()需求 HOT 1
- 配合getx使用,dismiss后getxcontroller没有调用onDelete关闭掉 HOT 1
- E/flutter ( 6354): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: LateInitializationError: Field 'contextCustom' has not been initialized. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_smart_dialog.