Commit 321694ab authored by jinzhu's avatar jinzhu

update

parent 6d4fbd9f
package io.flutter.facade;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.arch.lifecycle.Lifecycle;
import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.OnLifecycleEvent;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import io.flutter.plugin.common.BasicMessageChannel;
import io.flutter.plugin.common.StringCodec;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.view.FlutterMain;
import io.flutter.view.FlutterNativeView;
import io.flutter.view.FlutterRunArguments;
import io.flutter.view.FlutterView;
import io.flutter.plugins.GeneratedPluginRegistrant;
/**
* Main entry point for using Flutter in Android applications.
......
......@@ -2,12 +2,12 @@ package io.flutter.facade;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import io.flutter.view.FlutterView;
/**
......
......@@ -38,7 +38,7 @@ dependencies {
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
testImplementation 'junit:junit:4.12'
}
......@@ -3,4 +3,4 @@ include ':app'
rootProject.name = 'android_generated'
setBinding(new Binding([gradle: this]))
evaluate(new File('include_flutter.groovy'))
evaluate(new File(settingsDir, 'include_flutter.groovy'))
......@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
......
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/mac/development/flutter
FLUTTER_APPLICATION_PATH=/Users/mac/code/gmalpha_flutter
FLUTTER_TARGET=lib/main.dart
FLUTTER_TARGET=/Users/mac/code/gmalpha_flutter/lib/main.dart
FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build/ios
FLUTTER_BUILD_NAME=1.0.0
......
......@@ -23,7 +23,7 @@ end
def flutter_root(f)
generated_xcode_build_settings = parse_KV_file(File.join(f, File.join('.ios', 'Flutter', 'Generated.xcconfig')))
if generated_xcode_build_settings.empty?
puts "Generated.xcconfig must exist. Make sure `flutter packages get` is executed in #{f}."
puts "Generated.xcconfig must exist. Make sure `flutter pub get` is executed in #{f}."
exit
end
generated_xcode_build_settings.map { |p|
......
platform :ios, '8.0'
#open source
source 'https://github.com/CocoaPods/Specs.git'
#our company
source 'git@git.wanmeizhensuo.com:gengmeiios/GMSpecs.git'
target 'Runner' do
flutter_application_path = '../'
eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)
......
......@@ -7,7 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
741F496221355F47001E2961 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 741F495E21355F27001E2961 /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
741F496821356857001E2961 /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 741F496521356807001E2961 /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
74974048213559DB008C567A /* Release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 74974046213559DB008C567A /* Release.xcconfig */; };
74974049213559DB008C567A /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 74974047213559DB008C567A /* Debug.xcconfig */; };
......@@ -17,6 +16,7 @@
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
DA920DF7267BFA3D8637F495 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 35774BCD44364EC525CFFDCC /* libPods-Runner.a */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -27,7 +27,6 @@
dstSubfolderSpec = 10;
files = (
741F496821356857001E2961 /* App.framework in Embed Frameworks */,
741F496221355F47001E2961 /* Flutter.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -35,6 +34,9 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
02E16F65B185B1E5853D0A9D /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
35774BCD44364EC525CFFDCC /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5372C2777A642A45C90EA956 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
741F495E21355F27001E2961 /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = ../.ios/Flutter/engine/Flutter.framework; sourceTree = "<group>"; };
741F496521356807001E2961 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = ../.ios/Flutter/App.framework; sourceTree = "<group>"; };
74974046213559DB008C567A /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
......@@ -49,6 +51,7 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C42C8CC40B760DD2C88D43D5 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -56,6 +59,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
DA920DF7267BFA3D8637F495 /* libPods-Runner.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -72,6 +76,14 @@
path = Config;
sourceTree = "<group>";
};
8D3D68B3993FF6F5F7F88296 /* Frameworks */ = {
isa = PBXGroup;
children = (
35774BCD44364EC525CFFDCC /* libPods-Runner.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
......@@ -89,6 +101,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
F7282BDAEDDF68E0EE2727F1 /* Pods */,
8D3D68B3993FF6F5F7F88296 /* Frameworks */,
);
sourceTree = "<group>";
};
......@@ -122,6 +136,16 @@
name = "Supporting Files";
sourceTree = "<group>";
};
F7282BDAEDDF68E0EE2727F1 /* Pods */ = {
isa = PBXGroup;
children = (
C42C8CC40B760DD2C88D43D5 /* Pods-Runner.debug.xcconfig */,
5372C2777A642A45C90EA956 /* Pods-Runner.release.xcconfig */,
02E16F65B185B1E5853D0A9D /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
......@@ -129,12 +153,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
5448CCD2387487D8249AAB6E /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
741F496321355F47001E2961 /* Embed Frameworks */,
6C71C66E015792C2A881863B /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
......@@ -151,7 +177,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0910;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
......@@ -161,7 +187,7 @@
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
......@@ -208,6 +234,46 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
};
5448CCD2387487D8249AAB6E /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
6C71C66E015792C2A881863B /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/engine/Flutter.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
......@@ -270,12 +336,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
......@@ -310,7 +378,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = S8QB4VV633;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
......@@ -341,12 +409,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
......@@ -394,12 +464,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
......@@ -434,6 +506,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
......@@ -458,6 +531,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
......@@ -500,7 +574,6 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......@@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
......@@ -46,7 +45,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
......
......@@ -4,4 +4,7 @@
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
......@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
......
......@@ -23,17 +23,9 @@ class _MyAppState extends State<MyApp> {
_init();
FlutterBoost.singleton.registerPageBuilders({
// 'first': (pageName, params, _) => FirstRouteWidget(),
// 'second': (pageName, params, _) => SecondRouteWidget(),
// 'tab': (pageName, params, _) => TabRouteWidget(),
// 'flutterFragment': (pageName, params, _) => FragmentRouteWidget(params),
'comment_suggest': (pageName, params, _) => CommentSuggest(params),
// ///可以在native层通过 getContainerParams 来传递参数
// 'flutterPage': (pageName, params, _) {
// print("flutterPage params:$params");
// return FlutterRouteWidget();
// },
'message_home': (pageName, params, _) => MessageHomePage(),
});
FlutterBoost.handleOnStartPage();
}
......
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/model/message/message.dart' as prefix0;
// import 'package:gmalpha_flutter/model/message/message.dart' as prefix0;
import 'package:gmalpha_flutter/pages/message/home/message_notification_item.dart';
import 'message_item.dart';
import 'package:gmalpha_flutter/model/message/message.dart';
import 'package:gmalpha_flutter/netWork/DioUtil.dart';
import 'package:gmalpha_flutter/toast/toast.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter/semantics.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
class MessageHomePage extends StatefulWidget {
@override
_MessageHomePageState createState() => _MessageHomePageState();
}
class _MessageHomePageState extends State<MessageHomePage> with AutomaticKeepAliveClientMixin {
class _MessageHomePageState extends State<MessageHomePage> {
List<ListItem> messageList = List<ListItem>();
List<ListItem> dataArr = List<ListItem>();
int pageIndex = 1;
@override
bool get wantKeepAlive => true;
RefreshController _refreshController =
RefreshController(initialRefresh: true);
void _onRefresh() async{
// dataArr = await _fetchListData();
// if (mounted) setState(() {
// dataArr = dataArr;
// });
// _refreshController.refreshCompleted();
}
void _onLoading() async{
// monitor network fetch
// pageIndex ++;
// List<ListItem> newData = List<ListItem>();
// newData = await _fetchMesssageList();
// this.dataArr.addAll(newData);
// if (mounted) setState(() {
// dataArr = dataArr;
// });
// _refreshController.loadComplete();
}
Future<List<ListItem>> _fetchMesssageList() async {
List<Message> messageList = List<Message>();
print('aaaaa');
BaseResp<List> baseresp = await DioUtil().request<List>(Method.get, "api/v1/reply/my", queryParameters: {'page': 1, 'count': 10});
if (baseresp.code != 0) {
return new Future.error(baseresp.msg);
......@@ -36,11 +53,11 @@ class _MessageHomePageState extends State<MessageHomePage> with AutomaticKeepAli
return Message.fromJson(value);
}).toList();
}
_refreshController.refreshCompleted();
return messageList;
}
Future<List<ListItem>> _fetchNewestInfo() async {
print('---------start----------');
List<ListItem> notiData = List<ListItem>();
BaseRespR noteResp = await DioUtil().requestR(Method.get, 'api/v1/push/newest/info');
Map noteData = noteResp.data;
......@@ -71,50 +88,63 @@ class _MessageHomePageState extends State<MessageHomePage> with AutomaticKeepAli
}
Future<List<ListItem>> _fetchListData() async {
print('---------start---------');
List<ListItem> dataArr = List<ListItem>();
dataArr = await _fetchNewestInfo();
print(dataArr);
List<ListItem> messageData = await _fetchMesssageList();
messageData.forEach((item) {
dataArr.add(item);
});
print(dataArr);
print('---------end---------');
return dataArr;
}
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('消息'),
),
floatingActionButton: new FloatingActionButton(
onPressed: () {
_fetchListData();
},
child: new Icon(Icons.add_box),
elevation: 3.0,
highlightElevation: 2.0,
backgroundColor: Colors.red, // 红色
),
body: new Center(
// appBar: new AppBar(
// title: new Text('消息'),
// ),
// floatingActionButton: new FloatingActionButton(
// onPressed: () {
// _fetchListData();
// },
// child: new Icon(Icons.add_box),
// elevation: 3.0,
// highlightElevation: 2.0,
// backgroundColor: Colors.red, // 红色
// ),
body: new Container(
child: SmartRefresher(
// enablePullDown: false,
enablePullUp: true,
// header: WaterDropHeader(),
controller: _refreshController,
// onRefresh: _onRefresh,
onLoading: _onLoading,
// footer: ClassicFooter(),
child: FutureBuilder(
future: _fetchListData(),
builder: (context, snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.none:
return new Container(height:0.0,width:0.0);
break;
case ConnectionState.waiting:
return new Container(height:0.0,width:0.0);
break;
case ConnectionState.active:
return new Container(height:0.0,width:0.0);
break;
default:
if (snapshot.hasData) {
return _createListView(context, snapshot);
} else {
return new Container(height:0.0,width:0.0);
}
}
},
),
),
)
);
}
......@@ -126,14 +156,15 @@ class _MessageHomePageState extends State<MessageHomePage> with AutomaticKeepAli
shrinkWrap: true,
key: new PageStorageKey('message-list'),
itemCount: dataArr.length,
itemBuilder: (BuildContext context, int index) {
itemBuilder: (context,index) {
ListItem item = dataArr[index];
if (item is Message) {
return new MessageItem(onPressed: (){}, message:item);
} else if (item is NotificationItem){
return new MessageNotificationItem(onPressed: (){}, notification: item);
} else {
return Text('类型错误');
}
},
);
}
......
......@@ -50,7 +50,7 @@ class MessageNotificationItem extends StatelessWidget {
),
);
} else {
content = new Container(height:0.0,width:0.0)
content = new Container(height:0.0,width:0.0);
}
return content;
}
......
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
analyzer:
dependency: transitive
......@@ -21,7 +21,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
version: "2.2.0"
boolean_selector:
dependency: transitive
description:
......@@ -176,13 +176,6 @@ packages:
url: "https://github.com/alibaba/flutter_boost.git"
source: git
version: "0.0.411"
flutter_easyrefresh:
dependency: "direct main"
description:
name: flutter_easyrefresh
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.7"
flutter_test:
dependency: "direct dev"
description: flutter
......@@ -336,7 +329,7 @@ packages:
name: pedantic
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.0"
version: "1.7.0"
pool:
dependency: transitive
description:
......@@ -358,13 +351,20 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.4"
pull_to_refresh:
dependency: "direct main"
description:
name: pull_to_refresh
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.2"
version: "2.0.3"
rxdart:
dependency: "direct main"
description:
......@@ -446,7 +446,7 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.4"
version: "0.2.5"
timing:
dependency: transitive
description:
......
......@@ -31,7 +31,8 @@ dependencies:
rxdart: ^0.22.0 #链式编程
json_serializable: ^3.0.0 #json to model
build_runner: ^1.6.1
flutter_easyrefresh: ^1.2.7 # 上拉下拉刷新组件
pull_to_refresh: ^1.5.0
# flutter_easyrefresh: ^1.2.7 # 上拉下拉刷新组件
dev_dependencies:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment