update screenutil

null_safety
小赖 4 years ago
parent 0dc3065e95
commit a018cfb870

@ -3,7 +3,6 @@ import 'package:example/main_extention.dart';
import 'package:example/main_home.dart'; import 'package:example/main_home.dart';
import 'package:example/main_utils.dart'; import 'package:example/main_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';

@ -76,3 +76,4 @@ export 'theme/as_theme.dart';
//third party //third party
export 'package:velocity_x/velocity_x.dart'; export 'package:velocity_x/velocity_x.dart';
export 'package:flutter_screenutil/flutter_screenutil.dart';

@ -32,7 +32,7 @@ class ASBottomDialog extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
...items.sepWidget(separate: ASDivider())!, ...(items??[]).sepWidget(separate: ASDivider()),
10.hb, 10.hb,
_buildCancel(context), _buildCancel(context),
], ],

@ -73,8 +73,8 @@ class ASDialog extends StatelessWidget {
), ),
), ),
), ),
...items ...(items ?? [])
.sepWidget(separate: SizedBox(height: _widgetSpacer))!, .sepWidget(separate: SizedBox(height: _widgetSpacer)),
], ],
), ),
), ),

@ -1,13 +1,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:ansu_ui/extension/num_extension.dart'; import 'package:ansu_ui/extension/num_extension.dart';
extension SeparateExt on List<Widget>? { extension SeparateExt on List<Widget> {
List<Widget>? sepWidget({Widget? separate}) { List<Widget> sepWidget({Widget? separate}) {
if (this == null) return null; if (this.isEmpty) return [];
if (this!.isEmpty) return []; return List.generate(this.length * 2 - 1, (index) {
return List.generate(this!.length * 2 - 1, (index) {
if (index.isEven) if (index.isEven)
return this![index ~/ 2]; return this[index ~/ 2];
else else
return separate ?? 10.wb; return separate ?? 10.wb;
}); });

@ -109,14 +109,14 @@ class _ASCardExpandableState extends State<ASCardExpandable> {
children: [ children: [
SizedBox(), SizedBox(),
...widget.children, ...widget.children,
].sepWidget(separate: ASDivider(indent: 10.w, endIndent: 10.w))!, ].sepWidget(separate: ASDivider(indent: 10.w, endIndent: 10.w)),
), ),
expanded: Column( expanded: Column(
children: [ children: [
SizedBox(), SizedBox(),
...(widget.custom ? <Widget>[] : widget.children), ...(widget.custom ? <Widget>[] : widget.children),
...widget.extra, ...widget.extra,
].sepWidget(separate: ASDivider(indent: 10.w, endIndent: 10.w))!, ].sepWidget(separate: ASDivider(indent: 10.w, endIndent: 10.w)),
), ),
), ),
); );

@ -23,6 +23,7 @@ class ASTheme {
textTheme: ThemeData.light().textTheme.apply( textTheme: ThemeData.light().textTheme.apply(
displayColor: Color(0xFF333333), displayColor: Color(0xFF333333),
bodyColor: Color(0xFF333333), bodyColor: Color(0xFF333333),
fontFamily: 'NotoSansSC',
), ),
inputDecorationTheme: InputDecorationTheme(), inputDecorationTheme: InputDecorationTheme(),
primaryColor: kPrimaryColor, primaryColor: kPrimaryColor,

@ -86,7 +86,7 @@ class _CameraViewState extends State<CameraView> {
title: '确认', title: '确认',
onPressed: () => Navigator.pop(context, widget.file), onPressed: () => Navigator.pop(context, widget.file),
), ),
].sepWidget(separate: ASDivider())!, ].sepWidget(separate: ASDivider()),
), ),
), ),
); );

Loading…
Cancel
Save