mirror of
https://github.com/Iconica-Development/flutter_registration.git
synced 2025-05-19 13:23:45 +02:00
55 lines
1.3 KiB
Dart
55 lines
1.3 KiB
Dart
// SPDX-FileCopyrightText: 2022 Iconica
|
|
//
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_registration/flutter_registration.dart';
|
|
import 'example_registration_repository.dart';
|
|
|
|
void main() {
|
|
runApp(
|
|
const MaterialApp(
|
|
home: FlutterRegistrationDemo(),
|
|
),
|
|
);
|
|
}
|
|
|
|
class FlutterRegistrationDemo extends StatelessWidget {
|
|
const FlutterRegistrationDemo({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return RegistrationScreen(
|
|
registrationOptions: RegistrationOptions(
|
|
registrationRepository: ExampleRegistrationRepository(),
|
|
registrationSteps: RegistrationOptions.getDefaultSteps(),
|
|
afterRegistration: () {
|
|
Navigator.of(context).pushReplacement(
|
|
MaterialPageRoute(
|
|
builder: (context) {
|
|
return const ProtectedScreen();
|
|
},
|
|
),
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class ProtectedScreen extends StatelessWidget {
|
|
const ProtectedScreen({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Demo'),
|
|
),
|
|
body: const Center(
|
|
child: Text('Registration succesful'),
|
|
),
|
|
);
|
|
}
|
|
}
|