Skip to content

Commit

Permalink
update changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nixrajput committed Feb 12, 2022
1 parent 452d447 commit e185fec
Show file tree
Hide file tree
Showing 18 changed files with 1,144 additions and 473 deletions.
24 changes: 24 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,28 @@
android:name="flutterEmbedding"
android:value="2" />
</application>

<queries>
<!-- If your app opens https URLs -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<!-- If your app makes calls -->
<intent>
<action android:name="android.intent.action.DIAL" />
<data android:scheme="tel" />
</intent>
<!-- If your sends SMS messages -->
<intent>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="smsto" />
</intent>
<!-- If your app sends emails -->
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
</intent>
</queries>

</manifest>
Binary file added assets/ingredients.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/wishlist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion lib/constants/app_themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AppThemes {
),
dialogBackgroundColor: lightBGColor,
popupMenuTheme: const PopupMenuThemeData(
color: lightBGColor,
color: lightColor,
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
Expand All @@ -25,6 +25,9 @@ class AppThemes {
foregroundColor: MaterialStateProperty.all(darkColor),
),
),
appBarTheme: const AppBarTheme(
backgroundColor: lightColor,
),
textTheme: const TextTheme(
bodyText1: TextStyle(color: darkColor),
bodyText2: TextStyle(color: darkColor),
Expand Down Expand Up @@ -63,6 +66,9 @@ class AppThemes {
foregroundColor: MaterialStateProperty.all(lightColor),
),
),
appBarTheme: const AppBarTheme(
backgroundColor: darkColor,
),
textTheme: const TextTheme(
bodyText1: TextStyle(color: lightColor),
bodyText2: TextStyle(color: lightColor),
Expand Down
4 changes: 4 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import 'package:grocery_list_maker/constants/colors.dart';
import 'package:grocery_list_maker/constants/strings.dart';
import 'package:grocery_list_maker/providers/grocery_provider.dart';
import 'package:grocery_list_maker/views/home.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:tekartik_app_flutter_sqflite/sqflite.dart';

import 'app_platform/app_platform.dart';

late GroceryProvider groceryProvider;
late PackageInfo packageInfo;

void main() async {
WidgetsFlutterBinding.ensureInitialized();
Expand All @@ -27,6 +29,8 @@ void main() async {
groceryProvider = GroceryProvider(databaseFactory);
await groceryProvider.ready;

packageInfo = await PackageInfo.fromPlatform();

runApp(const MyApp());
}

Expand Down
3 changes: 1 addition & 2 deletions lib/models/grocery_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import 'package:grocery_list_maker/models/constant.dart';

class GroceryList extends DbRecord {
final title = CvField<String>(columnTitle);
final description = CvField<String>(columnDescription);
final addedAt = CvField<String>(columnAddedAt);

@override
List<CvField<dynamic>> get fields => [id, title, description, addedAt];
List<CvField<dynamic>> get fields => [id, title, addedAt];
}
13 changes: 9 additions & 4 deletions lib/providers/grocery_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class GroceryProvider {
'$columnListId INTEGER, $columnAddedAt TEXT)');
await db.execute(
'CREATE TABLE $tableGroceryLists($columnId INTEGER PRIMARY KEY, '
'$columnTitle TEXT, $columnDescription TEXT, $columnAddedAt DATE)');
'$columnTitle TEXT, $columnAddedAt TEXT)');
await db.execute(
'CREATE INDEX ItemAddedAt ON $tableGroceryItems ($columnAddedAt)');
await db.execute(
Expand Down Expand Up @@ -144,11 +144,11 @@ class GroceryProvider {
columns: [
columnId,
columnTitle,
columnDescription,
columnAddedAt,
],
where: '$columnId = ?',
whereArgs: <Object?>[id],
orderBy: '$columnAddedAt DESC',
));

if (list.isNotEmpty) {
Expand Down Expand Up @@ -342,7 +342,8 @@ class GroceryProvider {
],
where: '$columnListId = ?',
whereArgs: <Object?>[listId],
orderBy: '$columnAddedAt ${(descending ?? false) ? 'ASC' : 'DESC'}',
// orderBy: '$columnTitle ${(descending ?? false) ? 'ASC' : 'DESC'}',
orderBy: columnTitle,
limit: limit,
offset: offset,
));
Expand Down Expand Up @@ -371,7 +372,11 @@ class GroceryProvider {
{int? offset, int? limit, bool? descending}) async {
var list = (await db!.query(
tableGroceryLists,
columns: [columnId, columnTitle, columnDescription, columnAddedAt],
columns: [
columnId,
columnTitle,
columnAddedAt,
],
orderBy: '$columnAddedAt ${(descending ?? false) ? 'ASC' : 'DESC'}',
limit: limit,
offset: offset,
Expand Down
Loading

0 comments on commit e185fec

Please sign in to comment.