Skip to content

Commit e185fec

Browse files
committed
update changes
1 parent 452d447 commit e185fec

18 files changed

+1144
-473
lines changed

android/app/src/main/AndroidManifest.xml

+24
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,28 @@
2929
android:name="flutterEmbedding"
3030
android:value="2" />
3131
</application>
32+
33+
<queries>
34+
<!-- If your app opens https URLs -->
35+
<intent>
36+
<action android:name="android.intent.action.VIEW" />
37+
<data android:scheme="https" />
38+
</intent>
39+
<!-- If your app makes calls -->
40+
<intent>
41+
<action android:name="android.intent.action.DIAL" />
42+
<data android:scheme="tel" />
43+
</intent>
44+
<!-- If your sends SMS messages -->
45+
<intent>
46+
<action android:name="android.intent.action.SENDTO" />
47+
<data android:scheme="smsto" />
48+
</intent>
49+
<!-- If your app sends emails -->
50+
<intent>
51+
<action android:name="android.intent.action.SEND" />
52+
<data android:mimeType="*/*" />
53+
</intent>
54+
</queries>
55+
3256
</manifest>

assets/ingredients.png

2.81 KB
Loading

assets/wishlist.png

12.4 KB
Loading

lib/constants/app_themes.dart

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AppThemes {
1313
),
1414
dialogBackgroundColor: lightBGColor,
1515
popupMenuTheme: const PopupMenuThemeData(
16-
color: lightBGColor,
16+
color: lightColor,
1717
),
1818
elevatedButtonTheme: ElevatedButtonThemeData(
1919
style: ButtonStyle(
@@ -25,6 +25,9 @@ class AppThemes {
2525
foregroundColor: MaterialStateProperty.all(darkColor),
2626
),
2727
),
28+
appBarTheme: const AppBarTheme(
29+
backgroundColor: lightColor,
30+
),
2831
textTheme: const TextTheme(
2932
bodyText1: TextStyle(color: darkColor),
3033
bodyText2: TextStyle(color: darkColor),
@@ -63,6 +66,9 @@ class AppThemes {
6366
foregroundColor: MaterialStateProperty.all(lightColor),
6467
),
6568
),
69+
appBarTheme: const AppBarTheme(
70+
backgroundColor: darkColor,
71+
),
6672
textTheme: const TextTheme(
6773
bodyText1: TextStyle(color: lightColor),
6874
bodyText2: TextStyle(color: lightColor),

lib/main.dart

+4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import 'package:grocery_list_maker/constants/colors.dart';
77
import 'package:grocery_list_maker/constants/strings.dart';
88
import 'package:grocery_list_maker/providers/grocery_provider.dart';
99
import 'package:grocery_list_maker/views/home.dart';
10+
import 'package:package_info_plus/package_info_plus.dart';
1011
import 'package:tekartik_app_flutter_sqflite/sqflite.dart';
1112

1213
import 'app_platform/app_platform.dart';
1314

1415
late GroceryProvider groceryProvider;
16+
late PackageInfo packageInfo;
1517

1618
void main() async {
1719
WidgetsFlutterBinding.ensureInitialized();
@@ -27,6 +29,8 @@ void main() async {
2729
groceryProvider = GroceryProvider(databaseFactory);
2830
await groceryProvider.ready;
2931

32+
packageInfo = await PackageInfo.fromPlatform();
33+
3034
runApp(const MyApp());
3135
}
3236

lib/models/grocery_list.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import 'package:grocery_list_maker/models/constant.dart';
44

55
class GroceryList extends DbRecord {
66
final title = CvField<String>(columnTitle);
7-
final description = CvField<String>(columnDescription);
87
final addedAt = CvField<String>(columnAddedAt);
98

109
@override
11-
List<CvField<dynamic>> get fields => [id, title, description, addedAt];
10+
List<CvField<dynamic>> get fields => [id, title, addedAt];
1211
}

lib/providers/grocery_provider.dart

+9-4
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class GroceryProvider {
102102
'$columnListId INTEGER, $columnAddedAt TEXT)');
103103
await db.execute(
104104
'CREATE TABLE $tableGroceryLists($columnId INTEGER PRIMARY KEY, '
105-
'$columnTitle TEXT, $columnDescription TEXT, $columnAddedAt DATE)');
105+
'$columnTitle TEXT, $columnAddedAt TEXT)');
106106
await db.execute(
107107
'CREATE INDEX ItemAddedAt ON $tableGroceryItems ($columnAddedAt)');
108108
await db.execute(
@@ -144,11 +144,11 @@ class GroceryProvider {
144144
columns: [
145145
columnId,
146146
columnTitle,
147-
columnDescription,
148147
columnAddedAt,
149148
],
150149
where: '$columnId = ?',
151150
whereArgs: <Object?>[id],
151+
orderBy: '$columnAddedAt DESC',
152152
));
153153

154154
if (list.isNotEmpty) {
@@ -342,7 +342,8 @@ class GroceryProvider {
342342
],
343343
where: '$columnListId = ?',
344344
whereArgs: <Object?>[listId],
345-
orderBy: '$columnAddedAt ${(descending ?? false) ? 'ASC' : 'DESC'}',
345+
// orderBy: '$columnTitle ${(descending ?? false) ? 'ASC' : 'DESC'}',
346+
orderBy: columnTitle,
346347
limit: limit,
347348
offset: offset,
348349
));
@@ -371,7 +372,11 @@ class GroceryProvider {
371372
{int? offset, int? limit, bool? descending}) async {
372373
var list = (await db!.query(
373374
tableGroceryLists,
374-
columns: [columnId, columnTitle, columnDescription, columnAddedAt],
375+
columns: [
376+
columnId,
377+
columnTitle,
378+
columnAddedAt,
379+
],
375380
orderBy: '$columnAddedAt ${(descending ?? false) ? 'ASC' : 'DESC'}',
376381
limit: limit,
377382
offset: offset,

0 commit comments

Comments
 (0)