Skip to content

Commit

Permalink
Pull request #48: aboldyrev MM-5070 lint
Browse files Browse the repository at this point in the history
Merge in MML/infobip-mobile-messaging-flutter from aboldyrev-MM-5070-lint to main

Squashed commit of the following:

commit 1dec18e0be6194c95447d2bc52bc44a3a07299f8
Author: Alexander Boldyrev <[email protected]>
Date:   Fri Jun 9 18:39:28 2023 +0200

    - versions fixed

commit 90285d178ed4a3994cd201ca7ae8613ee94a2929
Author: Alexander Boldyrev <[email protected]>
Date:   Fri Jun 9 17:26:50 2023 +0200

    - dependencies

commit 1fd6ce442c2c58d4cff4cba27aff9a069ef01f15
Author: Alexander Boldyrev <[email protected]>
Date:   Fri Jun 9 16:17:21 2023 +0200

    - flutter version defined

commit 2695d279a8fd2e63ab26017b8a26bf81505db767
Author: Alexander Boldyrev <[email protected]>
Date:   Fri Jun 9 15:09:50 2023 +0200

    - lint rules
    - filenames
  • Loading branch information
alboldy-ib committed Jun 9, 2023
1 parent 6173c77 commit 9912eb7
Show file tree
Hide file tree
Showing 22 changed files with 148 additions and 202 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The document describes plugin integration steps for your Flutter project.
* [Quick start guide](#quick-start-guide)

## Requirements
- Flutter 2.12+
- Flutter 3.3.0+

For iOS project:
- Xcode 13.4.1
Expand Down Expand Up @@ -102,8 +102,8 @@ This guide is designed to get you up and running with Mobile Messaging SDK plugi
4. Use plugin in your Dart code:
```dart
import 'package:infobip_mobilemessaging/infobip_mobilemessaging.dart';
import 'package:infobip_mobilemessaging/models/Configuration.dart';
import 'package:infobip_mobilemessaging/models/LibraryEvent.dart';
import 'package:infobip_mobilemessaging/models/configuration.dart';
import 'package:infobip_mobilemessaging/models/library_event.dart';
...
Expand Down
2 changes: 2 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ linter:
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
constant_identifier_names:
ignore_for_file: installation.dart
directives_ordering: true
prefer_relative_imports: true
prefer_expression_function_bodies: true
Expand Down
1 change: 1 addition & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
analyzer:
exclude: [lib/**, test/**.dart]
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
Expand Down
32 changes: 16 additions & 16 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import 'dart:io';

import 'package:flutter/material.dart';
import 'package:infobip_mobilemessaging/infobip_mobilemessaging.dart';
import 'package:infobip_mobilemessaging/models/Configuration.dart' as mmconfiguration;
import 'package:infobip_mobilemessaging/models/IOSChatSettings.dart';
import 'package:infobip_mobilemessaging/models/Installation.dart';
import 'package:infobip_mobilemessaging/models/LibraryEvent.dart';
import 'package:infobip_mobilemessaging/models/Message.dart';
import 'package:infobip_mobilemessaging/models/UserData.dart';
import 'package:infobip_mobilemessaging/models/configuration.dart' as mmconfiguration;
import 'package:infobip_mobilemessaging/models/installation.dart';
import 'package:infobip_mobilemessaging/models/ios_chat_settings.dart';
import 'package:infobip_mobilemessaging/models/library_event.dart';
import 'package:infobip_mobilemessaging/models/message.dart';
import 'package:infobip_mobilemessaging/models/user_data.dart';

import 'language.dart';
import 'screen_one.dart';
Expand Down Expand Up @@ -92,57 +92,57 @@ class _MyAppState extends State<MyApp> {
navigationBarTitleColor: '#000000',
));

InfobipMobilemessaging.on(LibraryEvent.TOKEN_RECEIVED, (String token) {
InfobipMobilemessaging.on(LibraryEvent.tokenReceived, (String token) {
log('Callback. TOKEN_RECEIVED event: $token');
_HomePageState.addLibraryEvent('Token Received');
});
InfobipMobilemessaging.on(
LibraryEvent.MESSAGE_RECEIVED,
LibraryEvent.messageReceived,
(Message message) => {
log('Callback. MESSAGE_RECEIVED event, message title: ${message.title} body: ${message.body}'),
_HomePageState.addLibraryEvent('Message Received'),
log('defaultMessageStorage().findAll():'),
log(InfobipMobilemessaging.defaultMessageStorage().findAll().toString())
});
InfobipMobilemessaging.on(
LibraryEvent.USER_UPDATED,
LibraryEvent.userUpdated,
(UserData userData) => {
log('Callback. USER_UPDATED event: $userData'),
_HomePageState.addLibraryEvent('User Updated')
});
InfobipMobilemessaging.on(
LibraryEvent.PERSONALIZED,
LibraryEvent.personalized,
(event) => {
log('Callback. PERSONALIZED event: $event'),
_HomePageState.addLibraryEvent('Personalized')
});
InfobipMobilemessaging.on(
LibraryEvent.INSTALLATION_UPDATED,
LibraryEvent.installationUpdated,
(String event) => {
log('Callback. INSTALLATION_UPDATED event: $event'),
_HomePageState.addLibraryEvent('Installation Updated')
});
InfobipMobilemessaging.on(
LibraryEvent.DEPERSONALIZED,
LibraryEvent.depersonalized,
(event) => {
log('Callback. DEPERSONALIZED event: $event'),
_HomePageState.addLibraryEvent('Depersonalized')
});
InfobipMobilemessaging.on(
LibraryEvent.NOTIFICATION_ACTION_TAPPED,
LibraryEvent.actionTapped,
(event) => {
log('Callback. NOTIFICATION_ACTION_TAPPED event: $event'),
_HomePageState.addLibraryEvent('Notification Action Tapped')
});
InfobipMobilemessaging.on(
LibraryEvent.NOTIFICATION_TAPPED,
LibraryEvent.notificationTapped,
(Message message) => {
log('Callback. NOTIFICATION_TAPPED event: $message'),
_HomePageState.addLibraryEvent('Notification Tapped'),
if (message.chat) {log('Chat Message Tapped')}
});
InfobipMobilemessaging.on(
LibraryEvent.REGISTRATION_UPDATED,
LibraryEvent.registrationUpdated,
(String token) => {
log('Callback. REGISTRATION_UPDATED event: $token'),
_HomePageState.addLibraryEvent('Registration Updated')
Expand Down Expand Up @@ -385,7 +385,7 @@ class _HomePageState extends State<HomePage> {
onTap: () {
log('Tile "Unregister Deeplink on Tap" tapped');
InfobipMobilemessaging.unregister(
LibraryEvent.NOTIFICATION_TAPPED, storedFunction);
LibraryEvent.notificationTapped, storedFunction);
}),
ListTile(
title: const Text('Unregister All Handlers'),
Expand Down
4 changes: 2 additions & 2 deletions example/lib/screen_one.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ class ScreenOneDemo extends StatefulWidget {
const ScreenOneDemo({Key key,}) : super(key: key);

@override
_ScreenOneDemoState createState() => _ScreenOneDemoState();
State createState() => _ScreenOneDemoState();
}

class _ScreenOneDemoState extends State<ScreenOneDemo>{
@override
Widget build(BuildContext context) => Scaffold(
Widget build(context) => Scaffold(
appBar: AppBar(
title: const Text("Screen One"),
),
Expand Down
4 changes: 2 additions & 2 deletions example/lib/screen_two.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ class ScreenTwoDemo extends StatefulWidget {
const ScreenTwoDemo({Key key,}) : super(key: key);

@override
_ScreenTwoDemoState createState() => _ScreenTwoDemoState();
State createState() => _ScreenTwoDemoState();
}

class _ScreenTwoDemoState extends State<ScreenTwoDemo>{
@override
Widget build(BuildContext context) => Scaffold(
Widget build(context) => Scaffold(
appBar: AppBar(
title: const Text("Screen Two"),
),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/sign_in_http.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:infobip_mobilemessaging/infobip_mobilemessaging.dart';
import 'package:infobip_mobilemessaging/models/PersonalizeContext.dart';
import 'package:infobip_mobilemessaging/models/personalize_context.dart';

class FormData {
String email;
Expand Down
Loading

0 comments on commit 9912eb7

Please sign in to comment.