Skip to content

Commit

Permalink
adding more icons
Browse files Browse the repository at this point in the history
  • Loading branch information
nkitsaini committed Apr 6, 2024
1 parent 029fc8a commit 09ef81f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 119 deletions.
14 changes: 14 additions & 0 deletions lib/app_icon.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import 'package:flutter/material.dart';

const icons = {
// The key is important, this is what is stored in cache.
// So basically icons can be changed if the key remains same.
// And the app might crash if the cache has wrong key.
// So entry shouldn't be removed from here.
'photo_camera': Icons.photo_camera_outlined,
'camera': Icons.camera_outlined,
'call': Icons.call_outlined,
'music': Icons.headset_outlined,
'credit_card': Icons.credit_card_outlined,
'payments': Icons.payments_outlined,
'payment': Icons.payment_outlined,
'wb_twilight': Icons.wb_twilight_outlined,
'podcasts': Icons.podcasts_outlined,
'fitbit': Icons.fitbit,
Expand All @@ -15,6 +21,14 @@ const icons = {
'map': Icons.map_outlined,
'place': Icons.place_outlined,
'web': Icons.web_outlined,
'calendar_month': Icons.calendar_month_outlined,
'calendar_today': Icons.calendar_today_outlined,
'date_range': Icons.date_range_outlined,
'calculate': Icons.calculate_outlined,
'schedule': Icons.schedule_outlined,
'folder': Icons.folder_outlined,
'folder_open': Icons.folder_open_outlined,
'folder_copy': Icons.folder_copy,
};

String? iconDataToName(IconData icon) {
Expand Down
2 changes: 0 additions & 2 deletions lib/app_list.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import 'package:device_apps/device_apps.dart';
import 'package:cache_manager/cache_manager.dart';
// import 'package:json_serializable/builder.dart';
import 'dart:convert';

import 'package:flutter/material.dart';
// import 'package:json_serializable/json_serializable.dart';

class CacheData {
List<GridApp> grid;
Expand Down
117 changes: 0 additions & 117 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import 'package:flutter_iconpicker/flutter_iconpicker.dart';

import 'app_list.dart';

// AppListCacher appList = AppListCacher();

void main() {
runApp(const MyApp());
}
Expand Down Expand Up @@ -285,69 +283,6 @@ class IconAppGridWidget extends StatelessWidget {
});
}
}
// class AppListState extends State<AppListWidget> {
// Widget projectWidget() {
// // messageFocus.requestFocus();
// return FutureBuilder(
// initialData: const <App>[],
// builder: (context, projectSnap) {
// // messageFocus.requestFocus();
// if (projectSnap.connectionState == ConnectionState.none &&
// projectSnap.hasData == false) {
// return const Text('connection none');
// }

// if (projectSnap.data == null) {
// return const Text('data null');
// }

// List<App> apps = projectSnap.data as List<App>;

// bool isFiltered = widget.filterKey != '';
// apps.sort(
// (a, b) => a.appName.toLowerCase().compareTo(b.appName.toLowerCase()),
// );
// if (isFiltered) {
// apps = apps.reversed.toList();
// }
// apps.removeWhere((app) => !app.appName
// .toLowerCase()
// .contains(widget.filterKey.toLowerCase()));
// print('App length: ${apps.length}');
// return ListView.builder(
// reverse: isFiltered,
// itemCount: apps.length,
// itemBuilder: (context, index) {
// App app = apps[index];
// return GestureDetector(
// child: ListTile(
// title:
// Text(app.appName, style: const TextStyle(fontSize: 18.0)),
// ),
// onTap: () => {DeviceApps.openApp(app.packageName)},
// onLongPress: () {
// AndroidIntent intent = AndroidIntent(
// action: 'action_application_details_settings',
// data: 'package:${app.packageName}',
// flags: <int>[Flag.FLAG_ACTIVITY_NEW_TASK],
// );
// intent.launch();
// },
// );
// },
// );
// },
// future: appList.getAppList(),
// );
// }

// @override
// Widget build(BuildContext context) {
// return Scaffold(
// body: projectWidget(),
// );
// }
// }

enum GridIconAction { selectIcon, moveToLeft, moveToRight, remove }

Expand Down Expand Up @@ -485,58 +420,6 @@ class AppListState extends State<AppListWidget> {
);
},
);
// messageFocus.requestFocus();
// return FutureBuilder(
// initialData: const <App>[],
// builder: (context, projectSnap) {
// // messageFocus.requestFocus();
// if (projectSnap.connectionState == ConnectionState.none &&
// projectSnap.hasData == false) {
// return const Text('connection none');
// }

// if (projectSnap.data == null) {
// return const Text('data null');
// }

// List<App> apps = projectSnap.data as List<App>;

// bool isFiltered = widget.filterKey != '';
// apps.sort(
// (a, b) => a.appName.toLowerCase().compareTo(b.appName.toLowerCase()),
// );
// if (isFiltered) {
// apps = apps.reversed.toList();
// }
// apps.removeWhere((app) => !app.appName
// .toLowerCase()
// .contains(widget.filterKey.toLowerCase()));
// print('App length: ${apps.length}');
// return ListView.builder(
// reverse: isFiltered,
// itemCount: apps.length,
// itemBuilder: (context, index) {
// App app = apps[index];
// return GestureDetector(
// child: ListTile(
// title:
// Text(app.appName, style: const TextStyle(fontSize: 18.0)),
// ),
// onTap: () => {DeviceApps.openApp(app.packageName)},
// onLongPress: () {
// AndroidIntent intent = AndroidIntent(
// action: 'action_application_details_settings',
// data: 'package:${app.packageName}',
// flags: <int>[Flag.FLAG_ACTIVITY_NEW_TASK],
// );
// intent.launch();
// },
// );
// },
// );
// },
// future: appList.getAppList(),
// );
}

@override
Expand Down

0 comments on commit 09ef81f

Please sign in to comment.