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
f9fd6134
Commit
f9fd6134
authored
6 years ago
by
ouxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add assets channel
parent
0d913eab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
assetsChannel.dart
lib/assetsChannel.dart
+3
-3
main.dart
lib/main.dart
+12
-1
No files found.
lib/assetsChannel.dart
View file @
f9fd6134
...
...
@@ -3,12 +3,12 @@ import 'dart:async';
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
class
PlatformChannel
extends
StatefulWidget
{
class
Assest
PlatformChannel
extends
StatefulWidget
{
@override
_
PlatformChannelState
createState
()
=>
_
PlatformChannelState
();
_
AssestPlatformChannelState
createState
()
=>
_Assest
PlatformChannelState
();
}
class
_
PlatformChannelState
extends
State
<
PlatformChannel
>
{
class
_
AssestPlatformChannelState
extends
State
<
Assest
PlatformChannel
>
{
static
const
MethodChannel
methodChannel
=
MethodChannel
(
'GMAssetsMethodChannelName'
);
static
const
EventChannel
eventChannel
=
...
...
This diff is collapsed.
Click to expand it.
lib/main.dart
View file @
f9fd6134
import
'package:flutter/material.dart'
;
import
'battery.dart'
;
import
'assetsChannel.dart'
;
void
main
(
)
=>
runApp
(
MyApp
());
...
...
@@ -14,6 +15,7 @@ class MyApp extends StatelessWidget {
home:
MyHomePage
(
title:
'Flutter Demo Home Page'
),
routes:
{
"/channeltest"
:
batteryChannelPage
,
"/assetschannel"
:
assetsChannelPage
,
},
);
}
...
...
@@ -21,6 +23,10 @@ class MyApp extends StatelessWidget {
Widget
batteryChannelPage
(
BuildContext
context
)
{
return
PlatformChannel
();
}
Widget
assetsChannelPage
(
BuildContext
context
)
{
return
AssestPlatformChannel
();
}
}
class
MyHomePage
extends
StatefulWidget
{
...
...
@@ -62,7 +68,12 @@ class _MyHomePageState extends State<MyHomePage> {
child:
Text
(
'channel test'
),
color:
Colors
.
green
,
onPressed:
(){
Navigator
.
pushNamed
(
context
,
"/channeltest"
);},
)
),
FlatButton
(
child:
Text
(
'channel test'
),
color:
Colors
.
green
,
onPressed:
(){
Navigator
.
pushNamed
(
context
,
"/assetschannel"
);},
),
],
),
),
...
...
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