-
Notifications
You must be signed in to change notification settings - Fork 19
/
app.dart
46 lines (41 loc) · 1.14 KB
/
app.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import 'package:flutter/material.dart';
import 'package:flutter_app_lock/flutter_app_lock.dart';
import '../screens/lock_screen.dart';
import '../screens/my_home_page.dart';
class MyApp extends StatelessWidget {
final bool enabled;
@visibleForTesting
final Duration backgroundLockLatency;
const MyApp({
super.key,
this.enabled = false,
required this.backgroundLockLatency,
});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
builder: (context, child) => AppLock(
builder: (context, arg) => child!,
lockScreenBuilder: (context) => const LockScreen(
key: Key('LockScreen'),
),
enabled: enabled,
backgroundLockLatency: backgroundLockLatency,
inactiveBuilder: (context) => const Scaffold(
key: Key('InactiveScreen'),
body: Center(
child: FlutterLogo(size: 80),
),
),
),
home: const MyHomePage(
key: Key('MyHomePage'),
title: 'Flutter Demo Home Page',
),
);
}
}