Commit 321694ab authored by jinzhu's avatar jinzhu

update

parent 6d4fbd9f
package io.flutter.facade; package io.flutter.facade;
import android.app.Activity; import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.arch.lifecycle.Lifecycle; import android.arch.lifecycle.Lifecycle;
import android.arch.lifecycle.LifecycleObserver; import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.OnLifecycleEvent; import android.arch.lifecycle.OnLifecycleEvent;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import io.flutter.plugin.common.BasicMessageChannel; import io.flutter.plugin.common.BasicMessageChannel;
import io.flutter.plugin.common.StringCodec; import io.flutter.plugin.common.StringCodec;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.view.FlutterMain; import io.flutter.view.FlutterMain;
import io.flutter.view.FlutterNativeView; import io.flutter.view.FlutterNativeView;
import io.flutter.view.FlutterRunArguments; import io.flutter.view.FlutterRunArguments;
import io.flutter.view.FlutterView; import io.flutter.view.FlutterView;
import io.flutter.plugins.GeneratedPluginRegistrant;
/** /**
* Main entry point for using Flutter in Android applications. * Main entry point for using Flutter in Android applications.
......
...@@ -2,12 +2,12 @@ package io.flutter.facade; ...@@ -2,12 +2,12 @@ package io.flutter.facade;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import io.flutter.view.FlutterView; import io.flutter.view.FlutterView;
/** /**
......
...@@ -38,7 +38,7 @@ dependencies { ...@@ -38,7 +38,7 @@ dependencies {
implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2' implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:27.1.1' 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:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
testImplementation 'junit:junit:4.12'
} }
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
...@@ -3,4 +3,4 @@ include ':app' ...@@ -3,4 +3,4 @@ include ':app'
rootProject.name = 'android_generated' rootProject.name = 'android_generated'
setBinding(new Binding([gradle: this])) setBinding(new Binding([gradle: this]))
evaluate(new File('include_flutter.groovy')) evaluate(new File(settingsDir, 'include_flutter.groovy'))
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>App</string> <string>App</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
......
// This is a generated file; do not edit or check into version control. // This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/mac/development/flutter FLUTTER_ROOT=/Users/mac/development/flutter
FLUTTER_APPLICATION_PATH=/Users/mac/code/gmalpha_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 FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build/ios SYMROOT=${SOURCE_ROOT}/../build/ios
FLUTTER_BUILD_NAME=1.0.0 FLUTTER_BUILD_NAME=1.0.0
......
...@@ -23,7 +23,7 @@ end ...@@ -23,7 +23,7 @@ end
def flutter_root(f) def flutter_root(f)
generated_xcode_build_settings = parse_KV_file(File.join(f, File.join('.ios', 'Flutter', 'Generated.xcconfig'))) generated_xcode_build_settings = parse_KV_file(File.join(f, File.join('.ios', 'Flutter', 'Generated.xcconfig')))
if generated_xcode_build_settings.empty? 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 exit
end end
generated_xcode_build_settings.map { |p| generated_xcode_build_settings.map { |p|
......
platform :ios, '8.0' 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 target 'Runner' do
flutter_application_path = '../' flutter_application_path = '../'
eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding) eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0910" LastUpgradeVersion = "1020"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"> shouldUseLaunchSchemeArgsEnv = "YES">
<Testables> <Testables>
</Testables> </Testables>
...@@ -46,7 +45,6 @@ ...@@ -46,7 +45,6 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0" launchStyle = "0"
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
......
...@@ -4,4 +4,7 @@ ...@@ -4,4 +4,7 @@
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "group:Runner.xcodeproj">
</FileRef> </FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace> </Workspace>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
......
...@@ -23,17 +23,9 @@ class _MyAppState extends State<MyApp> { ...@@ -23,17 +23,9 @@ class _MyAppState extends State<MyApp> {
_init(); _init();
FlutterBoost.singleton.registerPageBuilders({ 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), 'comment_suggest': (pageName, params, _) => CommentSuggest(params),
// ///可以在native层通过 getContainerParams 来传递参数 'message_home': (pageName, params, _) => MessageHomePage(),
// 'flutterPage': (pageName, params, _) {
// print("flutterPage params:$params");
// return FlutterRouteWidget();
// },
}); });
FlutterBoost.handleOnStartPage(); FlutterBoost.handleOnStartPage();
} }
......
import 'dart:convert';
import 'package:flutter/material.dart'; 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 'package:gmalpha_flutter/pages/message/home/message_notification_item.dart';
import 'message_item.dart'; import 'message_item.dart';
import 'package:gmalpha_flutter/model/message/message.dart'; import 'package:gmalpha_flutter/model/message/message.dart';
import 'package:gmalpha_flutter/netWork/DioUtil.dart'; import 'package:gmalpha_flutter/netWork/DioUtil.dart';
import 'package:gmalpha_flutter/toast/toast.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter/semantics.dart';
class MessageHomePage extends StatefulWidget { class MessageHomePage extends StatefulWidget {
@override @override
_MessageHomePageState createState() => _MessageHomePageState(); _MessageHomePageState createState() => _MessageHomePageState();
} }
class _MessageHomePageState extends State<MessageHomePage> with AutomaticKeepAliveClientMixin { class _MessageHomePageState extends State<MessageHomePage> {
List<ListItem> messageList = List<ListItem>(); List<ListItem> messageList = List<ListItem>();
List<ListItem> dataArr = List<ListItem>(); List<ListItem> dataArr = List<ListItem>();
int pageIndex = 1;
@override RefreshController _refreshController =
bool get wantKeepAlive => true; 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 { Future<List<ListItem>> _fetchMesssageList() async {
List<Message> messageList = List<Message>(); 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}); BaseResp<List> baseresp = await DioUtil().request<List>(Method.get, "api/v1/reply/my", queryParameters: {'page': 1, 'count': 10});
if (baseresp.code != 0) { if (baseresp.code != 0) {
return new Future.error(baseresp.msg); return new Future.error(baseresp.msg);
...@@ -36,11 +53,11 @@ class _MessageHomePageState extends State<MessageHomePage> with AutomaticKeepAli ...@@ -36,11 +53,11 @@ class _MessageHomePageState extends State<MessageHomePage> with AutomaticKeepAli
return Message.fromJson(value); return Message.fromJson(value);
}).toList(); }).toList();
} }
_refreshController.refreshCompleted();
return messageList; return messageList;
} }
Future<List<ListItem>> _fetchNewestInfo() async { Future<List<ListItem>> _fetchNewestInfo() async {
print('---------start----------');
List<ListItem> notiData = List<ListItem>(); List<ListItem> notiData = List<ListItem>();
BaseRespR noteResp = await DioUtil().requestR(Method.get, 'api/v1/push/newest/info'); BaseRespR noteResp = await DioUtil().requestR(Method.get, 'api/v1/push/newest/info');
Map noteData = noteResp.data; Map noteData = noteResp.data;
...@@ -71,51 +88,64 @@ class _MessageHomePageState extends State<MessageHomePage> with AutomaticKeepAli ...@@ -71,51 +88,64 @@ class _MessageHomePageState extends State<MessageHomePage> with AutomaticKeepAli
} }
Future<List<ListItem>> _fetchListData() async { Future<List<ListItem>> _fetchListData() async {
print('---------start---------');
List<ListItem> dataArr = List<ListItem>(); List<ListItem> dataArr = List<ListItem>();
dataArr = await _fetchNewestInfo(); dataArr = await _fetchNewestInfo();
print(dataArr);
List<ListItem> messageData = await _fetchMesssageList(); List<ListItem> messageData = await _fetchMesssageList();
messageData.forEach((item) { messageData.forEach((item) {
dataArr.add(item); dataArr.add(item);
}); });
print(dataArr);
print('---------end---------');
return dataArr; return dataArr;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Scaffold( return new Scaffold(
appBar: new AppBar( // appBar: new AppBar(
title: new Text('消息'), // title: new Text('消息'),
), // ),
floatingActionButton: new FloatingActionButton( // floatingActionButton: new FloatingActionButton(
onPressed: () { // onPressed: () {
_fetchListData(); // _fetchListData();
}, // },
child: new Icon(Icons.add_box), // child: new Icon(Icons.add_box),
elevation: 3.0, // elevation: 3.0,
highlightElevation: 2.0, // highlightElevation: 2.0,
backgroundColor: Colors.red, // 红色 // backgroundColor: Colors.red, // 红色
), // ),
body: new Container(
body: new Center( child: SmartRefresher(
child: FutureBuilder( // enablePullDown: false,
future: _fetchListData(), enablePullUp: true,
builder: (context, snapshot) { // header: WaterDropHeader(),
switch (snapshot.connectionState) { controller: _refreshController,
case ConnectionState.none: // onRefresh: _onRefresh,
case ConnectionState.waiting: onLoading: _onLoading,
break;
default: // footer: ClassicFooter(),
if (snapshot.hasData) { child: FutureBuilder(
return _createListView(context, snapshot); 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 ...@@ -126,14 +156,15 @@ class _MessageHomePageState extends State<MessageHomePage> with AutomaticKeepAli
shrinkWrap: true, shrinkWrap: true,
key: new PageStorageKey('message-list'), key: new PageStorageKey('message-list'),
itemCount: dataArr.length, itemCount: dataArr.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (context,index) {
ListItem item = dataArr[index]; ListItem item = dataArr[index];
if (item is Message) { if (item is Message) {
return new MessageItem(onPressed: (){}, message:item); return new MessageItem(onPressed: (){}, message:item);
} else if (item is NotificationItem){ } else if (item is NotificationItem){
return new MessageNotificationItem(onPressed: (){}, notification: item); return new MessageNotificationItem(onPressed: (){}, notification: item);
} else {
return Text('类型错误');
} }
}, },
); );
} }
......
...@@ -50,7 +50,7 @@ class MessageNotificationItem extends StatelessWidget { ...@@ -50,7 +50,7 @@ class MessageNotificationItem extends StatelessWidget {
), ),
); );
} else { } else {
content = new Container(height:0.0,width:0.0) content = new Container(height:0.0,width:0.0);
} }
return content; return content;
} }
......
# Generated by pub # Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile # See https://dart.dev/tools/pub/glossary#lockfile
packages: packages:
analyzer: analyzer:
dependency: transitive dependency: transitive
...@@ -21,7 +21,7 @@ packages: ...@@ -21,7 +21,7 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.2.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
...@@ -176,13 +176,6 @@ packages: ...@@ -176,13 +176,6 @@ packages:
url: "https://github.com/alibaba/flutter_boost.git" url: "https://github.com/alibaba/flutter_boost.git"
source: git source: git
version: "0.0.411" 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: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
...@@ -336,7 +329,7 @@ packages: ...@@ -336,7 +329,7 @@ packages:
name: pedantic name: pedantic
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.5.0" version: "1.7.0"
pool: pool:
dependency: transitive dependency: transitive
description: description:
...@@ -358,13 +351,20 @@ packages: ...@@ -358,13 +351,20 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.1.4" 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: quiver:
dependency: transitive dependency: transitive
description: description:
name: quiver name: quiver
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.2" version: "2.0.3"
rxdart: rxdart:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -446,7 +446,7 @@ packages: ...@@ -446,7 +446,7 @@ packages:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.2.4" version: "0.2.5"
timing: timing:
dependency: transitive dependency: transitive
description: description:
......
...@@ -31,7 +31,8 @@ dependencies: ...@@ -31,7 +31,8 @@ dependencies:
rxdart: ^0.22.0 #链式编程 rxdart: ^0.22.0 #链式编程
json_serializable: ^3.0.0 #json to model json_serializable: ^3.0.0 #json to model
build_runner: ^1.6.1 build_runner: ^1.6.1
flutter_easyrefresh: ^1.2.7 # 上拉下拉刷新组件 pull_to_refresh: ^1.5.0
# flutter_easyrefresh: ^1.2.7 # 上拉下拉刷新组件
dev_dependencies: 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