first commit
This commit is contained in:
63
lib/utils/constants.dart
Normal file
63
lib/utils/constants.dart
Normal file
@@ -0,0 +1,63 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
const kLoginURL = 'http://ifnweb12.ifndom.net:8789/jderest/v2/tokenrequest';
|
||||
const kGetAllUsersURL =
|
||||
'https://api.internorm.com:4481/gateway/ITIS4U_Inventory_Management/1.0/ITIS4U_Inventory/users';
|
||||
const kGetAssetsByUserIdBaseURL =
|
||||
'https://api.internorm.com:4481/gateway/ITIS4U_Inventory_Management/1.0/ITIS4U_Inventory/assetsByUser';
|
||||
const kGetAssetByInventoryIdBaseURL =
|
||||
'https://api.internorm.com:4481/gateway/ITIS4U_Inventory_Management/1.0/ITIS4U_Inventory/asset';
|
||||
|
||||
var szApiUsername = 'Service';
|
||||
var szApiPassword = 'manage';
|
||||
var kLoginToken = '';
|
||||
var kLoginUser = '';
|
||||
var kLoginPassword = '';
|
||||
|
||||
//HttpHeader Authentification Login
|
||||
var kBasicAuthLogin =
|
||||
'Basic ${base64.encode(utf8.encode('$kLoginUser:$kLoginPassword'))}';
|
||||
var kHttpHeaderBasic = {HttpHeaders.authorizationHeader: kBasicAuthLogin};
|
||||
|
||||
var kBasicAuthApiRest = 'Basic ${base64.encode(utf8.encode('$szApiUsername:$szApiPassword'))}';
|
||||
var kHttpHeaderBasicApiRest = {HttpHeaders.authorizationHeader: kBasicAuthLogin};
|
||||
|
||||
var kFontSizeDouble = 15.0;
|
||||
|
||||
var kTextSyleLittleGrey =
|
||||
TextStyle(fontSize: 12.0, color: Colors.grey.shade500);
|
||||
|
||||
//DropDown Styles
|
||||
var kInputDecorationDropDownMenue = InputDecoration(
|
||||
//prefixIcon: Icon(Icons.date_range),
|
||||
hintText: 'User'.toUpperCase(),
|
||||
contentPadding: const EdgeInsets.all(10),
|
||||
hintStyle: TextStyle(letterSpacing: 2, fontSize: kFontSizeDouble),
|
||||
filled: true,
|
||||
fillColor: Colors.grey.shade400,
|
||||
errorStyle: const TextStyle(color: Colors.yellow),
|
||||
);
|
||||
|
||||
|
||||
SnackbarController kDisplaySnackBarRed(String szInfoText) {
|
||||
return Get.snackbar('Info', szInfoText,
|
||||
backgroundColor: Colors.red[600],
|
||||
snackPosition: SnackPosition.TOP,
|
||||
colorText: Colors.white,
|
||||
snackStyle: SnackStyle.GROUNDED);
|
||||
}
|
||||
|
||||
SnackbarController kDisplaySnackBarGreen(String szInfoText) {
|
||||
return Get.snackbar('Info', szInfoText,
|
||||
backgroundColor: Colors.green[600],
|
||||
snackPosition: SnackPosition.TOP,
|
||||
colorText: Colors.black,
|
||||
snackStyle: SnackStyle.GROUNDED);
|
||||
}
|
||||
|
||||
|
||||
String? kHandyModel;
|
||||
10
lib/utils/http_overrides.dart
Normal file
10
lib/utils/http_overrides.dart
Normal file
@@ -0,0 +1,10 @@
|
||||
import 'dart:io';
|
||||
|
||||
class MyHttpOverrides extends HttpOverrides {
|
||||
@override
|
||||
HttpClient createHttpClient(SecurityContext? context) {
|
||||
return super.createHttpClient(context)
|
||||
..badCertificateCallback =
|
||||
(X509Certificate cert, String host, int port) => true;
|
||||
}
|
||||
}
|
||||
40
lib/utils/my_text_button.dart
Normal file
40
lib/utils/my_text_button.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MyTextButton extends StatelessWidget {
|
||||
const MyTextButton({
|
||||
super.key,
|
||||
required this.onTap,
|
||||
required this.screenWidth,
|
||||
required this.buttonText,
|
||||
});
|
||||
|
||||
final void Function()? onTap;
|
||||
final double screenWidth;
|
||||
final String buttonText;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: screenWidth,
|
||||
height: 80.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue.shade700,
|
||||
borderRadius: BorderRadius.circular(5.0)
|
||||
),
|
||||
child: Text(
|
||||
buttonText,
|
||||
style: const TextStyle(
|
||||
fontSize: 30.0,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
letterSpacing: 2.0,
|
||||
wordSpacing: 8.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
11
lib/utils/sample_bindings.dart
Normal file
11
lib/utils/sample_bindings.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
import 'package:get/get.dart';
|
||||
import '../controller/login/login_controller.dart';
|
||||
import '../controller/main/main_controller.dart';
|
||||
|
||||
class SampleBindings extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.lazyPut<LoginController>(() => LoginController());
|
||||
Get.lazyPut<MainController>(() => MainController());
|
||||
}
|
||||
}
|
||||
21
lib/utils/sample_routes.dart
Normal file
21
lib/utils/sample_routes.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import './sample_bindings.dart';
|
||||
import '../../pages/main/main_view.dart';
|
||||
import '../../pages/login/login_view.dart';
|
||||
|
||||
class SampleRouts {
|
||||
static final sampleBindings = SampleBindings();
|
||||
static final samplePages = [
|
||||
GetPage(
|
||||
name: LoginPage.namedRoute,
|
||||
binding: sampleBindings,
|
||||
page: () => const LoginPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: MainPage.namedRoute,
|
||||
binding: sampleBindings,
|
||||
page: () => const MainPage(),
|
||||
),
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user