Skip to content
Snippets Groups Projects
Commit 111587f2 authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

update: remove lower box color, add new fonts

parent 6866aef9
No related branches found
No related tags found
No related merge requests found
Showing
with 163 additions and 27 deletions
import 'package:flutter/material.dart';
import 'pages/default_page.dart';
import 'pages/marker_data.dart';
void main() {
runApp(MyApp());
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: DefaultPage(),
home: const DefaultPage(),
);
}
}
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
// API variables
const String port = "8443";
const String serverURI = "https://127.0.0.1:$port/";
const String mapEndpoint = "update_map";
const int fetchInterval = 5;
\ No newline at end of file
const int fetchInterval = 5;
// Font variables
const textColor = Colors.white;
final appTitleStyle = GoogleFonts.dmSans(
fontSize: 35,
color: Colors.black,
fontWeight: FontWeight.bold, // Add this line to make the text bold
);
final titleStyle = GoogleFonts.dmSans(
fontSize: 35,
color: textColor,
fontWeight: FontWeight.bold, // Add this line to make the text bold
);
final textStyle = GoogleFonts.dmSans(fontSize: 20, color: textColor);
final chartTextStyle = GoogleFonts.dmSans(fontSize: 14, color: textColor);
// Colors
const darkBlue = Color(0xFF00B4D8);
const lightBlue = Color(0xFFCAF0F8);
const superLightBlue = Color(0xFFCAF0F8);
const barBlue = Color(0xFF0077B6);
\ No newline at end of file
......@@ -27,7 +27,7 @@ class _DefaultPageState extends State<DefaultPage> {
(X509Certificate cert, String host, int port) => true;
// Request makers from API and wait for response
var request = await client.getUrl(Uri.parse(serverURI+mapEndpoint));
var request = await client.getUrl(Uri.parse(serverURI + mapEndpoint));
var response = await request.close();
// Attempt to parse json if request is ok
......@@ -38,7 +38,8 @@ class _DefaultPageState extends State<DefaultPage> {
List<dynamic> jsonData = json.decode(responseBody);
// Convert response from type List<dynamic> to List<MarkerTemplate>
markerList = jsonData.map((data) => MarkerTemplate.fromJson(data)).toList();
markerList =
jsonData.map((data) => MarkerTemplate.fromJson(data)).toList();
});
} else {
print('Request failed with status: ${response.statusCode}');
......@@ -73,16 +74,18 @@ class _DefaultPageState extends State<DefaultPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFFCAF0F8),
backgroundColor: darkBlue,
appBar: AppBar(
title: Text('IceMap'),
title: Text(
'IceMap',
style: appTitleStyle,
),
),
body: ListView(
children: [
MapContainerWidget(markerList: markerList),// Return a specific list element
MapContainerWidget(markerList: markerList),
],
),
);
}
}
}
\ No newline at end of file
import 'package:flutter/material.dart';
import '../marker_data.dart';
import '../consts.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart';
import 'package:fl_chart/fl_chart.dart';
......@@ -34,14 +35,14 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
builder: (context, constraints) {
double screenWidth = constraints.maxWidth;
double boxWidth = 0.86;
double boxHeight = 1.5;
double boxHeight = 1.4;
return Column(
children: [
const SizedBox(height: contPadding),
ClipRRect(
borderRadius: BorderRadius.circular(20),
child: SizedBox(
child: Container(
width: screenWidth * boxWidth,
height: screenWidth * boxHeight,
child: FlutterMap(
......@@ -89,7 +90,6 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
child: Container(
width: screenWidth * boxWidth,
height: screenWidth * boxHeight * 1.5, // NB: make dynamic
color: const Color(0xFF00B4D8),
child: Align(
alignment: Alignment.topLeft,
child: Padding(
......@@ -97,17 +97,17 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
Text(
'Ice stats',
style: TextStyle(fontSize: 30, color: Colors.black),
style: titleStyle,
),
Text(
'Latitude: ${selectedMarker?.geoData.latitude}',
style: const TextStyle(fontSize: 20, color: Colors.black),
style: textStyle,
),
Text(
'Longitude: ${selectedMarker?.geoData.longitude}',
style: const TextStyle(fontSize: 20, color: Colors.black),
style: textStyle,
),
const SizedBox(height: contPadding),
SizedBox(
......@@ -115,7 +115,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
height: 200,
child: LineChart(
LineChartData(
backgroundColor: const Color(0xFFCAF0F8),
backgroundColor: lightBlue,
titlesData: FlTitlesData(
leftTitles: SideTitles(showTitles: true),
bottomTitles: SideTitles(showTitles: true),
......@@ -131,7 +131,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
LineChartBarData(
spots: chartData,
isCurved: true,
colors: [const Color(0xFF0077B6)],
colors: [barBlue],
),
],
),
......@@ -149,7 +149,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(color: Colors.black, fontSize: 14),
getTextStyles: (value) => chartTextStyle,
margin: 10,
getTitles: (value) {
switch (value.toInt()) {
......@@ -166,7 +166,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(color: Colors.black, fontSize: 14),
getTextStyles: (value) => chartTextStyle,
margin: 10,
reservedSize: 30,
interval: 5,
......@@ -174,7 +174,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
),
borderData: FlBorderData(
show: true,
border: Border.all(color: Colors.black, width: 1),
border: Border.all(color: Colors.white, width: 1),
),
barGroups: [
BarChartGroupData(
......@@ -214,6 +214,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
),
),
),
const SizedBox(height: contPadding),
],
);
},
......
......@@ -5,6 +5,8 @@
import FlutterMacOS
import Foundation
import path_provider_foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}
......@@ -41,6 +41,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.18.0"
crypto:
dependency: transitive
description:
name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
url: "https://pub.dev"
source: hosted
version: "3.0.3"
equatable:
dependency: transitive
description:
......@@ -57,6 +65,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.1"
ffi:
dependency: transitive
description:
name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
fl_chart:
dependency: "direct main"
description:
......@@ -91,6 +107,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6"
url: "https://pub.dev"
source: hosted
version: "4.0.4"
http:
dependency: "direct main"
description:
......@@ -203,6 +227,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.2.1"
path_provider:
dependency: transitive
description:
name: path_provider
sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b
url: "https://pub.dev"
source: hosted
version: "2.1.2"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668"
url: "https://pub.dev"
source: hosted
version: "2.2.2"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
url: "https://pub.dev"
source: hosted
version: "2.2.1"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
pedantic:
dependency: transitive
description:
......@@ -211,6 +283,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.11.1"
platform:
dependency: transitive
description:
name: platform
sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec"
url: "https://pub.dev"
source: hosted
version: "3.1.4"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev"
source: hosted
version: "2.1.8"
polylabel:
dependency: transitive
description:
......@@ -328,6 +416,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.3.0"
win32:
dependency: transitive
description:
name: win32
sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8"
url: "https://pub.dev"
source: hosted
version: "5.2.0"
wkt_parser:
dependency: transitive
description:
......@@ -336,6 +432,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.0"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d
url: "https://pub.dev"
source: hosted
version: "1.0.4"
sdks:
dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=3.3.0"
dart: ">=3.2.0 <4.0.0"
flutter: ">=3.10.0"
......@@ -14,6 +14,7 @@ dependencies:
latlong2: ^0.8.2
provider: ^5.0.0
fl_chart: ^0.20.0-nullsafety1
google_fonts: any
......@@ -25,5 +26,4 @@ dev_dependencies:
flutter:
uses-material-design: true
assets:
- assets/icons/circle-red.png
- assets/icons/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment