Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.
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
22 changes: 22 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PODS:
- Flutter (1.0.0)
- location (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `Flutter`)
- location (from `.symlinks/plugins/location/ios`)

EXTERNAL SOURCES:
Flutter:
:path: Flutter
location:
:path: ".symlinks/plugins/location/ios"

SPEC CHECKSUMS:
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
location: 3a2eed4dd2fab25e7b7baf2a9efefe82b512d740

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

COCOAPODS: 1.10.1
68 changes: 68 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
0F517ABF787DDBC163187B0F /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3940E69174D14C0EC6A515EF /* Pods_Runner.framework */; };
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
Expand All @@ -31,6 +32,8 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
29C6D2970E7955E2FF08B960 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
3940E69174D14C0EC6A515EF /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand All @@ -42,19 +45,30 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CCD27FBA6968B3196C6A4768 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
D519F07ECA043E93D3A6E7F4 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0F517ABF787DDBC163187B0F /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
838D10E1C6C08B58EF41F8AB /* Frameworks */ = {
isa = PBXGroup;
children = (
3940E69174D14C0EC6A515EF /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
Expand All @@ -72,6 +86,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
FA97D2B42FB0A9DE25D59361 /* Pods */,
838D10E1C6C08B58EF41F8AB /* Frameworks */,
);
sourceTree = "<group>";
};
Expand All @@ -98,19 +114,32 @@
path = Runner;
sourceTree = "<group>";
};
FA97D2B42FB0A9DE25D59361 /* Pods */ = {
isa = PBXGroup;
children = (
CCD27FBA6968B3196C6A4768 /* Pods-Runner.debug.xcconfig */,
D519F07ECA043E93D3A6E7F4 /* Pods-Runner.release.xcconfig */,
29C6D2970E7955E2FF08B960 /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
0207E7723506D859EE04C394 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
E21CF7062C35EA9825D53387 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -169,6 +198,28 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
0207E7723506D859EE04C394 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -197,6 +248,23 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
E21CF7062C35EA9825D53387 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down
3 changes: 3 additions & 0 deletions ios/Runner.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions lib/Screens/homeScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ class HomeScreen extends StatefulWidget {

class _HomeScreenState extends State<HomeScreen> {
PageController _pageController = PageController();
bool _isLoading;
bool _isLoading = true;

@override
void initState() {
_getData();
super.initState();
}

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 @@ -67,7 +68,7 @@ class _HomeScreenState extends State<HomeScreen> {
)
: weatherData.isLocationError
? LocationError()
: Stack(
: Column(
children: [
SearchBar(),
SmoothPageIndicator(
Expand Down
20 changes: 11 additions & 9 deletions lib/Screens/hourlyWeatherScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ class HourlyScreen extends StatelessWidget {
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
hours ?? '',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontWeight: FontWeight.w400,
Expanded(
flex: 1,
child: Text(
hours ?? '',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontWeight: FontWeight.w400,
),
),
),
Text(
Expand Down Expand Up @@ -69,9 +73,7 @@ class HourlyScreen extends StatelessWidget {
height: mediaQuery.size.height,
width: mediaQuery.size.width,
child: ListView(
children: weatherData.hourly24Weather
.map((item) => dailyWidget(item, context))
.toList(),
children: weatherData.hourly24Weather.map((item) => dailyWidget(item, context)).toList(),
),
),
),
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': '2d39b268ea31d82113c26f987dc5b67e',
};

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
1 change: 0 additions & 1 deletion lib/models/weather.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class Weather with ChangeNotifier {
});

factory Weather.fromJson(Map<String, dynamic> json) {
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
11 changes: 3 additions & 8 deletions lib/widgets/hourlyForecast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class HourlyForecast extends StatelessWidget {
),
Padding(
padding: const EdgeInsets.only(bottom: 25),
child: MapString.mapStringToIcon(
'${weather.condition}', context, 40),
child: MapString.mapStringToIcon('${weather.condition}', context, 40),
),
Container(
width: 80,
Expand Down Expand Up @@ -93,7 +92,7 @@ class HourlyForecast extends StatelessWidget {
TextButton(
child: Text(
'See More',
style: TextStyle(color: Colors.green),
style: TextStyle(color: Theme.of(context).primaryColor),
),
onPressed: () {
Navigator.of(context).pushNamed(HourlyScreen.routeName);
Expand All @@ -102,11 +101,7 @@ class HourlyForecast extends StatelessWidget {
],
),
SizedBox(height: 5),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: hourlyForecast
.map((item) => hourlyWidget(item, context))
.toList()),
Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: hourlyForecast.map((item) => hourlyWidget(item, context)).toList()),
],
),
);
Expand Down
7 changes: 4 additions & 3 deletions lib/widgets/mainWeather.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class MainWeather extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
Expand All @@ -35,7 +36,7 @@ class MainWeather extends StatelessWidget {
Text('${wData.weather.cityName}', style: _style1),
],
),
SizedBox(height: 5),
// SizedBox(height: 5),
Text(
DateFormat.yMMMEd().add_jm().format(DateTime.now()),
style: _style2,
Expand All @@ -58,12 +59,12 @@ class MainWeather extends StatelessWidget {
),
],
),
SizedBox(height: 10),
// SizedBox(height: 10),
Text(
'${wData.weather.tempMax.toStringAsFixed(0)}°/ ${wData.weather.tempMin.toStringAsFixed(0)}° Feels like ${wData.weather.feelsLike.toStringAsFixed(0)}°',
style: _style1.copyWith(fontSize: 19),
),
SizedBox(height: 5),
// SizedBox(height: 5),
Text(
toBeginningOfSentenceCase('${wData.weather.description}'),
style: _style1.copyWith(fontSize: 19),
Expand Down
22 changes: 12 additions & 10 deletions lib/widgets/requestError.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class RequestError extends StatelessWidget {
color: Colors.black,
size: 100,
),
SizedBox(height: 10),
// SizedBox(height: 10),
Text(
'No Search Result',
style: TextStyle(
Expand All @@ -22,15 +22,17 @@ class RequestError extends StatelessWidget {
fontWeight: FontWeight.w500,
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 75, vertical: 10),
child: Text(
"Please make sure that you entered the correct location name",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey[700],
fontSize: 15,
fontWeight: FontWeight.w400,
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 75, vertical: 10),
child: Text(
"Please make sure that you entered the correct location name",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey[700],
fontSize: 15,
fontWeight: FontWeight.w400,
),
),
),
),
Expand Down
Loading