Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
permission_handler
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songyanzhi
permission_handler
Commits
e6c34346
Commit
e6c34346
authored
Jul 02, 2020
by
danielroek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved DartDocs
parent
fa20af63
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
20 deletions
+20
-20
permission_handler/example/lib/main.dart
+5
-7
permission_handler/example/lib/plugin_example/permission_list.dart
+2
-1
permission_handler/example/lib/template/globals.dart
+12
-11
permission_handler/example/lib/template/info_page.dart
+1
-1
No files found.
permission_handler/example/lib/main.dart
View file @
e6c34346
...
@@ -3,14 +3,13 @@ import 'package:flutter/widgets.dart';
...
@@ -3,14 +3,13 @@ import 'package:flutter/widgets.dart';
import
'template/globals.dart'
;
import
'template/globals.dart'
;
/// main
void
main
(
)
{
void
main
(
)
{
runApp
(
BaseflowPluginExample
());
runApp
(
BaseflowPluginExample
());
}
}
/// Baseflow Plugin Example
/// Baseflow Plugin Example
application
class
BaseflowPluginExample
extends
StatelessWidget
{
class
BaseflowPluginExample
extends
StatelessWidget
{
///
Theme's MaterialColor
///
[MaterialColor] to be used in the app [ThemeData]
final
MaterialColor
themeMaterialColor
=
final
MaterialColor
themeMaterialColor
=
createMaterialColor
(
const
Color
.
fromRGBO
(
48
,
49
,
60
,
1
));
createMaterialColor
(
const
Color
.
fromRGBO
(
48
,
49
,
60
,
1
));
...
@@ -57,7 +56,7 @@ class BaseflowPluginExample extends StatelessWidget {
...
@@ -57,7 +56,7 @@ class BaseflowPluginExample extends StatelessWidget {
);
);
}
}
///
Method to create MaterialColor based on RGBO Color
///
Creates [MaterialColor] based on [Color]
static
MaterialColor
createMaterialColor
(
Color
color
)
{
static
MaterialColor
createMaterialColor
(
Color
color
)
{
List
strengths
=
<
double
>[.
05
];
List
strengths
=
<
double
>[.
05
];
Map
swatch
=
<
int
,
Color
>{};
Map
swatch
=
<
int
,
Color
>{};
...
@@ -79,9 +78,9 @@ class BaseflowPluginExample extends StatelessWidget {
...
@@ -79,9 +78,9 @@ class BaseflowPluginExample extends StatelessWidget {
}
}
}
}
/// A
pplication main page
/// A
Flutter example demonstrating how the [pluginName] plugin could be used
class
AppHome
extends
StatefulWidget
{
class
AppHome
extends
StatefulWidget
{
///
Application main page constructor
///
Constructs the [AppHome] class
AppHome
({
Key
key
,
this
.
title
})
:
super
(
key:
key
);
AppHome
({
Key
key
,
this
.
title
})
:
super
(
key:
key
);
/// Application title
/// Application title
...
@@ -91,7 +90,6 @@ class AppHome extends StatefulWidget {
...
@@ -91,7 +90,6 @@ class AppHome extends StatefulWidget {
_AppHomeState
createState
()
=>
_AppHomeState
();
_AppHomeState
createState
()
=>
_AppHomeState
();
}
}
/// Application main page
class
_AppHomeState
extends
State
<
AppHome
>
{
class
_AppHomeState
extends
State
<
AppHome
>
{
static
final
PageController
_pageController
=
PageController
(
initialPage:
0
);
static
final
PageController
_pageController
=
PageController
(
initialPage:
0
);
int
_currentPage
=
0
;
int
_currentPage
=
0
;
...
...
permission_handler/example/lib/plugin_example/permission_list.dart
View file @
e6c34346
...
@@ -5,7 +5,8 @@ import 'package:permission_handler/permission_handler.dart';
...
@@ -5,7 +5,8 @@ import 'package:permission_handler/permission_handler.dart';
import
'permission_widget.dart'
;
import
'permission_widget.dart'
;
/// List with PermissionWidgets
/// Constructs a [ListView] containing [PermissionWidget] for each available
/// permission.
class
PermissionList
extends
StatelessWidget
{
class
PermissionList
extends
StatelessWidget
{
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
...
permission_handler/example/lib/template/globals.dart
View file @
e6c34346
...
@@ -5,32 +5,33 @@ import '../plugin_example/permission_list.dart';
...
@@ -5,32 +5,33 @@ import '../plugin_example/permission_list.dart';
import
'info_page.dart'
;
import
'info_page.dart'
;
///
Constant plugin name
///
The name of the plugin, which will be displayed throughout the example App.
const
String
pluginName
=
'
Geocoding
'
;
const
String
pluginName
=
'
Permission Handler
'
;
/// Constant GitHub URL to flutter package
/// Returns Github URL, which is shown in the [InfoPage].
const
String
githubURL
=
'https://github.com/Baseflow/flutter-geocoding'
;
const
String
githubURL
=
'https://github.com/Baseflow/flutter-permission-handler'
;
///
Constant Baseflow URL
///
Returns Baseflow URL, which is shown in the [InfoPage].
const
String
baseflowURL
=
'https://baseflow.com'
;
const
String
baseflowURL
=
'https://baseflow.com'
;
///
Constant pub.dev URL to flutter package
///
Returns pub.dev URL, which is shown in the [InfoPage].
const
String
pubDevURL
=
'https://pub.dev/packages/
geocoding
'
;
const
String
pubDevURL
=
'https://pub.dev/packages/
permission_handler
'
;
///
Constant application-wide horizontal padding
///
[EdgeInsets] to define horizontal padding throughout the application.
const
EdgeInsets
defaultHorizontalPadding
=
const
EdgeInsets
defaultHorizontalPadding
=
EdgeInsets
.
symmetric
(
horizontal:
24
);
EdgeInsets
.
symmetric
(
horizontal:
24
);
///
Constant application-wide vertical padding
///
[EdgeInsets] to define vertical padding throughout the application.
const
EdgeInsets
defaultVerticalPadding
=
EdgeInsets
.
symmetric
(
vertical:
24
);
const
EdgeInsets
defaultVerticalPadding
=
EdgeInsets
.
symmetric
(
vertical:
24
);
///
Constant list of AppBar Icons
///
Returns [List] with [IconData] to show in the [AppHome] [AppBar].
final
List
<
IconData
>
icons
=
[
final
List
<
IconData
>
icons
=
[
Icons
.
list
,
Icons
.
list
,
Icons
.
info_outline
,
Icons
.
info_outline
,
];
];
///
Constant list of application widgets
///
Returns [List] with [Widget]'s to construct pages in the [AppBar].
final
List
<
Widget
>
pages
=
[
final
List
<
Widget
>
pages
=
[
PermissionList
(),
PermissionList
(),
InfoPage
(),
InfoPage
(),
...
...
permission_handler/example/lib/template/info_page.dart
View file @
e6c34346
...
@@ -4,7 +4,7 @@ import 'package:url_launcher/url_launcher.dart';
...
@@ -4,7 +4,7 @@ import 'package:url_launcher/url_launcher.dart';
import
'globals.dart'
;
import
'globals.dart'
;
///
Page containing Baseflow information
///
[StatelessWidget] displaying information about Baseflow
class
InfoPage
extends
StatelessWidget
{
class
InfoPage
extends
StatelessWidget
{
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
...
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