Skip to content

Commit 1491790

Browse files
author
wangyongqi
committed
Remove baseflow_plugin_template from permission_handler_android example,
replace with minimal MaterialApp to fix CI build failure
1 parent 6a3c55c commit 1491790

2 files changed

Lines changed: 37 additions & 48 deletions

File tree

permission_handler_android/example/lib/main.dart

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
1-
import 'package:baseflow_plugin_template/baseflow_plugin_template.dart';
21
import 'package:flutter/material.dart';
32
import 'package:permission_handler_platform_interface/permission_handler_platform_interface.dart';
43

54
void main() {
6-
runApp(
7-
BaseflowPluginExample(
8-
pluginName: 'Permission Handler',
9-
githubURL: 'https://github.com/Baseflow/flutter-permission-handler',
10-
pubDevURL: 'https://pub.dev/packages/permission_handler',
11-
pages: [PermissionHandlerWidget.createPage()],
12-
),
13-
);
5+
runApp(const PermissionHandlerExampleApp());
146
}
157

16-
///Defines the main theme color
17-
final MaterialColor themeMaterialColor =
18-
BaseflowPluginExample.createMaterialColor(
19-
const Color.fromRGBO(48, 49, 60, 1),
8+
/// A Flutter application demonstrating the functionality of this plugin
9+
class PermissionHandlerExampleApp extends StatelessWidget {
10+
const PermissionHandlerExampleApp({super.key});
11+
12+
@override
13+
Widget build(BuildContext context) {
14+
return MaterialApp(
15+
title: 'Permission Handler Example',
16+
theme: ThemeData(
17+
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
18+
useMaterial3: true,
19+
),
20+
home: const PermissionHandlerWidget(),
2021
);
22+
}
23+
}
2124

2225
/// A Flutter application demonstrating the functionality of this plugin
2326
class PermissionHandlerWidget extends StatefulWidget {
24-
/// Creates a [PermissionHandlerWidget].
2527
const PermissionHandlerWidget({super.key});
2628

27-
/// Create a page containing the functionality of this plugin
28-
static ExamplePage createPage() {
29-
return ExamplePage(
30-
Icons.location_on,
31-
(context) => const PermissionHandlerWidget(),
32-
);
33-
}
34-
3529
@override
3630
State<PermissionHandlerWidget> createState() =>
3731
_PermissionHandlerWidgetState();
@@ -40,31 +34,33 @@ class PermissionHandlerWidget extends StatefulWidget {
4034
class _PermissionHandlerWidgetState extends State<PermissionHandlerWidget> {
4135
@override
4236
Widget build(BuildContext context) {
43-
return Center(
44-
child: ListView(
45-
children:
46-
Permission.values
47-
.where((permission) {
48-
return permission != Permission.unknown &&
49-
permission != Permission.mediaLibrary &&
50-
permission != Permission.photosAddOnly &&
51-
permission != Permission.reminders &&
52-
permission != Permission.bluetooth &&
53-
permission != Permission.appTrackingTransparency &&
54-
permission != Permission.criticalAlerts &&
55-
permission != Permission.assistant &&
56-
permission != Permission.backgroundRefresh;
57-
})
58-
.map((permission) => PermissionWidget(permission))
59-
.toList(),
37+
return Scaffold(
38+
appBar: AppBar(title: const Text('Permission Handler')),
39+
body: Center(
40+
child: ListView(
41+
children:
42+
Permission.values
43+
.where((permission) {
44+
return permission != Permission.unknown &&
45+
permission != Permission.mediaLibrary &&
46+
permission != Permission.photosAddOnly &&
47+
permission != Permission.reminders &&
48+
permission != Permission.bluetooth &&
49+
permission != Permission.appTrackingTransparency &&
50+
permission != Permission.criticalAlerts &&
51+
permission != Permission.assistant &&
52+
permission != Permission.backgroundRefresh;
53+
})
54+
.map((permission) => PermissionWidget(permission))
55+
.toList(),
56+
),
6057
),
6158
);
6259
}
6360
}
6461

6562
/// Permission widget containing information about the passed [Permission]
6663
class PermissionWidget extends StatefulWidget {
67-
/// Constructs a [PermissionWidget] for the supplied [Permission]
6864
const PermissionWidget(this._permission, {super.key});
6965

7066
final Permission _permission;
@@ -121,7 +117,7 @@ class _PermissionState extends State<PermissionWidget> {
121117
trailing:
122118
(widget._permission is PermissionWithService)
123119
? IconButton(
124-
icon: const Icon(Icons.info, color: Colors.white),
120+
icon: const Icon(Icons.info),
125121
onPressed: () {
126122
checkServiceStatus(
127123
context,

permission_handler_android/example/pubspec.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ environment:
55
sdk: ^3.7.0
66

77
dependencies:
8-
baseflow_plugin_template: ^2.1.2
98
flutter:
109
sdk: flutter
1110
permission_handler_platform_interface: ^4.2.0
@@ -22,11 +21,5 @@ dev_dependencies:
2221
# the parent directory to use the current plugin's version.
2322
path: ../
2423

25-
url_launcher: ^6.0.12
26-
2724
flutter:
2825
uses-material-design: true
29-
30-
assets:
31-
- res/images/baseflow_logo_def_light-02.png
32-
- res/images/poweredByBaseflowLogoLight@3x.png

0 commit comments

Comments
 (0)