Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3dbd0ca
Add example app
jemishavasoya Nov 28, 2023
6a76e0b
Merge branch 'main' into css_colors-add-example-app-#136217
jemishavasoya Nov 28, 2023
c4a4609
add flutter dependabot
jemishavasoya Nov 28, 2023
03e3117
Merge branch 'css_colors-add-example-app-#136217' of https://github.c…
jemishavasoya Nov 28, 2023
c2f8c73
Linux analyze fix
jemishavasoya Nov 28, 2023
83ab6e1
Revert "Linux analyze fix"
jemishavasoya Nov 28, 2023
426a59d
update dart formate
jemishavasoya Nov 29, 2023
51696de
Merge branch 'main' into css_colors-add-example-app-#136217
jemishavasoya Nov 29, 2023
9cd4781
issue fix
jemishavasoya Nov 30, 2023
be9b446
issue fix
jemishavasoya Nov 30, 2023
79edb03
issue fix
jemishavasoya Nov 30, 2023
a7b5166
Merge branch 'main' into css_colors-add-example-app-#136217
jemishavasoya Nov 30, 2023
701ea41
issue fix
jemishavasoya Nov 30, 2023
b561b1e
Merge branch 'css_colors-add-example-app-#136217' of https://github.c…
jemishavasoya Nov 30, 2023
430502e
issue fix
jemishavasoya Nov 30, 2023
1f256a7
formatted correctly
jemishavasoya Nov 30, 2023
c811a25
Update CHANGELOG.md
jemishavasoya Nov 30, 2023
2dc9eff
Update widget_test.dart
jemishavasoya Nov 30, 2023
5b67030
update version
jemishavasoya Nov 30, 2023
ea19846
issue fix
jemishavasoya Nov 30, 2023
03ce13d
Merge branch 'main' into css_colors-add-example-app-#136217
jemishavasoya Nov 30, 2023
466319d
update path
jemishavasoya Nov 30, 2023
0308c0a
Merge branch 'main' into css_colors-add-example-app-#136217
jemishavasoya Nov 30, 2023
00ce96a
Update CHANGELOG.md
jemishavasoya Nov 30, 2023
e133b51
Merge branch 'css_colors-add-example-app-#136217' of https://github.c…
jemishavasoya Nov 30, 2023
b415ef2
Update CHANGELOG.md
jemishavasoya Nov 30, 2023
5abc886
Merge branch 'main' into css_colors-add-example-app-#136217
jemishavasoya Nov 30, 2023
b3b5971
Merge branch 'main' into css_colors-add-example-app-#136217
jemishavasoya Nov 30, 2023
d3d9b70
Merge branch 'main' into css_colors-add-example-app-#136217
jemishavasoya Dec 1, 2023
5789840
Merge branch 'main' into css_colors-add-example-app-#136217
jemishavasoya Dec 1, 2023
c3e61c6
Merge branch 'main' into css_colors-add-example-app-#136217
jemishavasoya Dec 1, 2023
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
Prev Previous commit
Next Next commit
Linux analyze fix
  • Loading branch information
jemishavasoya committed Nov 28, 2023
commit c2f8c7327300f8fc97d276c581d5837aaf802d96
4 changes: 1 addition & 3 deletions packages/css_colors/example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
Expand All @@ -31,9 +32,6 @@
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

Expand Down
28 changes: 0 additions & 28 deletions packages/css_colors/example/analysis_options.yaml

This file was deleted.

34 changes: 17 additions & 17 deletions packages/css_colors/example/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(runner LANGUAGES CXX)
set(BINARY_NAME "example")
# The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
set(APPLICATION_ID "com.example.example")
set(APPLICATION_ID "dev.flutter.packages.flutterimageexample")

# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.
Expand All @@ -29,9 +29,9 @@ endif()
# Define build configuration options.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Debug" CACHE
STRING "Flutter build mode" FORCE)
STRING "Flutter build mode" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Profile" "Release")
"Debug" "Profile" "Release")
endif()

# Compilation settings that should be applied to most targets.
Expand Down Expand Up @@ -61,10 +61,10 @@ add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
#
# Any new source files that you add to the application should be added here.
add_executable(${BINARY_NAME}
"main.cc"
"my_application.cc"
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
)
"main.cc"
"my_application.cc"
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
)

# Apply the standard set of build settings. This can be removed for applications
# that need different build settings.
Expand All @@ -82,9 +82,9 @@ add_dependencies(${BINARY_NAME} flutter_assemble)
# people trying to run the unbundled copy, put it in a subdirectory instead of
# the default top-level location.
set_target_properties(${BINARY_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
)
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
)


# Generated plugin build rules, which manage building the plugins and adding
Expand All @@ -109,18 +109,18 @@ set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")

install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
COMPONENT Runtime)
COMPONENT Runtime)

install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
COMPONENT Runtime)
COMPONENT Runtime)

install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
COMPONENT Runtime)

foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
install(FILES "${bundled_library}"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
endforeach(bundled_library)

# Fully re-copy the assets directory on each build to avoid having stale files
Expand All @@ -130,10 +130,10 @@ install(CODE "
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
" COMPONENT Runtime)
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)

# Install the AOT library on non-Debug builds only.
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
COMPONENT Runtime)
endif()
74 changes: 37 additions & 37 deletions packages/css_colors/example/linux/flutter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,54 +35,54 @@ set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)

list(APPEND FLUTTER_LIBRARY_HEADERS
"fl_basic_message_channel.h"
"fl_binary_codec.h"
"fl_binary_messenger.h"
"fl_dart_project.h"
"fl_engine.h"
"fl_json_message_codec.h"
"fl_json_method_codec.h"
"fl_message_codec.h"
"fl_method_call.h"
"fl_method_channel.h"
"fl_method_codec.h"
"fl_method_response.h"
"fl_plugin_registrar.h"
"fl_plugin_registry.h"
"fl_standard_message_codec.h"
"fl_standard_method_codec.h"
"fl_string_codec.h"
"fl_value.h"
"fl_view.h"
"flutter_linux.h"
)
"fl_basic_message_channel.h"
"fl_binary_codec.h"
"fl_binary_messenger.h"
"fl_dart_project.h"
"fl_engine.h"
"fl_json_message_codec.h"
"fl_json_method_codec.h"
"fl_message_codec.h"
"fl_method_call.h"
"fl_method_channel.h"
"fl_method_codec.h"
"fl_method_response.h"
"fl_plugin_registrar.h"
"fl_plugin_registry.h"
"fl_standard_message_codec.h"
"fl_standard_method_codec.h"
"fl_string_codec.h"
"fl_value.h"
"fl_view.h"
"flutter_linux.h"
)
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
add_library(flutter INTERFACE)
target_include_directories(flutter INTERFACE
"${EPHEMERAL_DIR}"
)
"${EPHEMERAL_DIR}"
)
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
target_link_libraries(flutter INTERFACE
PkgConfig::GTK
PkgConfig::GLIB
PkgConfig::GIO
)
PkgConfig::GTK
PkgConfig::GLIB
PkgConfig::GIO
)
add_dependencies(flutter flutter_assemble)

# === Flutter tool backend ===
# _phony_ is a non-existent file to force this command to run every time,
# since currently there's no way to get a full input/output list from the
# flutter tool.
add_custom_command(
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/_phony_
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
VERBATIM
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/_phony_
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS
"${FLUTTER_LIBRARY}"
${FLUTTER_LIBRARY_HEADERS}
)
"${FLUTTER_LIBRARY}"
${FLUTTER_LIBRARY_HEADERS}
)
27 changes: 15 additions & 12 deletions packages/css_colors/example/linux/my_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "flutter/generated_plugin_registrant.h"

struct _MyApplication {
GtkApplication parent_instance;
char** dart_entrypoint_arguments;
GtkApplication parent_instance;
char** dart_entrypoint_arguments;
};

G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
Expand All @@ -22,7 +22,7 @@ G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
static void my_application_activate(GApplication* application) {
MyApplication* self = MY_APPLICATION(application);
GtkWindow* window =
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));

// Use a header bar when running in GNOME as this is the common style used
// by applications and is the setup most users will be using (e.g. Ubuntu
Expand Down Expand Up @@ -55,7 +55,8 @@ static void my_application_activate(GApplication* application) {
gtk_widget_show(GTK_WIDGET(window));

g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
fl_dart_project_set_dart_entrypoint_arguments(
project, self->dart_entrypoint_arguments);

FlView* view = fl_view_new(project);
gtk_widget_show(GTK_WIDGET(view));
Expand All @@ -67,16 +68,18 @@ static void my_application_activate(GApplication* application) {
}

// Implements GApplication::local_command_line.
static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
static gboolean my_application_local_command_line(GApplication* application,
gchar*** arguments,
int* exit_status) {
MyApplication* self = MY_APPLICATION(application);
// Strip out the first argument as it is the binary name.
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);

g_autoptr(GError) error = nullptr;
if (!g_application_register(application, nullptr, &error)) {
g_warning("Failed to register: %s", error->message);
*exit_status = 1;
return TRUE;
g_warning("Failed to register: %s", error->message);
*exit_status = 1;
return TRUE;
}

g_application_activate(application);
Expand All @@ -94,15 +97,15 @@ static void my_application_dispose(GObject* object) {

static void my_application_class_init(MyApplicationClass* klass) {
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
G_APPLICATION_CLASS(klass)->local_command_line =
my_application_local_command_line;
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
}

static void my_application_init(MyApplication* self) {}

MyApplication* my_application_new() {
return MY_APPLICATION(g_object_new(my_application_get_type(),
"application-id", APPLICATION_ID,
"flags", G_APPLICATION_NON_UNIQUE,
nullptr));
"application-id", APPLICATION_ID, "flags",
G_APPLICATION_NON_UNIQUE, nullptr));
}
2 changes: 1 addition & 1 deletion packages/css_colors/example/linux/my_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <gtk/gtk.h>

G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
GtkApplication)
GtkApplication)

/**
* my_application_new:
Expand Down
33 changes: 4 additions & 29 deletions packages/css_colors/example/test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -1,30 +1,5 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:example/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());

// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);

// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();

// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
void main() {}
7 changes: 4 additions & 3 deletions packages/css_colors/example/web/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<!-- Copyright 2013 The Flutter Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->

<!DOCTYPE html>
<html>
<head>
<!--
Expand Down Expand Up @@ -37,13 +38,13 @@

<script>
// The value below is injected by flutter build, do not touch.
const serviceWorkerVersion = null;
var serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
</head>
<body>
<script>
<script>
window.addEventListener('load', function(ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
Expand Down
Loading