Skip to content

Commit 57a64dc

Browse files
Merge pull request #126 from RafaelBarbosatec/develop
Version 1.2.4
2 parents c6c0186 + e0b2b83 commit 57a64dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1564
-48
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.2.4
2+
- BREAKING CHANGE: moved `context` of the TutorialCoachMark to `show` method. `tutorialCoachMark.show(context:context);`
3+
- Resolve issue [#125](https://github.com/RafaelBarbosatec/tutorial_coach_mark/issues/125)
4+
15
# 1.2.3
26
- Fix warn build in Flutter 3.0.
37
- Collect target tap position. [PR #116](https://github.com/RafaelBarbosatec/tutorial_coach_mark/pull/116)

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import 'package:tutorial_coach_mark/tutorial_coach_mark.dart';
2020
2121
void showTutorial() {
2222
TutorialCoachMark tutorial = TutorialCoachMark(
23-
context,
2423
targets: targets, // List<TargetFocus>
2524
colorShadow: Colors.red, // DEFAULT Colors.black
2625
// alignSkip: Alignment.bottomRight,
@@ -43,7 +42,7 @@ void showTutorial() {
4342
onSkip: (){
4443
print("skip");
4544
}
46-
)..show();
45+
)..show(context:context);
4746
4847
// tutorial.skip();
4948
// tutorial.finish();
@@ -256,7 +255,7 @@ void showTutorial() {
256255
onFinish: (){
257256
print("finish");
258257
},
259-
)..show();
258+
)..show(context:context);
260259
}
261260
```
262261

example/.metadata

+37-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,45 @@
11
# This file tracks properties of this Flutter project.
22
# Used by Flutter tool to assess capabilities and perform upgrades etc.
33
#
4-
# This file should be version controlled and should not be manually edited.
4+
# This file should be version controlled.
55

66
version:
7-
revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713
7+
revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
88
channel: stable
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
17+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
18+
- platform: android
19+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
20+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
21+
- platform: ios
22+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
23+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
24+
- platform: linux
25+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
26+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
27+
- platform: macos
28+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
29+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
30+
- platform: web
31+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
32+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
33+
- platform: windows
34+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
35+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/analysis_options.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options

example/lib/main.dart

+13-8
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class MyHomePage extends StatefulWidget {
2424

2525
class _MyHomePageState extends State<MyHomePage> {
2626
late TutorialCoachMark tutorialCoachMark;
27-
List<TargetFocus> targets = <TargetFocus>[];
2827

2928
GlobalKey keyButton = GlobalKey();
3029
GlobalKey keyButton1 = GlobalKey();
@@ -39,6 +38,7 @@ class _MyHomePageState extends State<MyHomePage> {
3938

4039
@override
4140
void initState() {
41+
createTutorial();
4242
Future.delayed(Duration.zero, showTutorial);
4343
super.initState();
4444
}
@@ -214,10 +214,12 @@ class _MyHomePageState extends State<MyHomePage> {
214214
}
215215

216216
void showTutorial() {
217-
initTargets();
217+
tutorialCoachMark.show(context: context);
218+
}
219+
220+
void createTutorial() {
218221
tutorialCoachMark = TutorialCoachMark(
219-
context,
220-
targets: targets,
222+
targets: _createTargets(),
221223
colorShadow: Colors.red,
222224
textSkip: "SKIP",
223225
paddingFocus: 10,
@@ -230,19 +232,20 @@ class _MyHomePageState extends State<MyHomePage> {
230232
},
231233
onClickTargetWithTapPosition: (target, tapDetails) {
232234
print("target: $target");
233-
print("clicked at position local: ${tapDetails.localPosition} - global: ${tapDetails.globalPosition}");
235+
print(
236+
"clicked at position local: ${tapDetails.localPosition} - global: ${tapDetails.globalPosition}");
234237
},
235238
onClickOverlay: (target) {
236239
print('onClickOverlay: $target');
237240
},
238241
onSkip: () {
239242
print("skip");
240243
},
241-
)..show();
244+
);
242245
}
243246

244-
void initTargets() {
245-
targets.clear();
247+
List<TargetFocus> _createTargets() {
248+
List<TargetFocus> targets = [];
246249
targets.add(
247250
TargetFocus(
248251
identify: "keyBottomNavigation1",
@@ -594,5 +597,7 @@ class _MyHomePageState extends State<MyHomePage> {
594597
],
595598
shape: ShapeLightFocus.Circle,
596599
));
600+
601+
return targets;
597602
}
598603
}

example/linux/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
flutter/ephemeral

example/linux/CMakeLists.txt

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Project-level configuration.
2+
cmake_minimum_required(VERSION 3.10)
3+
project(runner LANGUAGES CXX)
4+
5+
# The name of the executable created for the application. Change this to change
6+
# the on-disk name of your application.
7+
set(BINARY_NAME "example")
8+
# The unique GTK application identifier for this application. See:
9+
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
10+
set(APPLICATION_ID "com.rafaelbarbosatec.example")
11+
12+
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
13+
# versions of CMake.
14+
cmake_policy(SET CMP0063 NEW)
15+
16+
# Load bundled libraries from the lib/ directory relative to the binary.
17+
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
18+
19+
# Root filesystem for cross-building.
20+
if(FLUTTER_TARGET_PLATFORM_SYSROOT)
21+
set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})
22+
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
23+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
24+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
25+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
26+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
27+
endif()
28+
29+
# Define build configuration options.
30+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
31+
set(CMAKE_BUILD_TYPE "Debug" CACHE
32+
STRING "Flutter build mode" FORCE)
33+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
34+
"Debug" "Profile" "Release")
35+
endif()
36+
37+
# Compilation settings that should be applied to most targets.
38+
#
39+
# Be cautious about adding new options here, as plugins use this function by
40+
# default. In most cases, you should add new options to specific targets instead
41+
# of modifying this function.
42+
function(APPLY_STANDARD_SETTINGS TARGET)
43+
target_compile_features(${TARGET} PUBLIC cxx_std_14)
44+
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
45+
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
46+
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
47+
endfunction()
48+
49+
# Flutter library and tool build rules.
50+
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
51+
add_subdirectory(${FLUTTER_MANAGED_DIR})
52+
53+
# System-level dependencies.
54+
find_package(PkgConfig REQUIRED)
55+
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
56+
57+
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
58+
59+
# Define the application target. To change its name, change BINARY_NAME above,
60+
# not the value here, or `flutter run` will no longer work.
61+
#
62+
# Any new source files that you add to the application should be added here.
63+
add_executable(${BINARY_NAME}
64+
"main.cc"
65+
"my_application.cc"
66+
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
67+
)
68+
69+
# Apply the standard set of build settings. This can be removed for applications
70+
# that need different build settings.
71+
apply_standard_settings(${BINARY_NAME})
72+
73+
# Add dependency libraries. Add any application-specific dependencies here.
74+
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
75+
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
76+
77+
# Run the Flutter tool portions of the build. This must not be removed.
78+
add_dependencies(${BINARY_NAME} flutter_assemble)
79+
80+
# Only the install-generated bundle's copy of the executable will launch
81+
# correctly, since the resources must in the right relative locations. To avoid
82+
# people trying to run the unbundled copy, put it in a subdirectory instead of
83+
# the default top-level location.
84+
set_target_properties(${BINARY_NAME}
85+
PROPERTIES
86+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
87+
)
88+
89+
# Generated plugin build rules, which manage building the plugins and adding
90+
# them to the application.
91+
include(flutter/generated_plugins.cmake)
92+
93+
94+
# === Installation ===
95+
# By default, "installing" just makes a relocatable bundle in the build
96+
# directory.
97+
set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
98+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
99+
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
100+
endif()
101+
102+
# Start with a clean build bundle directory every time.
103+
install(CODE "
104+
file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
105+
" COMPONENT Runtime)
106+
107+
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
108+
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
109+
110+
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
111+
COMPONENT Runtime)
112+
113+
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
114+
COMPONENT Runtime)
115+
116+
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
117+
COMPONENT Runtime)
118+
119+
foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
120+
install(FILES "${bundled_library}"
121+
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
122+
COMPONENT Runtime)
123+
endforeach(bundled_library)
124+
125+
# Fully re-copy the assets directory on each build to avoid having stale files
126+
# from a previous install.
127+
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
128+
install(CODE "
129+
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
130+
" COMPONENT Runtime)
131+
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
132+
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
133+
134+
# Install the AOT library on non-Debug builds only.
135+
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
136+
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
137+
COMPONENT Runtime)
138+
endif()

0 commit comments

Comments
 (0)