first commit

This commit is contained in:
git
2025-01-29 21:14:24 +01:00
commit d676ba34f4
143 changed files with 5468 additions and 0 deletions

View 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',
),
),
],
),
),
),
),
);
}
}