add dialog not done yet

null_safety
小赖 4 years ago
parent fbe602c85f
commit 6d68d0e44e

@ -3,7 +3,6 @@
## dep 依赖
![flutter_screenutil](https://img.shields.io/badge/flutter__screenutil-3.2.0-brightgreen)
![get](https://img.shields.io/badge/get-3.17.1-brightgreen)
## Getting Started
@ -19,7 +18,17 @@ minSdkVersion 21
## 贡献
[@laiiihz](http://192.168.2.201:8099/u/laiiihz)
[@zhang](http://192.168.2.201:8099/u/zhangmeng)
-----
### 组件命名
* 文件命名规则 `as_***`,例如 `as_button`
* 类名命名规则 `AS***`,例如`ASButton`
## ROADMAP
- [ ] Dialog
- [ ] ListTile

@ -0,0 +1,28 @@
import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class ExampleDialog extends StatefulWidget {
ExampleDialog({Key key}) : super(key: key);
@override
_ExampleDialogState createState() => _ExampleDialogState();
}
class _ExampleDialogState extends State<ExampleDialog> {
@override
Widget build(BuildContext context) {
return ASScaffold(
title: '对话框 Dialog',
body: ListView(
children: [
ASButton.info(
title: '打开对话框',
onPressed: () {
Get.dialog(ASDialog());
}),
],
),
);
}
}

@ -1,5 +1,6 @@
import 'package:ansu_ui/ansu_ui.dart';
import 'package:example/example_bottom_button.dart';
import 'package:example/example_dialog.dart';
import 'package:example/example_drawer.dart';
import 'package:example/example_tag.dart';
import 'package:flutter/material.dart';
@ -93,6 +94,10 @@ class _MyHomePageState extends State<MyHomePage> {
title: '抽屉 DRAWER',
onPressed: () => Get.to(ExampleDrawer()),
),
ASButton.info(
title: '对话框 Dialog',
onPressed: () => Get.to(ExampleDialog()),
),
],
),
);

@ -10,6 +10,7 @@ export 'bar/as_tabbar.dart';
export 'drawer/as_drawer.dart';
export 'pickers/as_date_picker.dart';
export 'pickers/as_picker_box.dart';
export 'dialog/as_dialog.dart';
export 'utils/screen_adapter.dart';

@ -1,7 +1,6 @@
import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
///
///
@ -18,7 +17,7 @@ class ASBackButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return navigator.canPop()
return Navigator.canPop(context)
? IconButton(
icon: Icon(
CupertinoIcons.chevron_back,

@ -0,0 +1,53 @@
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ASDialog extends StatefulWidget {
ASDialog({Key key}) : super(key: key);
@override
_ASDialogState createState() => _ASDialogState();
}
class _ASDialogState extends State<ASDialog> {
@override
Widget build(BuildContext context) {
return Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 28.w),
child: Material(
color: kForegroundColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.w),
),
child: Stack(
children: [
Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 100,
),
],
),
Positioned(
right: 0,
top: 0,
child: IconButton(
iconSize: 20.w,
icon: Icon(
CupertinoIcons.clear_circled,
color: Color(0xFF060606).withOpacity(0.85),
),
onPressed: () => Navigator.pop(context),
splashRadius: 16.w,
),
),
],
),
),
),
);
}
}

@ -67,13 +67,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
get:
dependency: "direct main"
description:
name: get
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.17.1"
matcher:
dependency: transitive
description:
@ -157,5 +150,5 @@ packages:
source: hosted
version: "2.1.0-nullsafety.3"
sdks:
dart: ">=2.10.0 <2.11.0"
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.17.0"

@ -11,7 +11,6 @@ dependencies:
flutter:
sdk: flutter
flutter_screenutil: ^3.2.0
get: ^3.17.1
dev_dependencies:
flutter_test:

Loading…
Cancel
Save