Browse Source

1、去除状态控制,由widget内部实现

tags/0.0.1
PH2 4 years ago
parent
commit
c49ed1b2e9
3 changed files with 9 additions and 4 deletions
  1. +2
    -1
      lib/util/widget_creater.dart
  2. +3
    -3
      lib/util/widget_factory.dart
  3. +4
    -0
      lib/zhiying_comm.dart

+ 2
- 1
lib/util/widget_creater.dart View File

@@ -3,7 +3,8 @@ import 'package:flutter/material.dart';
abstract class WidgetCreater {
List<Widget> createWidgets(Map<String, dynamic> model);

List<Widget> createSkeleton(Map<String, dynamic> model);
// 去除骨架屏返回,由widget内部实现是否展示与关闭
// List<Widget> createSkeleton(Map<String, dynamic> model);

bool isSliverChild() {
return false;


+ 3
- 3
lib/util/widget_factory.dart View File

@@ -37,10 +37,10 @@ class WidgetFactory {
if (widgetCreaters.containsKey(name)) {
creater = widgetCreaters[name];
List<Widget> result = [];
if (type == WidgetType.normal)
// if (type == WidgetType.normal)
result = creater.createWidgets(model);
else
result = creater.createSkeleton(model);
// else
// result = creater.createSkeleton(model);
if (isSliver) {
if (creater.isSliverChild()) {
return result;


+ 4
- 0
lib/zhiying_comm.dart View File

@@ -15,6 +15,10 @@ export 'util/widget_factory.dart';
export 'util/router_util.dart';
export 'util/log/let_log.dart';

// 屏幕适配
export 'package:flutter_screenutil/flutter_screenutil.dart';


export 'util/enum_util.dart';
export 'util/encode_util.dart';



Loading…
Cancel
Save