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
2ded43cd
Commit
2ded43cd
authored
Feb 23, 2019
by
艾娇平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加上title
parent
3b157295
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
9 deletions
+17
-9
hybrid_stack_manager.dart
lib/hybrid_stack/hybrid_stack_manager.dart
+12
-3
router.dart
lib/hybrid_stack/router.dart
+2
-0
opinion.dart
lib/opinion.dart
+3
-4
pubspec.yaml
pubspec.yaml
+0
-2
No files found.
lib/hybrid_stack/hybrid_stack_manager.dart
View file @
2ded43cd
...
...
@@ -2,6 +2,7 @@ import 'dart:async';
import
'package:flutter/services.dart'
;
import
'../services/ALNetClient.dart'
;
import
'dart:convert'
;
import
'dart:typed_data'
;
typedef
Future
<
dynamic
>
MethodHandler
(
MethodCall
call
);
...
...
@@ -42,13 +43,21 @@ class HybridStackManagerPlugin {
// method 0: GET 1:POST
Future
<
Map
>
callNativeNetWorking
({
String
url
,
HttpMethod
method
,
Map
parameters
})
async
{
dynamic
info
=
_channel
.
invokeMethod
(
'openUrlFromNative
'
,
{
dynamic
info
=
await
_channel
.
invokeMethod
(
'callNativeNetWorking
'
,
{
"url"
:
url
??
""
,
"method"
:
1
??
0
,
"parameters"
:
(
parameters
??
{}),
});
print
(
'callNativeNetWorking-----
${info.toString()}
'
);
// Uint8List response = info;
// Map streetsList = new Map.from(info);
return
new
Future
.
sync
(()
=>
jsonDecode
(
info
.
toString
())
as
Map
);
return
new
Future
.
sync
(()
=>
info
as
Map
);
// print('callNativeNetWorking-----${streetsList}');
// return new Future.sync(() => streetsList as Map);
// print('callNativeNetWorking-----${info.toString()}');
//
// return new Future.sync(() => jsonDecode(info.toString()) as Map);
}
}
lib/hybrid_stack/router.dart
View file @
2ded43cd
...
...
@@ -14,6 +14,8 @@ class XMaterialPageRoute<T> extends MaterialPageRoute<T> {
final
WidgetBuilder
builder
;
final
bool
animated
;
final
GlobalKey
boundaryKey
;
Duration
get
transitionDuration
{
if
(
animated
==
true
)
return
const
Duration
(
milliseconds:
300
);
return
const
Duration
(
milliseconds:
0
);
...
...
lib/opinion.dart
View file @
2ded43cd
...
...
@@ -17,9 +17,8 @@ class Opinion extends StatelessWidget {
Opinion
(
RouterOption
option
,
{
Key
key
})
:
super
(
key:
key
)
{
routeOption
=
option
;
}
String
title
;
Widget
build
(
BuildContext
context
)
{
// Map m = Utils.parseUniquePageName(routeOption.userInfo);
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
title:
'意见与建议'
,
...
...
@@ -33,10 +32,10 @@ class Opinion extends StatelessWidget {
}
class
OpinionPage
extends
StatefulWidget
{
OpinionPage
({
Key
key
,
this
.
title
})
:
super
(
key:
key
);
OpinionPage
({
Key
key
,
this
.
title
,
this
.
userId
})
:
super
(
key:
key
);
final
String
title
;
final
String
userId
;
@override
_OpinionPageState
createState
()
=>
_OpinionPageState
();
}
...
...
pubspec.yaml
View file @
2ded43cd
...
...
@@ -20,8 +20,6 @@ dependencies:
flutter
:
sdk
:
flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons
:
^0.1.2
json_annotation
:
^2.0.0
# 网络
...
...
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