Skip to content
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
44 changes: 44 additions & 0 deletions .gitignore copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ CircleAvatar(
- `NetworkImage`
- This is used for images that are stored on the internet

#### [AssetImage](https://api.flutter.dev/flutter/painting/AssetImage-class.html)
#### AssetImage

```dart
Image(
Expand All @@ -283,7 +283,7 @@ Image(
- The `Image` widget has an `image` property that takes an `ImageProvider` object. This is the image that will be displayed.
- The `AssetImage` widget is a widget that displays an image that is stored locally in your app.

#### [NetworkImage](https://api.flutter.dev/flutter/painting/NetworkImage-class.html)
#### NetworkImage

```dart
Image(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/download (1).jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/icons8-clouds-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/icons8-night-wind-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/icons8-partly-cloudy-day-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/weather-2021-12-07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'screens/home_screen.dart';

void main() {
runApp(const MainApp());
Expand All @@ -10,11 +11,8 @@ class MainApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
body: Center(
child: Text('Hello World!'),
),
),
home: HomeScreen(),
debugShowCheckedModeBanner: false,
);
}
}
83 changes: 83 additions & 0 deletions lib/screens/home_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import 'package:flutter/material.dart';
import 'package:avatar_glow/avatar_glow.dart';
import 'package:weather_app/widgets/weather_today.dart';
import 'package:weather_app/widgets/details.dart';


class HomeScreen extends StatelessWidget {
const HomeScreen({
super.key,
});

@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Stack(children: <Widget>[
Container(
alignment: Alignment.topCenter,
width: double.maxFinite,
height: double.maxFinite,
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xff09203F), Color(0xff537895)],
),
),
child: Column(
children: <Widget>[
const Text("\n\nAl Khobar",
style: TextStyle(
fontFamily: 'Open Sans',
fontSize: 30.0,
color: Colors.white)),
const Text(" 19°",
style: TextStyle(
fontFamily: 'Open Sans',
fontSize: 75.0,
color: Colors.white)),
AvatarGlow(
endRadius: 60.0,
child: Material(
elevation: 60.0,
shape: const CircleBorder(),
child: CircleAvatar(
radius: 45.0,
backgroundColor: Colors.blueGrey[100],
backgroundImage:
const AssetImage('assets/images/weather-2021-12-07.png'),
),
),
),
const Text("Partly Cloudy\n H:24° L:18°",
style: TextStyle(
fontFamily: 'Open Sans',
fontSize: 20.0,
color: Colors.white70)),
const SizedBox(
height: 20,
),
Row(mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[
WeatherToday(text:"\n1 PM",link:'assets/images/icons8-partly-cloudy-day-48.png',text2:"19°"),
WeatherToday(text:"\nNow",link:'assets/images/icons8-partly-cloudy-day-48.png',text2:"19°"),
WeatherToday(text:"\n3 PM",link:'assets/images/icons8-clouds-48.png',text2:"20°"),
WeatherToday(text:"\n4 PM",link:'assets/images/icons8-night-wind-48.png',text2:"22°"),
WeatherToday(text:"\n5 PM",link:'assets/images/icons8-night-wind-48.png',text2:"23°"),
]),
const SizedBox(
height: 20,
),
Row(
children: [
const SizedBox(
width: 8,
),
Details(text:"FEELS LIKE",text2:"17°",text3:"Similar to the actual temperature."),
Details(text:"HUMIDITY",text2:"67%",text3:"The dew point is 18° right now."),
],
),
],
),
),
])));
}
}
59 changes: 59 additions & 0 deletions lib/widgets/details.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import 'package:flutter/material.dart';

class Details extends StatelessWidget {
Details({
super.key,
required this.text,
required this.text2,
required this.text3,
});

final String text;
final String text2;
final String text3;

@override
Widget build(BuildContext context) {
return Container(
height: 250.0,
width: 200.0,
color: Colors.transparent,
child: Container(
margin: const EdgeInsets.all(15),
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 2,
offset: const Offset(0, 3), // changes position of shadow
),
],
),
child: Container(
padding: const EdgeInsets.all(5),
margin: const EdgeInsets.all(6),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
text,
style: const TextStyle(fontSize: 19, color: Colors.white70),
),
const SizedBox(height: 25),
Text(
text2,
style: const TextStyle(fontSize: 45, color: Colors.white),
),
const SizedBox(height: 50),
Text(
text3,
style: const TextStyle(fontSize: 17, color: Colors.white),
),
],
),
)));
}
}
70 changes: 70 additions & 0 deletions lib/widgets/weather_today.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import 'package:flutter/material.dart';
import 'package:avatar_glow/avatar_glow.dart';

class WeatherToday extends StatelessWidget {
WeatherToday({
super.key,
required this.text,
required this.link,
required this.text2,
});

final String text;
final String link;
final String text2;

@override
Widget build(BuildContext context) {
return Expanded(
child: Container(
padding: const EdgeInsets.all(5),
margin: const EdgeInsets.all(7),
height: 180.0,
width: 300.0,
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius: const BorderRadius.all(Radius.circular(60.0)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 4,
offset: const Offset(0, 3), // changes position of shadow
),
],
),
child: Center(
child: Column(
children: [
Text(
text, //"\n1 PM"
style: const TextStyle(
color: Colors.white, fontSize: 20, fontFamily: 'Geneva'),
textAlign: TextAlign.center,
),
AvatarGlow(
endRadius: 40.0,
child: Material(
elevation: 60.0,
shape: const CircleBorder(),
child: CircleAvatar(
radius: 23.0,
backgroundColor: Colors.blueGrey,
backgroundImage: AssetImage(
link), //'assets/images/icons8-partly-cloudy-day-48.png'
),
),
),
Text(
text2, //"19°"
style: const TextStyle(
color: Colors.white, fontSize: 20, fontFamily: 'Geneva'),
textAlign: TextAlign.center,
),
],
),
),
),
);
}
}
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.11.0"
avatar_glow:
dependency: "direct main"
description:
name: avatar_glow
sha256: "3627f6f97d1f10d3c1996ae108d3488eabaf68c0cf0c3eac7e7c746a3812881d"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
boolean_selector:
dependency: transitive
description:
Expand Down
Loading