Skip to content

Commit

Permalink
updated to version 1.0.1+10
Browse files Browse the repository at this point in the history
  • Loading branch information
nixrajput committed Oct 30, 2022
1 parent 43c15fa commit 316f2b6
Show file tree
Hide file tree
Showing 32 changed files with 717 additions and 713 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ conduct, and the process for submitting pull requests to us.
- [x] Edit Item
- [x] Delete Item

## Screenshots

<img src='screenshots/1.png' height='500' alt='Screenshot 1' title='Screenshot 1'>
<img src='screenshots/2.png' height='500' alt='Screenshot 2' title='Screenshot 2'>
<img src='screenshots/3.png' height='500' alt='Screenshot 3' title='Screenshot 3'>
<img src='screenshots/4.png' height='500' alt='Screenshot 4' title='Screenshot 4'>
<img src='screenshots/5.png' height='500' alt='Screenshot 5' title='Screenshot 5'>
<img src='screenshots/6.png' height='500' alt='Screenshot 6' title='Screenshot 6'>
<img src='screenshots/7.png' height='500' alt='Screenshot 7' title='Screenshot 7'>

## License

This project is licensed under the GPL-3.0 License - see the
Expand Down
34 changes: 12 additions & 22 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,37 +1,27 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nixlab.grocery_list_maker">
xmlns:tools="http://schemas.android.com/tools" package="com.nixlab.grocery_list_maker">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon"
android:label="Grocery List Maker">

<meta-data
android:name="flutterEmbedding"
android:value="2" />

<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">

<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<application android:name="${applicationName}" android:icon="@mipmap/launcher_icon" android:label="Grocery List Maker">

<meta-data android:name="flutterEmbedding" android:value="2" />

<activity android:name=".MainActivity" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:exported="true" android:hardwareAccelerated="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:windowSoftInputMode="adjustResize">

<meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.fileProvider" android:exported="false" android:grantUriPermissions="true" tools:replace="android:authorities">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths" tools:replace="android:resource" />
</provider>

</application>

<queries>
Expand Down
11 changes: 11 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ subprojects {
project.evaluationDependsOn(':app')
}

subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
57 changes: 29 additions & 28 deletions lib/constants/app_themes.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:grocery_list_maker/constants/colors.dart';

class AppThemes {
Expand All @@ -15,6 +16,7 @@ class AppThemes {
popupMenuTheme: const PopupMenuThemeData(
color: lightColor,
),
dividerColor: Colors.grey.shade300,
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.redAccent),
Expand All @@ -28,20 +30,19 @@ class AppThemes {
appBarTheme: const AppBarTheme(
backgroundColor: lightColor,
),
textTheme: const TextTheme(
bodyText1: TextStyle(color: darkColor),
bodyText2: TextStyle(color: darkColor),
subtitle1: TextStyle(color: darkColor),
subtitle2: TextStyle(color: darkColor),
caption: TextStyle(color: darkColor),
headline1: TextStyle(color: darkColor),
headline2: TextStyle(color: darkColor),
headline3: TextStyle(color: darkColor),
headline4: TextStyle(color: darkColor),
headline5: TextStyle(color: darkColor),
headline6: TextStyle(color: darkColor),
button: TextStyle(color: darkColor),
overline: TextStyle(color: darkColor),
textTheme: TextTheme(
bodyText1: GoogleFonts.poppins(
textStyle: const TextStyle(color: darkColor),
),
bodyText2: GoogleFonts.poppins(
textStyle: const TextStyle(color: darkColor),
),
subtitle1: GoogleFonts.poppins(
textStyle: TextStyle(color: darkColor.withOpacity(0.4)),
),
subtitle2: GoogleFonts.poppins(
textStyle: TextStyle(color: darkColor.withOpacity(0.4)),
),
),
);

Expand All @@ -56,6 +57,7 @@ class AppThemes {
popupMenuTheme: const PopupMenuThemeData(
color: darkColor2,
),
dividerColor: Colors.grey.shade700,
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.redAccent),
Expand All @@ -69,20 +71,19 @@ class AppThemes {
appBarTheme: const AppBarTheme(
backgroundColor: darkColor,
),
textTheme: const TextTheme(
bodyText1: TextStyle(color: lightColor),
bodyText2: TextStyle(color: lightColor),
subtitle1: TextStyle(color: lightColor),
subtitle2: TextStyle(color: lightColor),
caption: TextStyle(color: lightColor),
headline1: TextStyle(color: lightColor),
headline2: TextStyle(color: lightColor),
headline3: TextStyle(color: lightColor),
headline4: TextStyle(color: lightColor),
headline5: TextStyle(color: lightColor),
headline6: TextStyle(color: lightColor),
button: TextStyle(color: lightColor),
overline: TextStyle(color: lightColor),
textTheme: TextTheme(
bodyText1: GoogleFonts.poppins(
textStyle: const TextStyle(color: lightColor),
),
bodyText2: GoogleFonts.poppins(
textStyle: const TextStyle(color: lightColor),
),
subtitle1: GoogleFonts.poppins(
textStyle: TextStyle(color: lightColor.withOpacity(0.4)),
),
subtitle2: GoogleFonts.poppins(
textStyle: TextStyle(color: lightColor.withOpacity(0.4)),
),
),
);
}
2 changes: 1 addition & 1 deletion lib/constants/colors.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:ui';

const Color lightColor = Color.fromRGBO(250, 250, 250, 1);
const Color lightBGColor = Color.fromRGBO(220, 220, 220, 1);
const Color lightBGColor = Color.fromRGBO(230, 230, 230, 1);
const Color darkBGColor = Color.fromRGBO(20, 20, 30, 1);
const Color darkColor = Color.fromARGB(255, 36, 36, 48);
const Color darkColor2 = Color.fromRGBO(21, 21, 36, 1.0);
Expand Down
61 changes: 61 additions & 0 deletions lib/global_widgets/custom_list_tile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import 'package:flutter/material.dart';

class CustomListTile extends StatelessWidget {
const CustomListTile({
super.key,
this.leading,
this.title,
this.subtitle,
this.trailing,
this.onTap,
this.onLongPress,
this.contentPadding,
this.backgroundColor,
});

final Widget? leading;
final Widget? title;
final Widget? subtitle;
final Widget? trailing;
final VoidCallback? onTap;
final VoidCallback? onLongPress;
final EdgeInsetsGeometry? contentPadding;
final Color? backgroundColor;

@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
onLongPress: onLongPress,
behavior: HitTestBehavior.opaque,
child: Container(
width: double.infinity,
padding: contentPadding ?? const EdgeInsets.all(12.0),
decoration: BoxDecoration(
color: backgroundColor ?? Theme.of(context).dialogBackgroundColor,
borderRadius: BorderRadius.circular(8.0),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (leading != null) leading!,
if (leading != null) const SizedBox(width: 16.0),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
if (title != null) title!,
if (subtitle != null) subtitle!,
],
),
),
if (trailing != null) trailing!,
],
),
),
);
}
}
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RepositoryProvider.value(
value: _groceryRepository,
value: GroceryRepository(),
child: MultiBlocProvider(
providers: [
BlocProvider(
Expand Down
16 changes: 16 additions & 0 deletions lib/models/grocery_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ class GroceryItem extends HiveObject {
@HiveField(6)
final DateTime updatedAt;

String get quantityOrEmpty => quantity ?? '';
String get descriptionOrEmpty => description ?? '';

String getRowDescription(int rowIndex, int itemIndex) {
switch (rowIndex) {
case 0:
return '${itemIndex + 1}.';
case 1:
return '$title\n$descriptionOrEmpty';
case 2:
return quantityOrEmpty;
default:
return '';
}
}

@override
String toString() {
return 'title: $title, createdAt: ${createdAt.toIso8601String()}, updatedAt: ${updatedAt.toIso8601String()}';
Expand Down

0 comments on commit 316f2b6

Please sign in to comment.