Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ImgBot] Optimize images #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app_animais/web/icons/Icon-maskable-192.png
Binary file modified app_animais/web/icons/Icon-maskable-512.png
Binary file modified app_to_do_list/web/icons/Icon-maskable-192.png
Binary file modified app_to_do_list/web/icons/Icon-maskable-512.png
Binary file modified calculadora_flutter/web/icons/Icon-maskable-192.png
Binary file modified calculadora_flutter/web/icons/Icon-maskable-512.png
Binary file modified estudo_media_query/web/icons/Icon-maskable-192.png
Binary file modified estudo_media_query/web/icons/Icon-maskable-512.png
Binary file modified estudo_variaveis_operadores/web/icons/Icon-maskable-192.png
Binary file modified estudo_variaveis_operadores/web/icons/Icon-maskable-512.png
Binary file modified exemplo09facil/web/icons/Icon-maskable-192.png
Binary file modified exemplo09facil/web/icons/Icon-maskable-512.png
45 changes: 0 additions & 45 deletions exemplo_api/.metadata

This file was deleted.

10 changes: 0 additions & 10 deletions exemplo_api/android/app/src/debug/AndroidManifest.xml

This file was deleted.

26 changes: 0 additions & 26 deletions exemplo_api/android/settings.gradle

This file was deleted.

Empty file added exemplo_api/lib/Controller.dart
Empty file.
116 changes: 116 additions & 0 deletions exemplo_api/lib/Screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import 'package:flutter/material.dart';
import 'package:exemplo_api/Service.dart';

class WeatherScreen extends StatefulWidget {
const WeatherScreen({Key? key}) : super(key: key);

@override
State<WeatherScreen> createState() => _WeatherScreenState();
}

class _WeatherScreenState extends State<WeatherScreen> {
final WeatherService _weatherService = WeatherService(
apiKey: '681126f28e7d6fa3a7cfe0da0671e599',
baseUrl: 'https://api.openweathermap.org/data/2.5',
);

late Map<String, dynamic> _weatherData;
late TextEditingController _cityController;
final _formKey = GlobalKey<FormState>();
bool _isLoading = false;

@override
void initState() {
super.initState();
_cityController = TextEditingController();
_weatherData = {
'name': '',
'main': {'temp': 0},
'weather': [
{'description': ''}
],
};
}

@override
void dispose() {
_cityController.dispose();
super.dispose();
}

Future<void> _fetchWeatherData(String city) async {
setState(() {
_isLoading = true;
});
try {
final weatherData = await _weatherService.getWeather(city);
setState(() {
_weatherData = weatherData;
_isLoading = false;
});
} catch (e) {
print('Error fetching weather data: $e');
setState(() {
_isLoading = false;
});
}
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Previsão do Tempo'),
),
body: Form(
key: _formKey,
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: TextFormField(
controller: _cityController,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Digite o nome da cidade';
}
return null;
},
decoration: const InputDecoration(
labelText: 'Nome da cidade',
),
),
),
ElevatedButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
_fetchWeatherData(_cityController.text);
}
},
child: const Text('Buscar'),
),
const SizedBox(height: 16),
_isLoading
? const Center(
child: CircularProgressIndicator(),
)
: _weatherData == null
? const Center(
child: Text('Nenhum dado disponível'),
)
: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('City: ${_weatherData['name']}'),
Text('Temperature: ${(_weatherData['main']['temp'] - 273.15).toStringAsFixed(2)} °C'),
Text('Description: ${_weatherData['weather'][0]['description']}'),
],
),
),
],
),
),
);
}
}
30 changes: 30 additions & 0 deletions exemplo_api/lib/Service.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'dart:convert';

import 'package:geolocator/geolocator.dart';
import 'package:http/http.dart' as http;

class WeatherService {
final String apiKey;
final String baseUrl;

WeatherService({required this.apiKey, required this.baseUrl});

Future<Map<String, dynamic>> getWeather(String city) async {
final url = Uri.parse('$baseUrl/weather?q=$city&appid=$apiKey');
final response = await http.get(url);
return json.decode(response.body);
}

Future<Map<String, dynamic>> getWeatherByLocation(
double lat, double lon) async {
Position position = await Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.high);

double lat = position.latitude;
double lon = position.longitude;

final url = Uri.parse('$baseUrl/weather?lat=$lat&lon=$lon&appid=$apiKey');
final response = await http.get(url);
return json.decode(response.body);
}
}
29 changes: 0 additions & 29 deletions exemplo_api/lib/main.dart

This file was deleted.

Loading