Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
amitkhairnar44 committed Oct 5, 2022
1 parent caf5502 commit b252d7f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
34 changes: 17 additions & 17 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:root_access/root_access.dart';

void main() => runApp(new MyApp());
void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
bool _rootAccess = false;

@override
void initState() {
super.initState();
initRootRequest();
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Text('Root access granted: $_rootAccess\n'),
),
),
);
}

Future<void> initRootRequest() async {
Expand All @@ -33,16 +41,8 @@ class _MyAppState extends State<MyApp> {
}

@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Text('Root access granted: $_rootAccess\n'),
),
),
);
void initState() {
super.initState();
initRootRequest();
}
}
4 changes: 0 additions & 4 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,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

dev_dependencies:
flutter_test:
sdk: flutter
Expand Down

0 comments on commit b252d7f

Please sign in to comment.