Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

mf_fixing the code for FEEP #4

Open
wants to merge 1 commit 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
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "FEEP",
"request": "launch",
"type": "dart"
}
]
}
1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
18 changes: 11 additions & 7 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
include ':app'

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}
126 changes: 71 additions & 55 deletions lib/Screens/homeScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class _HomeScreenState extends State<HomeScreen> {
@override
void initState() {
super.initState();
_getData();
}

@override
Expand Down Expand Up @@ -53,7 +54,7 @@ class _HomeScreenState extends State<HomeScreen> {

return SafeArea(
child: Scaffold(
body: true
body: _isLoading
? Center(
child: CircularProgressIndicator(
backgroundColor: myContext.primaryColor,
Expand All @@ -70,71 +71,86 @@ class _HomeScreenState extends State<HomeScreen> {
: Stack(
children: [
SearchBar(),
SmoothPageIndicator(
controller: _pageController,
count: 2,
effect: ExpandingDotsEffect(
activeDotColor: myContext.primaryColor,
dotHeight: 6,
dotWidth: 6,
Positioned(
top: 100,
left: MediaQuery.of(context).size.width / 2 - 10,
child: SmoothPageIndicator(
controller: _pageController,
count: 2,
effect: ExpandingDotsEffect(
activeDotColor: myContext.primaryColor,
dotHeight: 6,
dotWidth: 6,
),
),
),
weatherData.isRequestError
? RequestError()
: Expanded(
child: PageView(
controller: _pageController,
children: [
Container(
padding: const EdgeInsets.all(10),
width: mediaQuery.size.width,
child: RefreshIndicator(
onRefresh: () =>
_refreshData(context),
backgroundColor: Colors.blue,
child: ListView(
children: [
FadeIn(
delay: 0,
child: MainWeather(
wData: weatherData)),
FadeIn(
delay: 0.33,
child: WeatherInfo(
wData: weatherData
.currentWeather),
),
FadeIn(
delay: 0.66,
child: HourlyForecast(
weatherData.hourlyWeather),
),
],
),
: Column(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.only(
top: 100,
),
),
Container(
height: mediaQuery.size.height,
width: mediaQuery.size.width,
child: ListView(
child: PageView(
controller: _pageController,
children: [
FadeIn(
delay: 0.33,
child: SevenDayForecast(
wData: weatherData,
dWeather:
weatherData.sevenDayWeather,
Container(
padding: const EdgeInsets.all(10),
width: mediaQuery.size.width,
child: RefreshIndicator(
onRefresh: () =>
_refreshData(context),
backgroundColor: Colors.blue,
child: ListView(
children: [
FadeIn(
delay: 0,
child: MainWeather(
wData:
weatherData)),
FadeIn(
delay: 0.33,
child: WeatherInfo(
wData: weatherData
.currentWeather),
),
FadeIn(
delay: 0.66,
child: HourlyForecast(
weatherData
.hourlyWeather),
),
],
),
),
),
Container(
height: mediaQuery.size.height,
width: mediaQuery.size.width,
child: ListView(
children: [
FadeIn(
delay: 0.33,
child: SevenDayForecast(
wData: weatherData,
dWeather: weatherData
.sevenDayWeather,
),
),
FadeIn(
delay: 0.66,
child: WeatherDetail(
wData: weatherData)),
],
),
),
FadeIn(
delay: 0.66,
child: WeatherDetail(
wData: weatherData)),
],
),
),
],
),
)
],
),
],
),
Expand Down
1 change: 1 addition & 0 deletions lib/Screens/hourlyWeatherScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class HourlyScreen extends StatelessWidget {
fontWeight: FontWeight.w400,
),
),
Spacer(),
Text(
'${weather.dailyTemp.toStringAsFixed(1)}°',
style: TextStyle(
Expand Down
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:logger/logger.dart';
var logger = Logger();

var config = {
'OpenWeatherApiKey': 'fdb61777bda2658e2b20d16554abc84a',
'OpenWeatherApiKey': '944d0b4b4d9c79f8375feb68f2022d48',
};

void main() {
Expand All @@ -35,7 +35,7 @@ class MyApp extends StatelessWidget {
elevation: 0,
),
scaffoldBackgroundColor: Colors.white,
primaryColor: Colors.green,
primaryColor: Colors.blue,
accentColor: Colors.white,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/models/weather.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Weather with ChangeNotifier {
});

factory Weather.fromJson(Map<String, dynamic> json) {
return Weather();
//return Weather();
return Weather(
temp: json['main']['temp'],
tempMax: json['main']['temp_max'],
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/WeatherInfo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class WeatherInfo extends StatelessWidget {
padding: EdgeInsets.only(bottom: 15, right: rightPad),
child: Icon(
icon,
color: Colors.green,
color: Colors.blue,
size: iconSize,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/hourlyForecast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class HourlyForecast extends StatelessWidget {
TextButton(
child: Text(
'See More',
style: TextStyle(color: Colors.green),
style: TextStyle(color: Colors.blue),
),
onPressed: () {
Navigator.of(context).pushNamed(HourlyScreen.routeName);
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/sevenDayForecast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class SevenDayForecast extends StatelessWidget {
SizedBox(height: 15),
Expanded(
child: ListView(
scrollDirection: Axis.vertical,
scrollDirection: Axis.horizontal,
children: [
Row(
children: dWeather
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/weatherDetail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class WeatherDetail extends StatelessWidget {
padding: const EdgeInsets.only(bottom: 15, right: 5),
child: Icon(
icon,
color: Colors.green,
color: Colors.blue,
size: 35,
),
),
Expand Down
Loading