Skip to content

Commit

Permalink
chore: remove unused files and run flutter analyze
Browse files Browse the repository at this point in the history
  • Loading branch information
sonle-geekyants committed Dec 26, 2023
1 parent 939bb9b commit 9094b7d
Show file tree
Hide file tree
Showing 131 changed files with 718 additions and 6,478 deletions.
18 changes: 1 addition & 17 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class _MyAppState extends State<MyApp> {
ChangeNotifierProvider(create: (context) => TrustedContactProvider()),
ChangeNotifierProvider(create: (context) => AddContactProvider()),
ChangeNotifierProvider(create: (context) => NestedRouteProvider()),
ChangeNotifierProvider(create: (context) => SwitchAtsignProvider()),
ChangeNotifierProvider(create: (context) => SwitchAtSignProvider()),
ChangeNotifierProvider(create: (context) => FileDownloadChecker()),
ChangeNotifierProvider(create: (context) => FileProgressProvider()),
ChangeNotifierProvider(
Expand All @@ -77,10 +77,6 @@ class _MyAppState extends State<MyApp> {
builder: (BuildContext context, Widget? child) {
final MediaQueryData data = MediaQuery.of(context);
return GestureDetector(
onVerticalDragDown: (__) {
// When running in iOS, dismiss the keyboard when when user scrolls
// if (Platform.isIOS) hideKeyboard(context);
},
child: MediaQuery(
data: data.copyWith(
textScaleFactor:
Expand All @@ -103,18 +99,6 @@ class _MyAppState extends State<MyApp> {
foregroundColor: ColorConstants.iconHeaderColor,
),
),
// theme: ThemeData(
// fontFamily: 'Poppins',
// scaffoldBackgroundColor: Colors.white,
// primaryColor: Color.fromARGB(255, 240, 94, 62),
// appBarTheme: AppBarTheme(
// color: Colors.white,
// elevation: 0,
// iconTheme: IconThemeData(color: Colors.black),
// ),
// buttonBarTheme: ButtonBarThemeData(
// alignment: MainAxisAlignment.center,
// )),
routes: routes,
),
);
Expand Down
14 changes: 0 additions & 14 deletions lib/data_models/enums/contact_filter_type.dart

This file was deleted.

24 changes: 0 additions & 24 deletions lib/data_models/enums/file_types.dart

This file was deleted.

4 changes: 0 additions & 4 deletions lib/dekstop_services/desktop_image_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ Future<List<PlatformFile>?> desktopImagePicker() async {
final XTypeGroup typeGroup = XTypeGroup();
final List<XFile> files = await openFiles(acceptedTypeGroups: [typeGroup]);

if (files == null) {
return null;
}

await Future.forEach(files, (XFile f) async {
selectedFiles.add(
PlatformFile(
Expand Down
2 changes: 1 addition & 1 deletion lib/desktop_routes/desktop_routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:atsign_atmosphere_pro/data_models/file_modal.dart';
import 'package:atsign_atmosphere_pro/desktop_routes/desktop_route_names.dart';
import 'package:atsign_atmosphere_pro/desktop_screens/desktop_download_all_files/desktop_download_all_file.dart';
import 'package:atsign_atmosphere_pro/desktop_screens/desktop_home/desktop_home.dart';
import 'package:atsign_atmosphere_pro/desktop_screens/trusted_sender/desktop_empty_trusted_sender.dart';
import 'package:atsign_atmosphere_pro/desktop_screens/trusted_sender/widgets/desktop_empty_trusted_sender.dart';
import 'package:atsign_atmosphere_pro/desktop_screens_new/contacts_screen/desktop_contact_screen.dart';
import 'package:atsign_atmosphere_pro/desktop_screens_new/groups_screen/desktop_groups_screen.dart';
import 'package:atsign_atmosphere_pro/desktop_screens_new/settings_screen/blocked_contacts.dart';
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ class DesktopCustomInputField extends StatelessWidget {

@override
Widget build(BuildContext context) {
textController = TextEditingController.fromValue(TextEditingValue(
text: initialValue != null ? initialValue : '',
selection: TextSelection.collapsed(
offset: initialValue != null ? initialValue.length : -1)));
textController = TextEditingController.fromValue(
TextEditingValue(
text: initialValue,
selection: TextSelection.collapsed(offset: initialValue.length),
),
);
return Container(
width: width.toWidth,
height: height,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,76 @@ import 'package:flutter/material.dart';
import 'package:at_common_flutter/services/size_config.dart';
import 'package:provider/provider.dart';

Widget customPersonVerticalTile(
String title, String? subTitle, Function onCancel) {
// if file is being uploaded.
bool isCancelIcon = !Provider.of<FileTransferProvider>(
NavService.navKey.currentContext!,
listen: false)
.isFileSending;
class CustomPersonVerticalTile extends StatelessWidget {
final String title;
final String? subTitle;
final Function onCancel;

return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
InkWell(
onTap: () {},
child: Stack(
children: [
ContactInitial(
initials: title,
size: 50,
maxSize: (80.0 - 30.0),
minSize: 50,
),
Positioned(
top: 0,
right: 0,
child: InkWell(
onTap: () {
if (onCancel != null) {
onCancel();
}
},
child: isCancelIcon ? Icon(Icons.cancel) : SizedBox(),
const CustomPersonVerticalTile({
required this.title,
this.subTitle,
required this.onCancel,
});

@override
Widget build(BuildContext context) {
bool isCancelIcon = !Provider.of<FileTransferProvider>(
NavService.navKey.currentContext!,
listen: false)
.isFileSending;
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
InkWell(
onTap: () {},
child: Stack(
children: [
ContactInitial(
initials: title,
size: 50,
maxSize: (80.0 - 30.0),
minSize: 50,
),
),
],
),
),
SizedBox(width: 10.toHeight),
Container(
padding: EdgeInsets.symmetric(vertical: 10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
title,
style: CustomTextStyles.desktopPrimaryRegular14,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
SizedBox(height: 5.toHeight),
subTitle != null
? Text(
subTitle,
style: CustomTextStyles.secondaryRegular12,
maxLines: 1,
overflow: TextOverflow.ellipsis,
)
: SizedBox(),
],
Positioned(
top: 0,
right: 0,
child: InkWell(
onTap: () {
onCancel.call();
},
child: isCancelIcon ? Icon(Icons.cancel) : SizedBox(),
),
),
],
),
),
)
],
);
SizedBox(width: 10.toHeight),
Container(
padding: EdgeInsets.symmetric(vertical: 10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
title,
style: CustomTextStyles.desktopPrimaryRegular14,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
SizedBox(height: 5.toHeight),
subTitle != null
? Text(
subTitle!,
style: CustomTextStyles.secondaryRegular12,
maxLines: 1,
overflow: TextOverflow.ellipsis,
)
: SizedBox(),
],
),
)
],
);
}
}
21 changes: 12 additions & 9 deletions lib/desktop_screens/desktop_common_widgets/desktop_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@ import 'package:flutter/material.dart';
class DesktopHeader extends StatelessWidget {
final String? title;
final ValueChanged<bool>? onFilter;
List<Widget>? actions;
List<String> options = [
final List<Widget>? actions;
final List<String> options = [
'By type',
'By name',
'By size',
'By date',
'add-btn'
];
bool showBackIcon, isTitleCentered;
DesktopHeader(
{this.title,
this.showBackIcon = true,
this.onFilter,
this.actions,
this.isTitleCentered = false});
final bool showBackIcon, isTitleCentered;

DesktopHeader({
this.title,
this.showBackIcon = true,
this.onFilter,
this.actions,
this.isTitleCentered = false,
});

@override
Widget build(BuildContext context) {
return Container(
Expand Down
Loading

0 comments on commit 9094b7d

Please sign in to comment.