first commit
This commit is contained in:
87
lib/pages/login/login_view.dart
Normal file
87
lib/pages/login/login_view.dart
Normal file
@@ -0,0 +1,87 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '/controller/login/login_controller.dart';
|
||||
import '/utils/my_text_button.dart';
|
||||
|
||||
class LoginPage extends GetView<LoginController> {
|
||||
static const namedRoute = '/login-page';
|
||||
const LoginPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var logCtrl = controller;
|
||||
var screenWidth = MediaQuery.of(context).size.width;
|
||||
//var screenHeight = MediaQuery.of(context).size.height;
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 25.0),
|
||||
Container(
|
||||
width: screenWidth*0.4,
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
borderRadius: BorderRadius.all(Radius.circular(8.0)),
|
||||
),
|
||||
child: const Text(
|
||||
'Internorm',
|
||||
style: TextStyle(
|
||||
fontSize: 50.0,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Itis4You Inventory',
|
||||
style:
|
||||
TextStyle(fontSize: 30.0, fontStyle: FontStyle.italic)),
|
||||
const SizedBox(height: 50.0),
|
||||
SizedBox(
|
||||
width: screenWidth*0.5,
|
||||
child: TextField(
|
||||
textAlign: TextAlign.center,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
labelText: 'Nachname Vorname',
|
||||
|
||||
),
|
||||
keyboardType: TextInputType.text,
|
||||
controller: logCtrl.loginUserNameController,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.0),
|
||||
SizedBox(
|
||||
width: screenWidth*0.5,
|
||||
child: TextField(
|
||||
textAlign: TextAlign.center,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
labelText: 'Passwort 4 Stellen',
|
||||
|
||||
),
|
||||
keyboardType: TextInputType.text,
|
||||
obscureText: true,
|
||||
controller: logCtrl.loginUserPasswortController,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20.0),
|
||||
MyTextButton(
|
||||
onTap: () => logCtrl.logInUser(),
|
||||
screenWidth: screenWidth * 0.4,
|
||||
buttonText: 'ANMELDEN',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
90
lib/pages/main/main_view.dart
Normal file
90
lib/pages/main/main_view.dart
Normal file
@@ -0,0 +1,90 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_itis4you_with_jde_user_login_app/utils/my_text_button.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:mobile_scanner/mobile_scanner.dart';
|
||||
import '../../controller/main/main_controller.dart';
|
||||
|
||||
class MainPage extends GetView<MainController> {
|
||||
static const namedRoute = '/main-page';
|
||||
const MainPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var mainCtrl = controller;
|
||||
double screenWidth = MediaQuery.of(context).size.width;
|
||||
double screenHeight = MediaQuery.of(context).size.height;
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: const Text(
|
||||
'Inventarcode Scannen',
|
||||
style: TextStyle(color: Colors.white, fontSize: 25.0),
|
||||
),
|
||||
toolbarHeight: 120.0,
|
||||
backgroundColor: Colors.grey.shade700,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () => mainCtrl.goToLoginPage(),
|
||||
),
|
||||
//centerTitle: true,
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: screenWidth * 0.7,
|
||||
height: screenHeight * 0.35,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: MobileScanner(
|
||||
controller: mainCtrl.scannerController,
|
||||
onDetect: (barcode) {
|
||||
var bar = barcode.barcodes.first;
|
||||
var args = barcode.image;
|
||||
mainCtrl.onDetect(bar, args);
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(height: 50.0),
|
||||
Obx(() => Center(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: screenWidth*0.6,
|
||||
height: 80.0,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Colors.grey.shade600,
|
||||
width: 5.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
),
|
||||
child: Text(
|
||||
mainCtrl.qrText.value,
|
||||
style: TextStyle(
|
||||
fontSize: 35.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
SizedBox(height: 50.0),
|
||||
SizedBox(
|
||||
width: screenWidth * 0.4,
|
||||
child: MyTextButton(
|
||||
onTap: () => mainCtrl.startScanning(),
|
||||
screenWidth: screenWidth * 0.4,
|
||||
buttonText: 'Start Scannen',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user