添加部分通用组件

添加列表/路由扩展
修改个人信息页界面
hmxc
张萌 4 years ago
parent 4944b612ad
commit f8123313c0

@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class AkuDivider extends StatelessWidget {
final double thickness;
final bool isHorizontal;
final double indent;
final double endIndent;
final Color color;
const AkuDivider(
{Key key,
this.isHorizontal,
this.indent,
this.endIndent,
this.thickness,
this.color})
: super(key: key);
AkuDivider.horizontal({Key key, this.indent, this.endIndent})
: isHorizontal = true,
thickness = 1.w,
color = Color(0xFFE8E8E8),
super(key: key);
AkuDivider.vertical({Key key, this.indent, this.endIndent})
: isHorizontal = false,
thickness = 1.w,
color = Color(0xFFE8E8E8),
super(key: key);
@override
Widget build(BuildContext context) {
return isHorizontal
? Divider(
height: 0,
thickness: this.thickness ?? 1.w,
indent: this.indent ?? 0,
endIndent: this.endIndent ?? 0,
color: this.color ?? Color(0xFFE8E8E8),
)
: VerticalDivider(
width: 0,
thickness: this.thickness ?? 1.w,
indent: this.indent ?? 0,
endIndent: this.endIndent ?? 0,
color: this.color ?? Color(0xFFE8E8E8),
);
}
}

@ -0,0 +1,15 @@
import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
extension WidgetListExt on List<Widget> {
List<Widget> sepWidget({Widget separate}) {
if (this.isEmpty) return [];
return List.generate(this.length * 2 - 1, (index) {
if (index.isEven)
return this[index ~/ 2];
else
return separate ?? 10.w.heightBox;
});
}
}

@ -0,0 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
extension PageExt on Widget {
Function get to => () => Get.to(this);
}

@ -5,9 +5,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
///线
class AkuDiveder {
class GridientDiveder {
final bool isReverse; //
const AkuDiveder({Key key, this.isReverse = false});
const GridientDiveder({Key key, this.isReverse = false});
Widget verticalDivider(double height) {
return Container(
width: 1.w,

@ -532,20 +532,20 @@ class _HomePageState extends State<HomePage> {
children: [
_card(AllModel(context).waitThings?.length, '未处理事项',
Color(0xFFFF4E0D), 0),
AkuDiveder().verticalDivider(166.5.w),
GridientDiveder().verticalDivider(166.5.w),
_card(AllModel(context).processingThings?.length,
'处理中事项', Color(0xFFFFC40C), 1),
],
),
Row(children: [
AkuDiveder().horizontalDivider(343.w),
AkuDiveder(isReverse: true).horizontalDivider(343.w)
GridientDiveder().horizontalDivider(343.w),
GridientDiveder(isReverse: true).horizontalDivider(343.w)
]),
Row(
children: [
_card(AllModel(context).doneThings?.length, '已处理事项',
Color(0xFF3F8FFE), 2),
AkuDiveder(isReverse: true).verticalDivider(
GridientDiveder(isReverse: true).verticalDivider(
166.5.w,
),
_card(AllModel(context).allThings?.length, '全部事项',

@ -1,4 +1,5 @@
// Flutter imports:
import 'package:aku_community_manager/tools/aku_divider.dart';
import 'package:flutter/material.dart';
// Package imports:
@ -12,6 +13,7 @@ import 'package:aku_community_manager/ui/widgets/app_widgets/aku_avatar.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_tile.dart';
import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart';
import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart';
class UserInfoPage extends StatefulWidget {
UserInfoPage({Key key}) : super(key: key);
@ -49,7 +51,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
title: Text('手机'),
suffix: Text(TextUtil.hideNumber(userProvider.infoModel.tel)),
),
],
].sepWidget(separate: AkuDivider.horizontal()),
),
);
}

@ -1,6 +1,13 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
url: "https://pub.flutter-io.cn"
source: hosted
version: "14.0.0"
aku_ui:
dependency: "direct main"
description:
@ -38,6 +45,20 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.14.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.41.2"
animator:
dependency: transitive
description:
name: animator
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.2"
args:
dependency: transitive
description:
@ -52,6 +73,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.5.0-nullsafety.1"
auto_size_text:
dependency: transitive
description:
name: auto_size_text
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
boolean_selector:
dependency: transitive
description:
@ -150,6 +178,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.0"
dart_style:
dependency: transitive
description:
name: dart_style
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.12"
decimal:
dependency: transitive
description:
@ -211,6 +246,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_asset_generator:
dependency: "direct dev"
description:
name: flutter_asset_generator
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.1"
flutter_easyrefresh:
dependency: "direct main"
description:
@ -352,6 +394,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.16.1"
io:
dependency: transitive
description:
name: io
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.4"
jpush_flutter:
dependency: "direct main"
description:
@ -408,6 +457,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
package_config:
dependency: transitive
description:
name: package_config
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.3"
path:
dependency: transitive
description:
@ -522,6 +578,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.3.2+2"
pub_semver:
dependency: transitive
description:
name: pub_semver
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.4"
qr_code_scanner:
dependency: "direct main"
description:
@ -555,6 +618,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.10.0-nullsafety.1"
states_rebuilder:
dependency: transitive
description:
name: states_rebuilder
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.0"
stream_channel:
dependency: transitive
description:
@ -639,6 +709,20 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0-nullsafety.3"
velocity_x:
dependency: "direct main"
description:
name: velocity_x
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.1"
watcher:
dependency: transitive
description:
name: watcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.9.7+15"
win32:
dependency: transitive
description:

@ -46,7 +46,9 @@ dependencies:
amap_map_fluttify: ^0.29.0
permission_handler: ^5.0.1+1
velocity_x: ^1.3.1
dio:
power_logger:
@ -66,6 +68,7 @@ dev_dependencies:
sdk: flutter
import_sorter:
grinder:
flutter_asset_generator: ^0.6.1
flutter:
uses-material-design: true

Loading…
Cancel
Save