Skip to content

Commit

Permalink
Implemented pagination, Long location name fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulmominsakib committed Dec 31, 2020
1 parent a62b492 commit deb7f3a
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 23 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# <img src="docs/Abohawa-Bangla-Weather-Logo.png" width="30"> আবহাওয়া - Weather App (Bengali)

এটি একটি বাংলা আবহাওয়া এর এ্যাপ। আপনি চাইলে এই এ্যাপ ব্যবহার করতে পারবেন। Flutter ইউজ করে এই এ্যাপ বানানো হয়েছে। API ইউজ করা হয়েছে OPEN WEATHER ফ্রি এপিআই।

### <img src="docs/hero-image.png">
<br>
এটি একটি বাংলা আবহাওয়া এর এ্যাপ। আপনি চাইলে এই এ্যাপ ব্যবহার করতে পারবেন। Flutter ইউজ করে এই এ্যাপ বানানো হয়েছে। API ইউজ করা হয়েছে OPEN WEATHER ফ্রি এপিআই।
<br>
<br>
<img src='docs/app-demo.gif' width='300'>

## API KEY এড করতে হবে এখানেঃ
Expand Down
Binary file removed docs/Abohawa-Bangla-Weather-Logo.png
Binary file not shown.
Binary file removed docs/flutter-android-ios.png
Binary file not shown.
6 changes: 3 additions & 3 deletions lib/controller/weatherConditionController.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class WeatherConditionController extends GetxController {
return null;
}
}

// This will ask for permission if user has not give location permission
_permissionGranted = await location.hasPermission();
if (_permissionGranted == locate.PermissionStatus.denied) {
_permissionGranted = await location.requestPermission();
Expand All @@ -63,8 +63,8 @@ class WeatherConditionController extends GetxController {

_locationData = await location.getLocation();

print(_locationData.latitude);
print(_locationData.longitude);
print('Your Latitude: ${_locationData.latitude}');
print('Your Longtitude: ${_locationData.longitude}');
// For Network Call
String lat = _locationData.latitude.toString();
String lon = _locationData.longitude.toString();
Expand Down
10 changes: 4 additions & 6 deletions lib/views/root.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class BanglaWeather extends StatefulWidget {
}

class _BanglaWeatherState extends State<BanglaWeather> {
/* -------->
This is for bottom navigation */
int _selectedIndex = 0;
Widget defaultHomeScreen = HomeScreen();

Expand All @@ -32,16 +34,12 @@ class _BanglaWeatherState extends State<BanglaWeather> {
);
}

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

/* <---------
So we will create two controller one for the Date and other for the weather.
When The app will run, first the Date Generator will generate
a week in Bangla to show the date in the UI and it will contain 9 DATE ITEMS, Then weather condition makeWeatherList() will generate 9 WeatherCondition Items.
a week in Bangla to show the date in the UI and it will contain 9 DATE ITEMS,
Then weather condition makeWeatherList() will generate 9 WeatherCondition Items.
--------------> */

final DateController dateController = Get.put(DateController());
Expand Down
38 changes: 28 additions & 10 deletions lib/views/screens/HomeScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:abohawa/controller/dateController.dart';
import 'package:abohawa/controller/services/connection/internetConnectionChecker.dart';
import 'package:abohawa/controller/weatherConditionController.dart';
import 'package:abohawa/views/ui-components/dateSlider.dart';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:bangla_utilities/bangla_utilities.dart';
import 'package:abohawa/modal/Date.dart';
import 'package:abohawa/views/ui-components/styling.dart';
Expand Down Expand Up @@ -144,23 +145,40 @@ class _HomeScreenState extends State<HomeScreen> {
children: [
Column(
children: [
Row(
Container(
height: height / 15,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.location_on,
color: Colors.white,
size: height / 25,
Expanded(
flex: 3,
child: Align(
alignment: Alignment.centerRight,
child: Icon(
Icons.location_on,
color: Colors.white,
size: height / 25,
),
),
),
SizedBox(
width: 5,
),
Text(
'$userLocation',
style: kHeaderTitle.copyWith(
fontSize: height / 22),
Expanded(
flex: 5,
child: AutoSizeText(
'$userLocation',
style: kHeaderTitle.copyWith(
fontSize: height / 22,
),
minFontSize: 14,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
]),
],
),
),

SizedBox(height: 10),
Text(
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.1"
auto_size_text:
dependency: "direct main"
description:
name: auto_size_text
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
bangla_utilities:
dependency: "direct main"
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies:
data_connection_checker: ^0.3.4
intl: ^0.16.1
app_settings: 4.0.4
auto_size_text: ^2.1.0

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
Expand Down

0 comments on commit deb7f3a

Please sign in to comment.