Skip to content

Commit

Permalink
structure changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolaiko committed Jun 23, 2021
1 parent cfddd75 commit b1186b6
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 41 deletions.
4 changes: 4 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ android {
defaultConfig {
minSdkVersion 26
}

dependencies {
compileOnly rootProject.findProject(":path_provider")
}
}

dependencies {
Expand Down
5 changes: 3 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PODS:
- draw_on_image_plugin (0.0.1):
- draw_on_image_plugin (1.0.0):
- Flutter
- path_provider
- Flutter (1.0.0)
- path_provider (0.0.1):
- Flutter
Expand All @@ -19,7 +20,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/path_provider/ios"

SPEC CHECKSUMS:
draw_on_image_plugin: 1868e6c575f44975e1fa7a9018347349d807f9cc
draw_on_image_plugin: faf94d90726fa4f0a11cab8248f154bbbe32833e
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c

Expand Down
6 changes: 2 additions & 4 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ import 'dart:io';
import 'dart:typed_data';
import 'dart:ui';

import 'package:draw_on_image_plugin/model/write_image_data.dart';
import 'package:draw_on_image_plugin/draw_on_image_plugin.dart';
import 'package:draw_on_image_plugin_example/draw_options_dialog.dart';
import 'package:draw_on_image_plugin_example/model/basic_draw_parameters.dart';
import 'package:draw_on_image_plugin_example/model/screen_dimensions.dart';
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:draw_on_image_plugin/draw_on_image_plugin.dart';
import 'package:path_provider/path_provider.dart';

void main() {
runApp(MaterialApp(
Expand All @@ -25,7 +23,7 @@ class MyApp extends StatefulWidget {
}

class _MyAppState extends State<MyApp> {
DrawOnImagePlugin _plugin = DrawOnImagePlugin();
DrawOnImage _plugin = DrawOnImage();
String? _pathToNewFile;

Future<void> _sendPluginRequest(BasicDrawParameters params) async {
Expand Down
10 changes: 3 additions & 7 deletions ios/draw_on_image_plugin.podspec
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint draw_on_image_plugin.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'draw_on_image_plugin'
s.version = '0.0.1'
s.version = '1.0.0'
s.summary = 'A new flutter plugin project.'
s.description = <<-DESC
A new flutter plugin project.
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => '[email protected]' }
s.author = { 'Nikolai' => '[email protected]' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.dependency 'path_provider'
s.platform = :ios, '8.0'

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
s.swift_version = '5.0'
end
24 changes: 3 additions & 21 deletions lib/draw_on_image_plugin.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
import 'dart:async';
import 'dart:io';

import 'package:draw_on_image_plugin/codecs/draw_image_data_method_codec.dart';
import 'package:draw_on_image_plugin/consts/name_constst.dart';
import 'package:draw_on_image_plugin/model/write_image_data.dart';
import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';

class DrawOnImagePlugin {
static MethodChannel _channel =
MethodChannel(channelName, DrawImageDataMethodCodec());

const DrawOnImagePlugin();

Future<String> writeTextOnImage(WriteImageData data) async {
String fileName = await _channel.invokeMethod(drawMethodName, data);
Directory dir = await getApplicationDocumentsDirectory();
return "${dir.path}/$fileName";
}
}
export 'src/draw_on_image.dart';
export 'src/model/write_image_data.dart';
export 'src/consts/default_values_consts.dart';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:typed_data';

import 'package:draw_on_image_plugin/consts/type_consts.dart';
import 'package:draw_on_image_plugin/model/write_image_data.dart';
import 'package:draw_on_image_plugin/src/consts/type_consts.dart';
import 'package:draw_on_image_plugin/src/model/write_image_data.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:draw_on_image_plugin/codecs/draw_image_data_message_codec.dart';
import 'package:draw_on_image_plugin/consts/type_consts.dart';
import 'package:draw_on_image_plugin/src/codecs/draw_image_data_message_codec.dart';
import 'package:draw_on_image_plugin/src/consts/type_consts.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions lib/src/draw_on_image.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'dart:async';
import 'dart:io';

import 'package:draw_on_image_plugin/src/codecs/draw_image_data_method_codec.dart';
import 'package:draw_on_image_plugin/src/consts/name_constst.dart';
import 'package:draw_on_image_plugin/src/model/write_image_data.dart';
import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';

class DrawOnImage {
static MethodChannel _channel =
MethodChannel(channelName, DrawImageDataMethodCodec());

const DrawOnImage();

Future<String> writeTextOnImage(WriteImageData data) async {
String fileName = await _channel.invokeMethod(drawMethodName, data);
Directory dir = await getApplicationDocumentsDirectory();
return "${dir.path}/$fileName";
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:draw_on_image_plugin/consts/default_values_consts.dart';
import 'package:draw_on_image_plugin/src/consts/default_values_consts.dart';
import 'package:flutter/services.dart';

class WriteImageData {
Expand Down
3 changes: 1 addition & 2 deletions test/draw_on_image_plugin_test.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:draw_on_image_plugin/consts/name_constst.dart';
import 'package:draw_on_image_plugin/src/consts/name_constst.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:draw_on_image_plugin/draw_on_image_plugin.dart';

void main() {
const MethodChannel channel = MethodChannel(channelName);
Expand Down

0 comments on commit b1186b6

Please sign in to comment.