flutter_form_wizard/example/lib/template_page.dart

71 lines
1.7 KiB
Dart
Raw Normal View History

2022-11-01 08:23:35 +01:00
// SPDX-FileCopyrightText: 2022 Iconica
//
// SPDX-License-Identifier: BSD-3-Clause
import 'package:flutter/material.dart';
class TemplatePage extends StatelessWidget {
const TemplatePage({
super.key,
required this.size,
required this.fontSize,
required this.title,
required this.pageNumber,
required this.amountOfPages,
2022-09-29 09:55:33 +02:00
required this.flutterFormWidgets,
});
final Size size;
final double fontSize;
final String title;
final int pageNumber;
final int amountOfPages;
2022-09-29 09:55:33 +02:00
final List<Widget> flutterFormWidgets;
@override
Widget build(BuildContext context) {
2022-09-20 16:14:09 +02:00
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: size.width / 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: size.height / 10,
),
Text(
"$pageNumber / $amountOfPages",
style: TextStyle(
fontSize: fontSize,
),
2022-09-20 16:14:09 +02:00
),
SizedBox(
height: size.height / 80,
),
Text(
title,
style: TextStyle(
fontSize: fontSize,
fontWeight: FontWeight.w900,
),
2022-09-20 16:14:09 +02:00
),
],
),
),
2022-09-20 16:14:09 +02:00
),
const Spacer(),
2022-09-29 09:55:33 +02:00
for (var widget in flutterFormWidgets) ...[
2022-09-20 16:14:09 +02:00
widget,
],
2022-09-20 16:14:09 +02:00
const Spacer(
flex: 2,
),
],
);
}
}