-
Notifications
You must be signed in to change notification settings - Fork 0
/
onboarding_finished_screen.dart
75 lines (66 loc) · 1.83 KB
/
onboarding_finished_screen.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import 'dart:developer' as developer;
import 'package:flutter/material.dart';
import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook;
import '../../strings_context.dart';
import '../app_theme.dart';
import '../onboarding.dart';
import '../widgets/result_view.dart';
/// [Onboarding] screen to display some information when finished.
///
/// See also:
/// - [MainScreen]
class OnboardingFinishedScreen extends StatelessWidget {
final ValueSetter<BuildContext>? onStartRequested;
const OnboardingFinishedScreen({
super.key,
required this.onStartRequested,
});
@override
Widget build(BuildContext context) {
final strings = context.strings;
final child = Column(
children: [
Expanded(
child: ResultView.success(
titleText: strings.onboardingFinishedHeading,
body: Text(strings.onboardingFinishedBody),
),
),
// Primary button
FilledButton(
style: FilledButton.styleFrom(
minimumSize: kPrimaryButtonMinimumSize,
),
onPressed: onStartRequested != null
? () {
onStartRequested?.call(context);
}
: null,
child: Text(context.strings.buttonOpenDocumentLabel),
),
],
);
final body = Padding(
padding: kScreenMargin,
child: child,
);
return Scaffold(
appBar: null,
body: SafeArea(
child: body,
),
);
}
}
@widgetbook.UseCase(
path: '[Screens]',
name: '',
type: OnboardingFinishedScreen,
)
Widget previewOnboardingFinishedScreen(BuildContext context) {
return OnboardingFinishedScreen(
onStartRequested: (_) {
developer.log("onStartRequested");
},
);
}