Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ if (flutterVersionName == null) {

android {
namespace "com.bites.bites"
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 33
ndkVersion flutter.ndkVersion

compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Expand All @@ -46,6 +47,7 @@ android {
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}

buildTypes {
Expand All @@ -61,4 +63,6 @@ flutter {
source '../..'
}

dependencies {}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}
25 changes: 25 additions & 0 deletions lib/screens/options_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:bites/utils/suggestions_switch.dart';
import 'package:bites/utils/theme_switch.dart';
import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:heroicons/heroicons.dart';
import 'package:provider/provider.dart';

Expand Down Expand Up @@ -86,6 +87,20 @@ class _OptionsPageState extends State<OptionsPage> {
);
}

void _displayNotification() async {
const AndroidNotificationDetails androidNotificationDetails =
AndroidNotificationDetails('your channel id', 'your channel name',
channelDescription: 'your channel description',
importance: Importance.max,
priority: Priority.high,
ticker: 'ticker');
const NotificationDetails notificationDetails =
NotificationDetails(android: androidNotificationDetails);
await FlutterLocalNotificationsPlugin().show(
0, 'plain title', 'plain body', notificationDetails,
payload: 'item x');
}

@override
Widget build(BuildContext context) {
// show a placeholder page where settings will go
Expand Down Expand Up @@ -210,6 +225,16 @@ class _OptionsPageState extends State<OptionsPage> {
icon: const HeroIcon(HeroIcons.rocketLaunch),
label: const Text("Start to promote your business"),
),
const SizedBox(height: 16.0),
Text(
"Developer options",
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(height: 16.0),
FilledButton.tonal(
onPressed: _displayNotification,
child: const Text("Dislay notification"),
),
],
),
),
Expand Down
40 changes: 40 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.0"
dbus:
dependency: transitive
description:
name: dbus
sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263"
url: "https://pub.dev"
source: hosted
version: "0.7.8"
dots_indicator:
dependency: "direct main"
description:
Expand Down Expand Up @@ -294,6 +302,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.1"
flutter_local_notifications:
dependency: "direct main"
description:
name: flutter_local_notifications
sha256: "0b4b849ae9c0e564cd749b74e31e134bdbb009bea2458e093926864e11a8613f"
url: "https://pub.dev"
source: hosted
version: "15.0.0"
flutter_local_notifications_linux:
dependency: transitive
description:
name: flutter_local_notifications_linux
sha256: "33f741ef47b5f63cc7f78fe75eeeac7e19f171ff3c3df054d84c1e38bedb6a03"
url: "https://pub.dev"
source: hosted
version: "4.0.0+1"
flutter_local_notifications_platform_interface:
dependency: transitive
description:
name: flutter_local_notifications_platform_interface
sha256: "7cf643d6d5022f3baed0be777b0662cce5919c0a7b86e700299f22dc4ae660ef"
url: "https://pub.dev"
source: hosted
version: "7.0.0+1"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
Expand Down Expand Up @@ -837,6 +869,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.0"
timezone:
dependency: transitive
description:
name: timezone
sha256: "1cfd8ddc2d1cfd836bc93e67b9be88c3adaeca6f40a00ca999104c30693cdca0"
url: "https://pub.dev"
source: hosted
version: "0.9.2"
typed_data:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies:
date_time_picker: ^2.1.0
logger: ^1.4.0
flutter_staggered_grid_view: ^0.6.2
flutter_local_notifications: ^15.0.0

dev_dependencies:
flutter_test:
Expand Down