Skip to content

Instantly share code, notes, and snippets.

View SteveOye's full-sized avatar

Stephen Oyebanji SteveOye

View GitHub Profile
@SteveOye
SteveOye / notification_api.dart
Last active January 26, 2023 16:15
with scheduled notifier
//import timezone plugin
import 'package:timezone/data/latest_all.dart' as timezone;
import 'package:timezone/timezone.dart' as timezone;
class NotificationApi {
static final _notification = FlutterLocalNotificationsPlugin();
static void init() {
_notification.initialize(
const InitializationSettings(
@SteveOye
SteveOye / notification_api.dart
Created January 25, 2023 23:32
initialize the flutter_local_notification plugin
class NotificationApi{
static final _notification = FlutterLocalNotificationsPlugin();
static void init() {
_notification.initialize(
const InitializationSettings(
android: AndroidInitializationSettings('@mipmap/ic_launcher'),
iOS: DarwinInitializationSettings(),
),
);
@SteveOye
SteveOye / pubspec.yaml
Last active January 25, 2023 23:18
notification with flutter
//add the plugins below dependencies
dependencies:
firebase_core: ^2.4.1
firebase_messaging: ^14.2.1
flutter_local_notifications: ^13.0.0
@SteveOye
SteveOye / issues.dart
Created October 29, 2020 14:00
issues
Performing hot restart...
Syncing files to device Redmi Note 7...
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.18.1+2/lib/firebase_auth.dart:10:8: Error: Error when reading '/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_platform_interface-2.1.1/lib/firebase_auth_platform_interface.dart': The system cannot find the path specified.
import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart';
^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.18.1+2/lib/firebase_auth.dart:15:1: Error: Error when reading '/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_platform_interface-2.1.1/lib/firebase_auth_platform_interface.dart': The system cannot find the path specified.
export 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart'
^
2020-09-11 19:59:21.676 27135-27135/com.app.mujecab E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.mujecab, PID: 27135
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equalsIgnoreCase(java.lang.String)' on a null object reference
at com.app.taxiapp.helpers.prefhandler.SharedHelper.predictionInList(SharedHelper.java:351)
at com.app.taxiapp.helpers.prefhandler.SharedHelper.addrecentSearch(SharedHelper.java:331)
at com.app.taxiapp.view.activity.SearchPlacesActivity.savePredictionsToPreference(SearchPlacesActivity.java:500)
at com.app.taxiapp.view.activity.SearchPlacesActivity.access$1000(SearchPlacesActivity.java:70)
at com.app.taxiapp.view.activity.SearchPlacesActivity$9.onClicked(SearchPlacesActivity.java:485)
at com.app.taxiapp.view.adapter.AutoCompleteAdapter$1.onClick(AutoCompleteAdapter.java:68)
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Bottom Navigation',
theme: ThemeData(primarySwatch: Colors.green),
home: Scaffold(
appBar: AppBar(
title: Text('Bottom Navigation'),
),
body: _page[_selectedPage],
@SteveOye
SteveOye / main.dart
Last active May 22, 2020 01:33
Bottom Navigation main.dart code
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
int _selectedPage = 0;
final _page = [
HomePage(),
HistoryPage(),
import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
import './history.dart';
import './home.dart';
import './profile.dart';
import './support.dart';
package com.druve.druve;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.core.view.GravityCompat;
import androidx.appcompat.app.ActionBarDrawerToggle;
import android.util.Log;