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(),
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: averageColors.reversed.toList(), 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,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [ colors: [
averageColor.withOpacity(0.7), averageColor.withOpacity(0.7),
averageColor.withOpacity(0.3), averageColor.withOpacity(0.3),
averageColor.withOpacity(0.2), averageColor.withOpacity(0.2),
averageColor.withOpacity(0.1), averageColor.withOpacity(0.1),
], ],
gradientColorStops: [0.1, 0.6, 0.8, 1], stops: const [0.1, 0.6, 0.8, 1],
gradientFrom: const Offset(0, 0), ),
gradientTo: const Offset(0, 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,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [ colors: [
AppColors.of(context).text.withOpacity(0.7), AppColors.of(context)
AppColors.of(context).text.withOpacity(0.3), .text
AppColors.of(context).text.withOpacity(0.2), .withOpacity(0.7),
AppColors.of(context).text.withOpacity(0.1), AppColors.of(context)
.text
.withOpacity(0.3),
AppColors.of(context)
.text
.withOpacity(0.2),
AppColors.of(context)
.text
.withOpacity(0.1),
], ],
gradientColorStops: [0.1, 0.6, 0.8, 1], stops: const [0.1, 0.6, 0.8, 1],
gradientFrom: const Offset(0, 0), ),
gradientTo: const Offset(0, 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,19 +344,17 @@ class GradeGraphState extends State<GradeGraph> {
), ),
), ),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true, showTitles: true,
reservedSize: 24, reservedSize: 24,
getTextStyles: (context, value) => TextStyle( getTitlesWidget: (value, meta) {
color: if (value == meta.max || value == meta.min) {
AppColors.of(context).text.withOpacity(.75), return Container();
fontWeight: FontWeight.bold, }
fontSize: 14.0,
), var format = DateFormat("MMM",
margin: 12.0, I18n.of(context).locale.toString());
getTitles: (value) {
var format = DateFormat(
"MMM", I18n.of(context).locale.toString());
String title = format String title = format
.format(DateTime(0, value.floor() % 12)) .format(DateTime(0, value.floor() % 12))
@ -341,8 +362,40 @@ class GradeGraphState extends State<GradeGraph> {
title = title =
title.substring(0, min(title.length, 4)); title.substring(0, min(title.length, 4));
return title.toUpperCase(); return Padding(
padding: const EdgeInsets.all(12.0),
child: Text(
title.toUpperCase(),
style: TextStyle(
color: AppColors.of(context)
.text
.withOpacity(.75),
fontWeight: FontWeight.bold,
fontSize: 14.0,
),
),
);
}, },
// getTextStyles: (context, value) => TextStyle(
// color: AppColors.of(context)
// .text
// .withOpacity(.75),
// fontWeight: FontWeight.bold,
// fontSize: 14.0,
// ),
// margin: 12.0,
// getTitles: (value) {
// var format = DateFormat("MMM",
// I18n.of(context).locale.toString());
// String title = format
// .format(DateTime(0, value.floor() % 12))
// .replaceAll(".", "");
// title =
// title.substring(0, min(title.length, 4));
// return title.toUpperCase();
// },
interval: () { interval: () {
List<Grade> tData = List<Grade> tData =
ghostData.isNotEmpty ? ghostData : data; ghostData.isNotEmpty ? ghostData : data;
@ -356,29 +409,47 @@ class GradeGraphState extends State<GradeGraph> {
? 2.0 ? 2.0
: 2.5; : 2.5;
}(), }(),
checkToShowTitle: (double minValue, // checkToShowTitle: (double minValue,
double maxValue, // double maxValue,
SideTitles sideTitles, // SideTitles sideTitles,
double appliedInterval, // double appliedInterval,
double value) { // double value) {
if (value == maxValue || value == minValue) { // if (value == maxValue || value == minValue) {
return false; // return false;
} // }
return true; // return true;
}, // },
), ),
leftTitles: SideTitles( ),
leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true, showTitles: true,
interval: 1.0, interval: 1.0,
getTextStyles: (context, value) => TextStyle( getTitlesWidget: (value, meta) => Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
value.toInt().toString(),
style: TextStyle(
color: AppColors.of(context).text, color: AppColors.of(context).text,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 18.0, fontSize: 18.0,
), ),
margin: 16,
), ),
rightTitles: SideTitles(showTitles: false), ),
topTitles: SideTitles(showTitles: false), // 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