add get support

null_safety
小赖 4 years ago
parent df8a05c694
commit 2b8b67dfeb

@ -1,8 +1,9 @@
# ansu_ui 安速物流移动组件 # ansu_ui 安速物流移动组件
## dep ## dep 依赖
![flutter_screenutil](https://img.shields.io/badge/flutter__screenutil-3.2.0-brightgreen) ![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 ## Getting Started

@ -55,6 +55,12 @@ class _MyHomePageState extends State<MyHomePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ASScaffold( return ASScaffold(
leading: navigator.canPop()
? IconButton(
icon: Icon(Icons.backpack, color: Colors.black),
onPressed: () {},
)
: SizedBox(),
title: '安速组件', title: '安速组件',
body: ListView( body: ListView(
padding: EdgeInsets.all(16.w), padding: EdgeInsets.all(16.w),

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

@ -27,7 +27,7 @@ class ASScaffold extends StatefulWidget {
final PreferredSizeWidget appBarBottom; final PreferredSizeWidget appBarBottom;
/// `EndDrawer` endDrawer /// `EndDrawer` endDrawer
/// ///
/// ///
final Widget endDrawer; final Widget endDrawer;
ASScaffold({ ASScaffold({
@ -54,7 +54,7 @@ class _ASScaffoldState extends State<ASScaffold> {
appBar: AppBar( appBar: AppBar(
backgroundColor: kForegroundColor, backgroundColor: kForegroundColor,
elevation: 0, elevation: 0,
leading: ASBackButton(), leading: widget.leading ?? ASBackButton(),
centerTitle: true, centerTitle: true,
title: DefaultTextStyle( title: DefaultTextStyle(
style: TextStyle( style: TextStyle(

@ -67,6 +67,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.17.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
@ -150,5 +157,5 @@ packages:
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0-nullsafety.3"
sdks: sdks:
dart: ">=2.10.0-110 <2.11.0" dart: ">=2.10.0 <2.11.0"
flutter: ">=1.17.0" flutter: ">=1.17.0"

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

Loading…
Cancel
Save