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)
......
This diff is collapsed.
<?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,51 +88,64 @@ 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(
child: FutureBuilder(
future: _fetchListData(),
builder: (context, snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.none:
case ConnectionState.waiting:
break;
default:
if (snapshot.hasData) {
return _createListView(context, snapshot);
// 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