79 lines
2.2 KiB
Dart
79 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:pcasttv/globals.dart';
|
|
|
|
class MainPage extends StatefulWidget {
|
|
const MainPage({super.key});
|
|
|
|
@override
|
|
State<MainPage> createState() => _MainPageState();
|
|
}
|
|
|
|
class _MainPageState extends State<MainPage> {
|
|
@override
|
|
void initState() {
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
showLoginDialog();
|
|
});
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return const Scaffold(
|
|
backgroundColor: Color.fromRGBO(166, 0, 249, 1),
|
|
body: Column(),
|
|
);
|
|
}
|
|
|
|
Future<dynamic> showLoginDialog() {
|
|
return showDialog(
|
|
context: navigatorKey.currentContext!,
|
|
barrierDismissible: false,
|
|
builder: (BuildContext context) {
|
|
return AlertDialog(
|
|
scrollable: true,
|
|
elevation: 20,
|
|
insetPadding: const EdgeInsets.all(20),
|
|
title: const Text('Login'),
|
|
content: SizedBox(
|
|
width: 500,
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Form(
|
|
child: Column(
|
|
children: <Widget>[
|
|
TextFormField(
|
|
decoration: const InputDecoration(
|
|
labelText: 'Email',
|
|
icon: Icon(Icons.email),
|
|
),
|
|
),
|
|
TextFormField(
|
|
decoration: const InputDecoration(
|
|
labelText: 'Senha',
|
|
icon: Icon(Icons.lock),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
actions: <Widget>[
|
|
ElevatedButton(
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
},
|
|
child: const Text('Cancelar'),
|
|
),
|
|
ElevatedButton(
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
},
|
|
child: const Text('Entrar'),
|
|
),
|
|
]);
|
|
});
|
|
}
|
|
}
|