forked from eatvio/eatvio_app
Created .env file for environment variables and added corresponding package (flutter_dotenv)
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:validators/validators.dart';
|
||||
import 'package:eatvio_app/widgets/next_step_button.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'dart:convert';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
@@ -83,8 +84,7 @@ class AuthScreen extends StatelessWidget {
|
||||
'password': state.passwordController!.text,
|
||||
};
|
||||
final response = await http.post(
|
||||
Uri.parse(
|
||||
'https://emaibo4wahye-dev3.eatvio.ru/api/login'),
|
||||
Uri.parse(dotenv.env['SERVER_ROOT']! + '/login'),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: json.encode(credentials),
|
||||
encoding: utf8);
|
||||
@@ -103,7 +103,7 @@ class AuthScreen extends StatelessWidget {
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text('Ошибка'),
|
||||
content:
|
||||
Text(jsonDecode(jsonEncode(response.body))),
|
||||
Text(dotenv.env['SERVER_ROOT']! + '/login'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
|
||||
Reference in New Issue
Block a user