Skip to content

Commit

Permalink
optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
moha-b committed Jan 29, 2024
1 parent 3efba6c commit 0e2411d
Show file tree
Hide file tree
Showing 19 changed files with 95 additions and 102 deletions.
8 changes: 2 additions & 6 deletions lib/app/app.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import 'package:clima/app/bloc/network/network_cubit.dart';
import 'package:clima/app/bloc/theme/theme_cubit.dart';
import 'package:clima/app/widgets/location_service_disabled.dart';
import 'package:clima/app/widgets/permission_denied_widget.dart';
import 'package:clima/app/widgets/waiting_permission_widget.dart';
import 'package:clima/app/bloc/bloc.dart';
import 'package:clima/app/widgets/widgets.dart';
import 'package:clima/core/utils/utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:lottie/lottie.dart';

import '../core/common/loading_widget.dart';
import '../features/landing_page/landing_screen.dart';
import 'bloc/location/location_bloc.dart';

class MyApp extends StatelessWidget {
const MyApp({super.key});
Expand Down
3 changes: 3 additions & 0 deletions lib/app/bloc/bloc.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export 'location/location_bloc.dart';
export 'network/network_cubit.dart';
export 'theme/theme_cubit.dart';
3 changes: 3 additions & 0 deletions lib/app/widgets/widgets.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export 'location_service_disabled.dart';
export 'permission_denied_widget.dart';
export 'waiting_permission_widget.dart';
5 changes: 5 additions & 0 deletions lib/core/common/common.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export 'failure_widget.dart';
export 'loading_widget.dart';
export 'primary_button.dart';
export 'temperature_text.dart';
export 'weather_image.dart';
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:clima/core/common/failure_widget.dart';
import 'package:clima/core/common/loading_widget.dart';
import 'package:clima/core/common/common.dart';
import 'package:clima/features/daily_forecast/cubit/daily_forecast_cubit.dart';
import 'package:clima/features/daily_forecast/screens/widgets/daily_forecast_widget.dart';
import 'package:clima/features/daily_forecast/screens/widgets/widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import 'package:clima/core/utils/utils.dart';
import 'package:clima/features/daily_forecast/data/models/daily_weather_model.dart';
import 'package:flutter/material.dart';

import '../../../../core/animations/fade_slide_animation.dart';
import 'daily_widget.dart';
part of 'widgets.dart';

class DailyForecastWidget extends StatefulWidget {
const DailyForecastWidget({
Expand Down
38 changes: 1 addition & 37 deletions lib/features/daily_forecast/screens/widgets/daily_widget.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:lottie/lottie.dart';

import '../../../../core/common/temperature_text.dart';
import '../../../../core/helper/date_helper.dart';
import '../../../../core/utils/utils.dart';
import '../../data/models/daily_weather_model.dart';
part of 'widgets.dart';

class DailyWidget extends StatelessWidget {
const DailyWidget({
Expand Down Expand Up @@ -83,32 +76,3 @@ class DailyWidget extends StatelessWidget {
);
}
}

class DataWidget extends StatelessWidget {
const DataWidget({
super.key,
required this.apparentTemperature,
required this.icon,
});

final String apparentTemperature;
final String icon;

@override
Widget build(BuildContext context) {
return Row(
children: [
SvgPicture.asset(
icon,
width: AppDimensions.width! * 0.07,
fit: BoxFit.cover,
),
const SizedBox(width: 5),
Text(
apparentTemperature,
style: AppTypography.medium12(),
),
],
);
}
}
30 changes: 30 additions & 0 deletions lib/features/daily_forecast/screens/widgets/date_widget.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
part of 'widgets.dart';

class DataWidget extends StatelessWidget {
const DataWidget({
super.key,
required this.apparentTemperature,
required this.icon,
});

final String apparentTemperature;
final String icon;

@override
Widget build(BuildContext context) {
return Row(
children: [
SvgPicture.asset(
icon,
width: AppDimensions.width! * 0.07,
fit: BoxFit.cover,
),
const SizedBox(width: 5),
Text(
apparentTemperature,
style: AppTypography.medium12(),
),
],
);
}
}
13 changes: 13 additions & 0 deletions lib/features/daily_forecast/screens/widgets/widgets.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'package:clima/core/utils/utils.dart';
import 'package:clima/features/daily_forecast/data/models/daily_weather_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:lottie/lottie.dart';

import '../../../../core/animations/fade_slide_animation.dart';
import '../../../../core/common/temperature_text.dart';
import '../../../../core/helper/date_helper.dart';

part 'daily_forecast_widget.dart';
part 'daily_widget.dart';
part 'date_widget.dart';
3 changes: 1 addition & 2 deletions lib/features/home/screens/home_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:clima/app/bloc/theme/theme_cubit.dart';
import 'package:clima/core/common/failure_widget.dart';
import 'package:clima/core/common/loading_widget.dart';
import 'package:clima/core/common/common.dart';
import 'package:clima/core/services/notification_service.dart';
import 'package:clima/features/home/cubit/home_cubit.dart';
import 'package:clima/features/home/screens/widgets/widgets.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:clima/core/common/failure_widget.dart';
import 'package:clima/core/common/loading_widget.dart';
import 'package:clima/features/hourly_forecast/screens/widgets/hourly_forecast_widget.dart';
import 'package:clima/features/hourly_forecast/screens/widgets/widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import 'package:clima/features/hourly_forecast/data/models/weather_daily_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

import '../../../../core/common/temperature_text.dart';
import '../../../../core/common/weather_image.dart';
import '../../../../core/helper/location_helper.dart';
import '../../../../core/utils/utils.dart';
import '../../../home/cubit/home_cubit.dart';
part of 'widgets.dart';

class CustomAppBar extends StatelessWidget {
const CustomAppBar(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'package:flutter/material.dart';

import '../../../../core/utils/utils.dart';
part of 'widgets.dart';

class DayAndNight extends StatelessWidget {
const DayAndNight({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import 'package:clima/core/utils/utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

import '../../data/models/forecast_info_model.dart';
import '../../data/models/weather_daily_model.dart';
part of 'widgets.dart';

class ForecastInfoWidget extends StatelessWidget {
const ForecastInfoWidget({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import 'package:clima/core/utils/utils.dart';
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';

import '../../data/models/weather_hourly_model.dart';
part of 'widgets.dart';

class HourlyForecastDetails extends StatelessWidget {
const HourlyForecastDetails({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
import 'package:clima/core/utils/utils.dart';
import 'package:flutter/material.dart';

import '../../data/models/weather_daily_model.dart';
import '../../data/models/weather_hourly_model.dart';
import '../../data/models/weather_news_model.dart';
import 'custom_app_bar.dart';
import 'day_and_night_widget.dart';
import 'forecast_info_widget.dart';
import 'hourly_forecast_details.dart';
import 'news_widget.dart';
part of 'widgets.dart';

class HourlyForecastWidget extends StatelessWidget {
const HourlyForecastWidget(
Expand Down
4 changes: 1 addition & 3 deletions lib/features/hourly_forecast/screens/widgets/news.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'package:flutter/material.dart';

import '../../../../core/utils/app_typography.dart';
part of 'widgets.dart';

class News extends StatelessWidget {
const News({
Expand Down
11 changes: 1 addition & 10 deletions lib/features/hourly_forecast/screens/widgets/news_widget.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
import 'dart:async';

import 'package:clima/features/hourly_forecast/data/models/weather_news_model.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart';

import '../../../../core/utils/utils.dart';
import '../../data/models/weather_daily_model.dart';
import 'news.dart';
part of 'widgets.dart';

class NewsWidget extends StatefulWidget {
const NewsWidget(
Expand Down
26 changes: 26 additions & 0 deletions lib/features/hourly_forecast/screens/widgets/widgets.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'dart:async';

import 'package:clima/features/hourly_forecast/data/models/weather_daily_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:intl/intl.dart';
import 'package:lottie/lottie.dart';
import 'package:url_launcher/url_launcher.dart';

import '../../../../core/common/temperature_text.dart';
import '../../../../core/common/weather_image.dart';
import '../../../../core/helper/location_helper.dart';
import '../../../../core/utils/utils.dart';
import '../../../home/cubit/home_cubit.dart';
import '../../data/models/forecast_info_model.dart';
import '../../data/models/weather_hourly_model.dart';
import '../../data/models/weather_news_model.dart';

part 'custom_app_bar.dart';
part 'day_and_night_widget.dart';
part 'forecast_info_widget.dart';
part 'hourly_forecast_details.dart';
part 'hourly_forecast_widget.dart';
part 'news.dart';
part 'news_widget.dart';

0 comments on commit 0e2411d

Please sign in to comment.