upgraded pub things

This commit is contained in:
Kima 2024-06-20 12:06:50 +02:00
parent fd1b15df77
commit bc8eb1910e
5 changed files with 161 additions and 91 deletions

View File

@ -6,10 +6,9 @@ import 'package:share_plus/share_plus.dart';
class ShareHelper { class ShareHelper {
static Future<void> shareText(String text, {String? subject}) => static Future<void> shareText(String text, {String? subject}) =>
Share.share(text, subject: subject); Share.share(text, subject: subject);
// ignore: deprecated_member_use
static Future<void> shareFile(String path, {String? text, String? subject}) => static Future<void> shareFile(String path, {String? text, String? subject}) =>
// ignore: deprecated_member_use Share.shareXFiles([XFile(path)], text: text, subject: subject);
Share.shareFiles([path], text: text, subject: subject);
static Future<void> shareAttachment(Attachment attachment, static Future<void> shareAttachment(Attachment attachment,
{required BuildContext context}) async { {required BuildContext context}) async {

View File

@ -39,7 +39,7 @@ dependencies:
# ref: master # ref: master
path_provider: ^2.0.2 path_provider: ^2.0.2
permission_handler: ^11.0.1 permission_handler: ^11.0.1
share_plus: ^7.0.2 share_plus: ^9.0.0
connectivity_plus: ^5.0.2 connectivity_plus: ^5.0.2
flutter_displaymode: ^0.6.0 flutter_displaymode: ^0.6.0
quick_actions: ^1.0.1 quick_actions: ^1.0.1
@ -64,15 +64,15 @@ dependencies:
image_picker: ^1.0.7 image_picker: ^1.0.7
animations: ^2.0.1 animations: ^2.0.1
background_fetch: ^1.1.5 background_fetch: ^1.1.5
flutter_local_notifications: ^16.2.0 flutter_local_notifications: ^17.1.2
package_info_plus: ^5.0.1 package_info_plus: ^8.0.0
screenshot: ^3.0.0 screenshot: ^3.0.0
flutter_staggered_grid_view: ^0.7.0 flutter_staggered_grid_view: ^0.7.0
sqflite_common_ffi_web: ^0.4.0 sqflite_common_ffi_web: ^0.4.0
image_crop: image_crop:
git: git:
url: https://github.com/kimaah/image_crop.git url: https://github.com/kimaah/image_crop.git
googleapis: ^12.0.0 googleapis: ^13.2.0
google_sign_in: ^6.2.1 google_sign_in: ^6.2.1
extension_google_sign_in_as_googleapis_auth: ^2.0.12 extension_google_sign_in_as_googleapis_auth: ^2.0.12
maps_launcher: ^2.2.0 maps_launcher: ^2.2.0
@ -84,7 +84,7 @@ dependencies:
flutter_portal: ^1.1.4 flutter_portal: ^1.1.4
dev_dependencies: dev_dependencies:
flutter_lints: ^3.0.1 flutter_lints: ^4.0.0
flutter_launcher_icons: "^0.13.1" flutter_launcher_icons: "^0.13.1"
flutter_native_splash: "^2.3.10" flutter_native_splash: "^2.3.10"
sqflite_common_ffi: ^2.0.0+3 sqflite_common_ffi: ^2.0.0+3

View File

@ -228,22 +228,32 @@ class GradeGraphState extends State<GradeGraph> {
preventCurveOverShooting: false, preventCurveOverShooting: false,
spots: subjectSpots, spots: subjectSpots,
isCurved: true, isCurved: true,
colors: averageColors.reversed.toList(), // colors: averageColors.reversed.toList(),
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: averageColors.reversed.toList(),
),
barWidth: 6, barWidth: 6,
curveSmoothness: 0.2, curveSmoothness: 0.2,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData(show: false), dotData: const FlDotData(show: false),
belowBarData: BarAreaData( belowBarData: BarAreaData(
show: true, show: true,
colors: [ gradient: LinearGradient(
averageColor.withOpacity(0.7), begin: Alignment.topCenter,
averageColor.withOpacity(0.3), end: Alignment.bottomCenter,
averageColor.withOpacity(0.2), colors: [
averageColor.withOpacity(0.1), averageColor.withOpacity(0.7),
], averageColor.withOpacity(0.3),
gradientColorStops: [0.1, 0.6, 0.8, 1], averageColor.withOpacity(0.2),
gradientFrom: const Offset(0, 0), averageColor.withOpacity(0.1),
gradientTo: const Offset(0, 1), ],
stops: const [0.1, 0.6, 0.8, 1],
),
// gradientColorStops: [0.1, 0.6, 0.8, 1],
// gradientFrom: const Offset(0, 0),
// gradientTo: const Offset(0, 1),
), ),
), ),
if (ghostData.isNotEmpty && ghostSpots.isNotEmpty) if (ghostData.isNotEmpty && ghostSpots.isNotEmpty)
@ -251,28 +261,41 @@ class GradeGraphState extends State<GradeGraph> {
preventCurveOverShooting: false, preventCurveOverShooting: false,
spots: ghostSpots, spots: ghostSpots,
isCurved: true, isCurved: true,
colors: [AppColors.of(context).text], color: AppColors.of(context).text,
barWidth: 6, barWidth: 6,
curveSmoothness: 0.2, curveSmoothness: 0.2,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData(show: false), dotData: const FlDotData(show: false),
belowBarData: BarAreaData( belowBarData: BarAreaData(
show: true, show: true,
colors: [ gradient: LinearGradient(
AppColors.of(context).text.withOpacity(0.7), begin: Alignment.topCenter,
AppColors.of(context).text.withOpacity(0.3), end: Alignment.bottomCenter,
AppColors.of(context).text.withOpacity(0.2), colors: [
AppColors.of(context).text.withOpacity(0.1), AppColors.of(context)
], .text
gradientColorStops: [0.1, 0.6, 0.8, 1], .withOpacity(0.7),
gradientFrom: const Offset(0, 0), AppColors.of(context)
gradientTo: const Offset(0, 1), .text
.withOpacity(0.3),
AppColors.of(context)
.text
.withOpacity(0.2),
AppColors.of(context)
.text
.withOpacity(0.1),
],
stops: const [0.1, 0.6, 0.8, 1],
),
// gradientColorStops: [0.1, 0.6, 0.8, 1],
// gradientFrom: const Offset(0, 0),
// gradientTo: const Offset(0, 1),
), ),
), ),
], ],
minY: 1, minY: 1,
maxY: 5, maxY: 5,
gridData: FlGridData( gridData: const FlGridData(
show: true, show: true,
horizontalInterval: 1, horizontalInterval: 1,
// checkToShowVerticalLine: (_) => false, // checkToShowVerticalLine: (_) => false,
@ -286,8 +309,8 @@ class GradeGraphState extends State<GradeGraph> {
// ), // ),
), ),
lineTouchData: LineTouchData( lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData( touchTooltipData: const LineTouchTooltipData(
tooltipBgColor: Colors.grey.shade800, // tooltipBgColor: Colors.grey.shade800,
fitInsideVertically: true, fitInsideVertically: true,
fitInsideHorizontally: true, fitInsideHorizontally: true,
), ),
@ -321,64 +344,112 @@ class GradeGraphState extends State<GradeGraph> {
), ),
), ),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: AxisTitles(
showTitles: true, sideTitles: SideTitles(
reservedSize: 24, showTitles: true,
getTextStyles: (context, value) => TextStyle( reservedSize: 24,
color: getTitlesWidget: (value, meta) {
AppColors.of(context).text.withOpacity(.75), if (value == meta.max || value == meta.min) {
fontWeight: FontWeight.bold, return Container();
fontSize: 14.0, }
),
margin: 12.0,
getTitles: (value) {
var format = DateFormat(
"MMM", I18n.of(context).locale.toString());
String title = format var format = DateFormat("MMM",
.format(DateTime(0, value.floor() % 12)) I18n.of(context).locale.toString());
.replaceAll(".", "");
title =
title.substring(0, min(title.length, 4));
return title.toUpperCase(); String title = format
}, .format(DateTime(0, value.floor() % 12))
interval: () { .replaceAll(".", "");
List<Grade> tData = title =
ghostData.isNotEmpty ? ghostData : data; title.substring(0, min(title.length, 4));
tData.sort((a, b) =>
a.writeDate.compareTo(b.writeDate)); return Padding(
return ghostData.isNotEmpty padding: const EdgeInsets.all(12.0),
? 3.0 child: Text(
: tData.first.writeDate title.toUpperCase(),
.add(const Duration(days: 120)) style: TextStyle(
.isBefore(tData.last.writeDate) color: AppColors.of(context)
? 2.0 .text
: 2.5; .withOpacity(.75),
}(), fontWeight: FontWeight.bold,
checkToShowTitle: (double minValue, fontSize: 14.0,
double maxValue, ),
SideTitles sideTitles, ),
double appliedInterval, );
double value) { },
if (value == maxValue || value == minValue) { // getTextStyles: (context, value) => TextStyle(
return false; // color: AppColors.of(context)
} // .text
return true; // .withOpacity(.75),
}, // fontWeight: FontWeight.bold,
), // fontSize: 14.0,
leftTitles: SideTitles( // ),
showTitles: true, // margin: 12.0,
interval: 1.0, // getTitles: (value) {
getTextStyles: (context, value) => TextStyle( // var format = DateFormat("MMM",
color: AppColors.of(context).text, // I18n.of(context).locale.toString());
fontWeight: FontWeight.bold,
fontSize: 18.0, // String title = format
// .format(DateTime(0, value.floor() % 12))
// .replaceAll(".", "");
// title =
// title.substring(0, min(title.length, 4));
// return title.toUpperCase();
// },
interval: () {
List<Grade> tData =
ghostData.isNotEmpty ? ghostData : data;
tData.sort((a, b) =>
a.writeDate.compareTo(b.writeDate));
return ghostData.isNotEmpty
? 3.0
: tData.first.writeDate
.add(const Duration(days: 120))
.isBefore(tData.last.writeDate)
? 2.0
: 2.5;
}(),
// checkToShowTitle: (double minValue,
// double maxValue,
// SideTitles sideTitles,
// double appliedInterval,
// double value) {
// if (value == maxValue || value == minValue) {
// return false;
// }
// return true;
// },
), ),
margin: 16,
), ),
rightTitles: SideTitles(showTitles: false), leftTitles: AxisTitles(
topTitles: SideTitles(showTitles: false), sideTitles: SideTitles(
showTitles: true,
interval: 1.0,
getTitlesWidget: (value, meta) => Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
value.toInt().toString(),
style: TextStyle(
color: AppColors.of(context).text,
fontWeight: FontWeight.bold,
fontSize: 18.0,
),
),
),
// getTextStyles: (context, value) => TextStyle(
// color: AppColors.of(context).text,
// fontWeight: FontWeight.bold,
// fontSize: 18.0,
// ),
// margin: 16,
),
),
rightTitles: const AxisTitles(
sideTitles: SideTitles(showTitles: false),
),
topTitles: const AxisTitles(
sideTitles: SideTitles(showTitles: false),
),
), ),
), ),
), ),

View File

@ -21,7 +21,7 @@ dependencies:
flutter_feather_icons: ^2.0.0+1 flutter_feather_icons: ^2.0.0+1
provider: ^6.1.1 provider: ^6.1.1
fl_chart: ^0.45.1 fl_chart: ^0.68.0
url_launcher: ^6.2.5 url_launcher: ^6.2.5
flutter_material_color_picker: ^1.1.0+2 flutter_material_color_picker: ^1.1.0+2
photo_view: ^0.14.0 photo_view: ^0.14.0
@ -41,7 +41,7 @@ dependencies:
flutter_svg: ^2.0.10+1 flutter_svg: ^2.0.10+1
background_fetch: ^1.2.2 background_fetch: ^1.2.2
wtf_sliding_sheet: ^1.0.0 wtf_sliding_sheet: ^1.0.0
package_info_plus: ^5.0.1 package_info_plus: ^8.0.0
dotted_border: ^2.0.0+3 dotted_border: ^2.0.0+3
screenshot: ^3.0.0 screenshot: ^3.0.0
image_gallery_saver: ^2.0.2 image_gallery_saver: ^2.0.2
@ -55,7 +55,7 @@ dependencies:
auto_size_text: ^3.0.0 auto_size_text: ^3.0.0
connectivity_plus: ^5.0.2 connectivity_plus: ^5.0.2
collection: ^1.18.0 collection: ^1.18.0
share_plus: ^7.2.2 share_plus: ^9.0.0
image_picker: ^1.0.7 image_picker: ^1.0.7
path_provider: ^2.1.2 path_provider: ^2.1.2
image_crop: image_crop:

@ -1 +1 @@
Subproject commit 44edca7b5ed645648cc36a8d33d5c376c40120b1 Subproject commit 8af545b5a39bfbfc25c5f2a383dcdfada018cd75