Skip to content

Commit

Permalink
Updated flutter and other packages version
Browse files Browse the repository at this point in the history
  • Loading branch information
amitjangid80 committed Sep 3, 2024
1 parent d23939b commit 4466ddf
Show file tree
Hide file tree
Showing 26 changed files with 208 additions and 261 deletions.
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:multiutillib/multiutillib.dart';
void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});

@override
Widget build(BuildContext context) {
Expand All @@ -20,7 +20,7 @@ class MyApp extends StatelessWidget {
}

class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
const MyHomePage({super.key});

@override
MyHomePageState createState() => MyHomePageState();
Expand Down
4 changes: 2 additions & 2 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import package_info_plus
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
66 changes: 1 addition & 65 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
name: example
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1

environment:
sdk: '>=3.1.2 <4.0.0'

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
flutter:
sdk: flutter
Expand All @@ -38,51 +18,7 @@ dev_dependencies:
flutter_test:
sdk: flutter

# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^2.0.0
flutter_lints: ^4.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true

# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware

# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages

# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
2 changes: 0 additions & 2 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:example/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
Expand Down
4 changes: 2 additions & 2 deletions lib/animations/slide_animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ class SlideAnimation extends StatefulWidget {
final AnimationController animationController;

const SlideAnimation({
Key? key,
super.key,
required this.position,
required this.itemCount,
required this.animationController,
required this.child,
this.slideDirection = SlideDirection.fromRight,
}) : super(key: key);
});

@override
SlideAnimationState createState() => SlideAnimationState();
Expand Down
27 changes: 0 additions & 27 deletions lib/utils/date_time_utils.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Created by AMIT JANGID on 26/12/20.

import 'package:flutter/material.dart';

import 'package:intl/intl.dart';
import 'package:multiutillib/multiutillib.dart';

Expand All @@ -14,28 +12,3 @@ String getCurrentDate({String? newDateTimeFormat}) {
return DateFormat(kDefaultDateTimeFormat).format(DateTime.now());
}
}

/// [formatDateTime] method
/// this method will format a date string in default or format provided.
@Deprecated('Use .toDisplayDate extension instead.')
String formatDateTime(String dateTime, {String? newDateTimeFormat}) {
dateTime = dateTime.replaceNullWithEmpty;

if (dateTime.toString().isNotEmpty) {
/// formatting date in yyyy-MM-dd HH:mm:ss format
dateTime = DateFormat(newDateTimeFormat ?? kDefaultDateTimeFormat).format(DateTime.parse(dateTime));
}

return dateTime;
}

/// [convertTimeOfDay] method
/// this method will convert time of day to date time format
@Deprecated('Use .toDisplayTime extension instead.')
String convertTimeOfDay(TimeOfDay timeOfDay, {String? timeFormat}) {
final now = DateTime.now();
final DateTime dateTime = DateTime(now.year, now.month, now.day, timeOfDay.hour, timeOfDay.minute);

/// calling format date time method to convert time of day for display
return formatDateTime(dateTime.toString(), newDateTimeFormat: timeFormat ?? kTimeDisplayFormat);
}
16 changes: 15 additions & 1 deletion lib/utils/ui_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

import 'package:flutter/material.dart';

const verticalSpace1 = SizedBox(height: 1);
const verticalSpace2 = SizedBox(height: 2);
const verticalSpace3 = SizedBox(height: 3);
const verticalSpace4 = SizedBox(height: 4);
const verticalSpace5 = SizedBox(height: 5);
const verticalSpace6 = SizedBox(height: 6);
const verticalSpace7 = SizedBox(height: 7);
const verticalSpace8 = SizedBox(height: 8);
const verticalSpace9 = SizedBox(height: 9);
const verticalSpace10 = SizedBox(height: 10);
const verticalSpace11 = SizedBox(height: 11);
const verticalSpace12 = SizedBox(height: 12);
const verticalSpace15 = SizedBox(height: 15);
const verticalSpace18 = SizedBox(height: 18);
Expand All @@ -18,11 +25,18 @@ const verticalSpace48 = SizedBox(height: 48);
const verticalSpace54 = SizedBox(height: 54);
const verticalSpace60 = SizedBox(height: 60);

const horizontalSpace1 = SizedBox(width: 1);
const horizontalSpace2 = SizedBox(width: 2);
const horizontalSpace3 = SizedBox(width: 3);
const horizontalSpace4 = SizedBox(width: 4);
const horizontalSpace5 = SizedBox(width: 5);
const horizontalSpace6 = SizedBox(width: 6);
const horizontalSpace7 = SizedBox(width: 7);
const horizontalSpace8 = SizedBox(width: 8);
const horizontalSpace9 = SizedBox(width: 9);
const horizontalSpace12 = SizedBox(width: 12);
const horizontalSpace10 = SizedBox(width: 10);
const horizontalSpace11 = SizedBox(width: 11);
const horizontalSpace12 = SizedBox(width: 12);
const horizontalSpace15 = SizedBox(width: 15);
const horizontalSpace18 = SizedBox(width: 18);
const horizontalSpace21 = SizedBox(width: 21);
Expand Down
74 changes: 39 additions & 35 deletions lib/widgets/connectivity_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ConnectivityBuilder extends StatelessWidget {
final Widget Function(bool isConnected) builder;

const ConnectivityBuilder({
Key? key,
super.key,
required this.builder,
this.gradient,
this.offlineWidget,
Expand All @@ -47,46 +47,50 @@ class ConnectivityBuilder extends StatelessWidget {
this.alignment = Alignment.center,
this.message = kInternetNotAvailable,
this.textStyle = const TextStyle(fontSize: 14, color: Colors.white),
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
return StreamBuilder<ConnectivityResult>(
return StreamBuilder<List<ConnectivityResult>>(
stream: Connectivity().onConnectivityChanged,
builder: (context, snapshot) {
switch (snapshot.data) {
case ConnectivityResult.wifi:
case ConnectivityResult.mobile:
return builder(true);
print("snapshot data value is: $snapshot");

case ConnectivityResult.none:
default:
return Stack(
children: [
builder(false),
disableInteraction
? Column(
children: <Widget>[
Flexible(child: Container(decoration: const BoxDecoration(color: Colors.black38))),
],
)
: const SizedBox.shrink(),
offlineWidget ??
Positioned(
left: 0,
right: 0,
top: position == Position.top ? 0 : null,
bottom: position == Position.bottom ? 0 : null,
child: Container(
alignment: alignment,
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(color: bgColor, gradient: gradient),
child: Text(message, style: textStyle),
),
),
],
);
}
return builder(true);

// switch (snapshot.data) {
// case ConnectivityResult.wifi:
// case ConnectivityResult.mobile:
// return builder(true);

// case ConnectivityResult.none:
// default:
// return Stack(
// children: [
// builder(false),
// disableInteraction
// ? Column(
// children: <Widget>[
// Flexible(child: Container(decoration: const BoxDecoration(color: Colors.black38))),
// ],
// )
// : const SizedBox.shrink(),
// offlineWidget ??
// Positioned(
// left: 0,
// right: 0,
// top: position == Position.top ? 0 : null,
// bottom: position == Position.bottom ? 0 : null,
// child: Container(
// alignment: alignment,
// padding: const EdgeInsets.all(12),
// decoration: BoxDecoration(color: bgColor, gradient: gradient),
// child: Text(message, style: textStyle),
// ),
// ),
// ],
// );
// }
},
);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/widgets/custom_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
final VoidCallback? onBackButtonPressed;

const CustomAppBar({
Key? key,
super.key,
required this.title,
this.centerTitle,
this.elevation = 4,
this.actions = const [],
this.onBackButtonPressed,
this.isHomeScreen = false,
this.titleStyle = const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/widgets/custom_date_picker/date_picker_calendar_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CustomCalendarView extends StatefulWidget {
final Function(DateTime?)? onDateChange;

const CustomCalendarView({
Key? key,
super.key,
this.minimumDate,
this.maximumDate,
this.onDateChange,
Expand All @@ -23,7 +23,7 @@ class CustomCalendarView extends StatefulWidget {
this.weekDaysTextColor,
this.monthYearTextColor,
this.selectedDateColor,
}) : super(key: key);
});

@override
CustomCalendarViewState createState() => CustomCalendarViewState();
Expand Down
3 changes: 1 addition & 2 deletions lib/widgets/custom_date_picker/date_picker_popup_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class _CalendarPopupView extends StatefulWidget {
final Color? selectedDateColor;

const _CalendarPopupView({
Key? key,
this.minimumDate,
this.maximumDate,
this.barrierDismissible,
Expand All @@ -85,7 +84,7 @@ class _CalendarPopupView extends StatefulWidget {
this.leftArrowColor,
this.rightArrowColor,
this.selectedDateColor,
}) : super(key: key);
});

@override
_CalendarPopupViewState createState() => _CalendarPopupViewState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CustomCalendarView extends StatefulWidget {
final Function(DateTime?, DateTime?)? startEndDateChange;

const CustomCalendarView({
Key? key,
super.key,
this.minimumDate,
this.maximumDate,
this.initialEndDate,
Expand All @@ -25,7 +25,7 @@ class CustomCalendarView extends StatefulWidget {
this.monthYearTextColor,
this.startEndDateChange,
this.selectedRangeColor,
}) : super(key: key);
});

@override
CustomCalendarViewState createState() => CustomCalendarViewState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class _CalendarPopupView extends StatefulWidget {
final Color? selectedRangeColor;

const _CalendarPopupView({
Key? key,
this.minimumDate,
this.maximumDate,
this.onApplyClick,
Expand All @@ -89,7 +88,7 @@ class _CalendarPopupView extends StatefulWidget {
this.selectedRangeColor,
this.applyButtonTextStyle,
this.cancelButtonTextStyle,
}) : super(key: key);
});

@override
_CalendarPopupViewState createState() => _CalendarPopupViewState();
Expand Down
Loading

0 comments on commit 4466ddf

Please sign in to comment.