Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gmalpha_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile
gmalpha_flutter
Commits
321694ab
Commit
321694ab
authored
5 years ago
by
jinzhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
6d4fbd9f
xuweiyu_dev
dev
dx/dev
dx/message
feature/alpha-2.4
hbr/findPage
jz/message
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
113 additions
and
84 deletions
+113
-84
Flutter.java
...roid/Flutter/src/main/java/io/flutter/facade/Flutter.java
+4
-4
FlutterFragment.java
...tter/src/main/java/io/flutter/facade/FlutterFragment.java
+2
-2
build.gradle
.android/app/build.gradle
+1
-1
gradle.properties
.android/gradle.properties
+1
-0
settings.gradle
.android/settings.gradle
+1
-1
AppFrameworkInfo.plist
.ios/Flutter/AppFrameworkInfo.plist
+1
-1
Generated.xcconfig
.ios/Flutter/Generated.xcconfig
+1
-1
podhelper.rb
.ios/Flutter/podhelper.rb
+1
-1
Podfile
.ios/Podfile
+4
-1
project.pbxproj
.ios/Runner.xcodeproj/project.pbxproj
+0
-0
Runner.xcscheme
.ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+1
-3
contents.xcworkspacedata
.ios/Runner.xcworkspace/contents.xcworkspacedata
+3
-0
Info.plist
.ios/Runner/Info.plist
+1
-1
main.dart
lib/main.dart
+1
-9
message_home.dart
lib/pages/message/home/message_home.dart
+76
-45
message_notification_item.dart
lib/pages/message/home/message_notification_item.dart
+1
-1
pubspec.lock
pubspec.lock
+12
-12
pubspec.yaml
pubspec.yaml
+2
-1
No files found.
.android/Flutter/src/main/java/io/flutter/facade/Flutter.java
View file @
321694ab
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.
...
...
This diff is collapsed.
Click to expand it.
.android/Flutter/src/main/java/io/flutter/facade/FlutterFragment.java
View file @
321694ab
...
...
@@ -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
;
/**
...
...
This diff is collapsed.
Click to expand it.
.android/app/build.gradle
View file @
321694ab
...
...
@@ -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'
}
This diff is collapsed.
Click to expand it.
.android/gradle.properties
View file @
321694ab
org.gradle.jvmargs
=
-Xmx1536M
This diff is collapsed.
Click to expand it.
.android/settings.gradle
View file @
321694ab
...
...
@@ -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'
))
This diff is collapsed.
Click to expand it.
.ios/Flutter/AppFrameworkInfo.plist
View file @
321694ab
...
...
@@ -3,7 +3,7 @@
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
en
<
/string
>
<
string
>
$
(
DEVELOPMENT_LANGUAGE
)
<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
App
<
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
...
...
This diff is collapsed.
Click to expand it.
.ios/Flutter/Generated.xcconfig
View file @
321694ab
// 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
...
...
This diff is collapsed.
Click to expand it.
.ios/Flutter/podhelper.rb
View file @
321694ab
...
...
@@ -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 p
ackages
get` is executed in
#{
f
}
."
puts
"Generated.xcconfig must exist. Make sure `flutter p
ub
get` is executed in
#{
f
}
."
exit
end
generated_xcode_build_settings
.
map
{
|
p
|
...
...
This diff is collapsed.
Click to expand it.
.ios/Podfile
View file @
321694ab
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.
Click to expand it.
.ios/Runner.xcodeproj/project.pbxproj
View file @
321694ab
This diff is collapsed.
Click to expand it.
.ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
View file @
321694ab
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"
091
0"
LastUpgradeVersion =
"
102
0"
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"
...
...
This diff is collapsed.
Click to expand it.
.ios/Runner.xcworkspace/contents.xcworkspacedata
View file @
321694ab
...
...
@@ -4,4 +4,7 @@
<FileRef
location =
"group:Runner.xcodeproj"
>
</FileRef>
<FileRef
location =
"group:Pods/Pods.xcodeproj"
>
</FileRef>
</Workspace>
This diff is collapsed.
Click to expand it.
.ios/Runner/Info.plist
View file @
321694ab
...
...
@@ -3,7 +3,7 @@
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
en
<
/string
>
<
string
>
$
(
DEVELOPMENT_LANGUAGE
)
<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
$
(
EXECUTABLE_NAME
)<
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
...
...
This diff is collapsed.
Click to expand it.
lib/main.dart
View file @
321694ab
...
...
@@ -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
();
}
...
...
This diff is collapsed.
Click to expand it.
lib/pages/message/home/message_home.dart
View file @
321694ab
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
(
'类型错误'
);
}
},
);
}
...
...
This diff is collapsed.
Click to expand it.
lib/pages/message/home/message_notification_item.dart
View file @
321694ab
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
pubspec.lock
View file @
321694ab
# 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:
...
...
This diff is collapsed.
Click to expand it.
pubspec.yaml
View file @
321694ab
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment