75 lines
2.6 KiB
Dart
75 lines
2.6 KiB
Dart
import 'package:educa_controle_acesso/screens/home_screen.dart';
|
|
import 'package:educa_controle_acesso/screens/log_screen.dart';
|
|
import 'package:educa_controle_acesso/screens/login_screen.dart';
|
|
import 'package:educa_controle_acesso/screens/responsible_register_screen.dart';
|
|
import 'package:educa_controle_acesso/widgets/text_custom.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_web_plugins/url_strategy.dart';
|
|
import 'package:universal_html/html.dart' as html;
|
|
import 'models/aluno_model.dart';
|
|
|
|
void main() {
|
|
usePathUrlStrategy();
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
String cidade = '';
|
|
String urlCompleta = '';
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
double height = MediaQuery.of(context).size.height;
|
|
double width = MediaQuery.of(context).size.width;
|
|
|
|
Uri? uri = Uri.parse(html.window.location.href);
|
|
cidade = uri.pathSegments.isNotEmpty ? uri.pathSegments.last : '';
|
|
|
|
print('cidade $cidade');
|
|
|
|
return MaterialApp(
|
|
debugShowCheckedModeBanner: false,
|
|
title: 'CONTROLE DE ACESSO',
|
|
theme: ThemeData(
|
|
scrollbarTheme: ScrollbarThemeData(
|
|
thickness: MaterialStateProperty.all<double>(15),
|
|
thumbVisibility: MaterialStateProperty.all<bool>(true),
|
|
thumbColor: MaterialStateProperty.all<Color>(Colors.black38),
|
|
)
|
|
),
|
|
onUnknownRoute: (RouteSettings settings) {
|
|
return MaterialPageRoute(
|
|
builder: (context) => Scaffold(
|
|
body: Center(
|
|
child: Container(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
child: Image.asset("assets/images/logoEduca.png",width:width * 0.15,height: height * 0.12)
|
|
),
|
|
TextCustom(text: 'Base não inserida ou não encontrada'),
|
|
],
|
|
),
|
|
)
|
|
)
|
|
),
|
|
);
|
|
},
|
|
initialRoute: '/',
|
|
routes: {
|
|
'/$cidade': (_)=> LoginScreen(cidade: cidade),
|
|
'/home':(context)=> HomeScreen(dados: ModalRoute.of(context)!.settings.arguments as List),
|
|
'/cadastro':(context)=>ResponsibleRegisterScreen(ModalRoute.of(context)!.settings.arguments as AlunoModel),
|
|
'/log':(context)=> LogScreen(dados:ModalRoute.of(context)!.settings.arguments as List)
|
|
},
|
|
);
|
|
}
|
|
}
|
|
|
|
//http://localhost:63123/cidade?cidade=iracemapolis
|
|
//https://homol-controle-educa.rkmsistemas.com.br/cidade?cidade=iracemapolis
|
|
//https://homol-controle-educa.rkmsistemas.com.br/
|