Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Clear Up Info Messages for at_widget packages using flutter 3.23 beta channel #860

Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ec3df0e
chore: packages updated and Avoid using private types in public APIs …
CurtlyCritchlow Jun 11, 2024
6efb3ff
chore: missing dependencies added.
CurtlyCritchlow Jun 11, 2024
80fe60b
chore: invalid use of private type in public API. info message fixed.
CurtlyCritchlow Jun 11, 2024
7829bea
chore: missing dependencies added to pubspec.yaml
CurtlyCritchlow Jun 11, 2024
0456661
chore: Invalid use of a private type in a public API info message fixed.
CurtlyCritchlow Jun 11, 2024
e444a6f
chore: add missing dependency for at_event_flutter example app.
CurtlyCritchlow Jun 11, 2024
03453dc
fix: Invalid use of a private type in a public API info message fixed…
CurtlyCritchlow Jun 11, 2024
2cee068
chore: missing dependencies add to at_location_flutter
CurtlyCritchlow Jun 11, 2024
f1ce1c3
fix: invalid use of private type in public API info message fixed.
CurtlyCritchlow Jun 11, 2024
fe93d34
fix: Invalid use of private type in public API info message fixed in …
CurtlyCritchlow Jun 11, 2024
5ef656d
fix: depreciated ButtonBar replaced with OverflowBar.
CurtlyCritchlow Jun 12, 2024
599f2d4
chore: missing dependencies for example app added in at_notify_flutter
CurtlyCritchlow Jun 12, 2024
46a7745
fix: Invalid use of a private type in a public API info message fixed…
CurtlyCritchlow Jun 12, 2024
8553aa0
fix: Don't use 'BuildContext's across async gaps info message fixed i…
CurtlyCritchlow Jun 12, 2024
627dbda
chore: missing dependencies added to example app of at_sync_ui_flutter.
CurtlyCritchlow Jun 12, 2024
a786496
fix: invalid use of a private type in a public API info messages reso…
CurtlyCritchlow Jun 12, 2024
aefe6b2
fix: The 'child' argument should be last in widget constructor invoca…
CurtlyCritchlow Jun 13, 2024
c3ca5e2
fix: 'onPopInvoked' is deprecated and shouldn't be used info message …
CurtlyCritchlow Jun 13, 2024
ca3560e
fix: Don't use 'BuildContext's across async gaps info message fixed i…
CurtlyCritchlow Jun 13, 2024
bb58cb7
fix: Don't use 'BuildContext's across async gaps info message fixed i…
CurtlyCritchlow Jun 13, 2024
52c5046
fix: Don't use 'BuildContext's across async gaps info messaged in at_…
CurtlyCritchlow Jun 13, 2024
cf11eb5
fix: Don't use 'BuildContext's across async gaps in exampe app of at_…
CurtlyCritchlow Jun 13, 2024
138f418
fix: don't use 'BuildContext's across async gaps in example app of at…
CurtlyCritchlow Jun 13, 2024
e6367a1
fix: Don't use 'BuildContext's across async gaps in example app of at…
CurtlyCritchlow Jun 13, 2024
ab05d31
fix: Don't use 'BuildContext's across async gaps in at_onboarding_flu…
CurtlyCritchlow Jun 13, 2024
c9daf77
fix: reverted back to onPopInvoked since onPopInvokedWithResult is no…
CurtlyCritchlow Jun 14, 2024
aff1b75
fix: ignore: deprecated_member_use added to temporarily suppress info…
CurtlyCritchlow Jun 14, 2024
d3f4173
Merge branch 'trunk' into 859-clear-up-info-messages-from-flutter-ana…
CurtlyCritchlow Jun 14, 2024
b56e7fd
chore: updated package to 2.0.14
CurtlyCritchlow Jun 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 24 additions & 46 deletions packages/at_backupkey_flutter/lib/widgets/backup_key_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,12 @@ class BackupKeyWidget extends StatelessWidget {
width: buttonWidth ?? 158.toWidth,
height: buttonHeight ?? (50.toHeight),
padding: EdgeInsets.symmetric(horizontal: 10.toWidth),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.toWidth),
color: buttonColor ?? Colors.black),
decoration:
BoxDecoration(borderRadius: BorderRadius.circular(30.toWidth), color: buttonColor ?? Colors.black),
child: Center(
child: Text(buttonText!,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.toFont,
color: Colors.white,
fontWeight: FontWeight.bold)),
style: TextStyle(fontSize: 16.toFont, color: Colors.white, fontWeight: FontWeight.bold)),
),
),
)
Expand All @@ -107,16 +103,14 @@ class BackupKeyWidget extends StatelessWidget {
children: [
Text(
'Error',
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 14.toFont),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.toFont),
),
Icon(Icons.sentiment_dissatisfied, size: 25.toFont)
],
),
content: Text(
'Could not backup the key file',
style:
TextStyle(fontWeight: FontWeight.bold, fontSize: 14.toFont),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.toFont),
),
actions: <Widget>[
TextButton(
Expand All @@ -142,10 +136,7 @@ class BackupKeyWidget extends StatelessWidget {
return Dialog(
child: Container(
padding: const EdgeInsets.all(20),
width:
(Platform.isMacOS || Platform.isWindows || Platform.isLinux)
? 600
: null,
width: (Platform.isMacOS || Platform.isWindows || Platform.isLinux) ? 600 : null,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Expand All @@ -161,8 +152,7 @@ class BackupKeyWidget extends StatelessWidget {
'PLEASE SECURELY SAVE YOUR KEYS. WE DO NOT HAVE ACCESS TO THEM AND CANNOT CREATE A BACKUP OR RESET THEM.',
targetShapeBorder: const CircleBorder(),
disableMovingAnimation: true,
targetBorderRadius:
const BorderRadius.all(Radius.circular(40)),
targetBorderRadius: const BorderRadius.all(Radius.circular(40)),
showArrow: false,
targetPadding: const EdgeInsets.all(5),
blurValue: 2,
Expand All @@ -182,9 +172,8 @@ class BackupKeyWidget extends StatelessWidget {
ShowCaseWidget.of(myContext!).startShowCase([key]);
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey.shade400,
borderRadius: BorderRadius.circular(50)),
decoration:
BoxDecoration(color: Colors.grey.shade400, borderRadius: BorderRadius.circular(50)),
margin: const EdgeInsets.all(0),
height: 20,
width: 20,
Expand All @@ -210,9 +199,8 @@ class BackupKeyWidget extends StatelessWidget {
Row(
children: [
TextButton(
child: const Text(Strings.backButtonTitle,
style:
TextStyle(fontWeight: FontWeight.bold)),
child:
const Text(Strings.backButtonTitle, style: TextStyle(fontWeight: FontWeight.bold)),
onPressed: () async {
var result = await onBackup(context);
if (context.mounted) {
Expand All @@ -224,8 +212,7 @@ class BackupKeyWidget extends StatelessWidget {
}),
const Spacer(),
TextButton(
child: const Text(Strings.cancelButtonTitle,
style: TextStyle()),
child: const Text(Strings.cancelButtonTitle, style: TextStyle()),
onPressed: () {
Navigator.pop(context);
})
Expand Down Expand Up @@ -276,20 +263,17 @@ class BackupKeyWidget extends StatelessWidget {

String? dir = await getDownloadPath();
if (dir != null) {
String newPath =
"$dir/$atsign${Strings.backupKeyName}";
String newPath = "$dir/$atsign${Strings.backupKeyName}";
debugPrint(newPath);

try {
if (await File(newPath).exists()) {
if (context.mounted) {
Navigator.of(context).pop();
showSnackBar(
context: context, content: "File exists!");
showSnackBar(context: context, content: "File exists!");
}
} else {
final encryptedKeysFile =
await File(newPath).create();
final encryptedKeysFile = await File(newPath).create();
var keyString = jsonEncode(aesEncryptedKeys);
encryptedKeysFile.writeAsStringSync(keyString);
if (context.mounted) {
Expand Down Expand Up @@ -339,18 +323,15 @@ class BackupKeyWidget extends StatelessWidget {
var size = MediaQuery.of(context).size;
await Share.shareXFiles(
[XFile(tempFilePath)],
sharePositionOrigin:
Rect.fromLTWH(0, 0, size.width, size.height / 2),
sharePositionOrigin: Rect.fromLTWH(0, 0, size.width, size.height / 2),
).then((ShareResult shareResult) {
if (shareResult.status == ShareResultStatus.success) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('File saved successfully')));
if (shareResult.status == ShareResultStatus.success && context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('File saved successfully')));
}
});
}
} else {
final path = await getSaveLocation(
suggestedName: '$atsign${Strings.backupKeyName}');
final path = await getSaveLocation(suggestedName: '$atsign${Strings.backupKeyName}');
if (path == null) return;
final file = XFile(tempFilePath);
await file.saveTo(path.path);
Expand All @@ -377,8 +358,7 @@ class BackupKeyWidget extends StatelessWidget {

var directory = await path_provider.getApplicationSupportDirectory();
String path = directory.path.toString() + Platform.pathSeparator;
final encryptedKeysFile =
await File('$path$atsign${Strings.backupKeyName}').create();
final encryptedKeysFile = await File('$path$atsign${Strings.backupKeyName}').create();
var keyString = jsonEncode(aesEncryptedKeys);
encryptedKeysFile.writeAsStringSync(keyString);
return encryptedKeysFile.path;
Expand All @@ -387,9 +367,8 @@ class BackupKeyWidget extends StatelessWidget {
var keyString = jsonEncode(aesEncryptedKeys);
final List<int> codeUnits = keyString.codeUnits;
final Uint8List data = Uint8List.fromList(codeUnits);
String desktopPath = await FileSaver.instance.saveFile(
encryptedKeysFile, data, Strings.backupKeyExtension,
mimeType: MimeType.OTHER);
String desktopPath = await FileSaver.instance
.saveFile(encryptedKeysFile, data, Strings.backupKeyExtension, mimeType: MimeType.OTHER);
return desktopPath;
}
}
Expand All @@ -403,9 +382,8 @@ class BackupKeyWidget extends StatelessWidget {
[XFile(path)],
sharePositionOrigin: Rect.fromLTWH(0, 0, size.width, size.height / 2),
).then((ShareResult shareResult) {
if (shareResult.status == ShareResultStatus.success) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('File saved successfully')));
if (shareResult.status == ShareResultStatus.success && context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('File saved successfully')));
}
});
}
Expand Down
33 changes: 10 additions & 23 deletions packages/at_common_flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import 'dart:async';
import 'dart:developer';

import 'package:at_common_flutter/at_common_flutter.dart';
import 'package:at_common_flutter/utils/text_styles.dart';
import 'package:flutter/material.dart';
import 'package:at_common_flutter/at_common_flutter.dart';

final StreamController<ThemeMode> updateThemeMode =
StreamController<ThemeMode>.broadcast();
final StreamController<ThemeMode> updateThemeMode = StreamController<ThemeMode>.broadcast();

void main() {
runApp(const MyApp());
Expand Down Expand Up @@ -57,7 +56,7 @@ class MyHomePage extends StatefulWidget {
final String? title;

@override
_MyHomePageState createState() => _MyHomePageState();
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
Expand All @@ -77,16 +76,12 @@ class _MyHomePageState extends State<MyHomePage> {
showTitle: true,
titleText: widget.title,
titleTextStyle: CustomTextStyles.primaryBold18.copyWith(
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
color: Theme.of(context).brightness == Brightness.light ? Colors.black : Colors.white,
),
showLeadingIcon: true,
leadingIcon: Icon(
Icons.home_outlined,
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
color: Theme.of(context).brightness == Brightness.light ? Colors.black : Colors.white,
),
onTrailingIconPressed: () {
log('Trailing icon of appbar pressed');
Expand All @@ -95,15 +90,11 @@ class _MyHomePageState extends State<MyHomePage> {
trailingIcon: Center(
child: IconButton(
onPressed: () {
updateThemeMode.sink.add(
Theme.of(context).brightness == Brightness.light
? ThemeMode.dark
: ThemeMode.light);
updateThemeMode.sink
.add(Theme.of(context).brightness == Brightness.light ? ThemeMode.dark : ThemeMode.light);
},
icon: Icon(
Theme.of(context).brightness == Brightness.light
? Icons.dark_mode_outlined
: Icons.light_mode_outlined,
Theme.of(context).brightness == Brightness.light ? Icons.dark_mode_outlined : Icons.light_mode_outlined,
color: Theme.of(context).colorScheme.secondary,
),
),
Expand Down Expand Up @@ -161,12 +152,8 @@ class _MyHomePageState extends State<MyHomePage> {
onPressed: () {
log('Custom button pressed');
},
buttonColor: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
fontColor: Theme.of(context).brightness == Brightness.light
? Colors.white
: Colors.black,
buttonColor: Theme.of(context).brightness == Brightness.light ? Colors.black : Colors.white,
fontColor: Theme.of(context).brightness == Brightness.light ? Colors.white : Colors.black,
),
],
),
Expand Down
2 changes: 1 addition & 1 deletion packages/at_common_flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies:
# 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: ^1.0.0
flutter_lints: ^2.0.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not 4.0.0 here?



# For information on the generic Dart part of this file, see the
Expand Down
4 changes: 2 additions & 2 deletions packages/at_common_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.1
mocktail: ^0.3.0
flutter_lints: ^4.0.0
mocktail: ^1.0.3


# For information on the generic Dart part of this file, see the
Expand Down
Loading