Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 94725ed

Browse files
Merge pull request #1 from techwithsam:new_updates
updates
2 parents a52f3a5 + ba9cfe5 commit 94725ed

Some content is hidden

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

65 files changed

+3050
-25
lines changed

‎.metadata

Lines changed: 38 additions & 3 deletions
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: 022b333a089afb81c471ec43d1f1f4f26305d876
8-
channel: beta
7+
revision: 85684f9300908116a78138ea4c6036c35c9a1236
8+
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: 85684f9300908116a78138ea4c6036c35c9a1236
17+
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
18+
- platform: android
19+
create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
20+
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
21+
- platform: ios
22+
create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
23+
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
24+
- platform: linux
25+
create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
26+
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
27+
- platform: macos
28+
create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
29+
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
30+
- platform: web
31+
create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
32+
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
33+
- platform: windows
34+
create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
35+
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
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'

‎analysis_options.yaml

Lines changed: 29 additions & 0 deletions
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

‎lib/screens/best.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class _BestPageState extends State<BestPage> {
2525
void initState() {
2626
super.initState();
2727
best = callApi.bestListApi() as Future<BestModel>?;
28-
WidgetsBinding.instance!
28+
WidgetsBinding.instance
2929
.addPostFrameCallback((_) => _refreshIndicatorKey.currentState!.show());
3030
}
3131

‎lib/screens/community.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class _CommunityPageState extends State<CommunityPage> {
2525
void initState() {
2626
super.initState();
2727
community = callAPI.communityListApi() as Future<CommunityModel>?;
28-
WidgetsBinding.instance!
28+
WidgetsBinding.instance
2929
.addPostFrameCallback((_) => _refreshIndicatorKey.currentState!.show());
3030
}
3131

‎lib/screens/featured.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class _FeaturedPageState extends State<FeaturedPage> {
2525
void initState() {
2626
super.initState();
2727
featured = callApi.featuredListApi() as Future<FeaturedModel>?;
28-
WidgetsBinding.instance!
28+
WidgetsBinding.instance
2929
.addPostFrameCallback((_) => _refreshIndicatorKey.currentState!.show());
3030
}
3131

‎lib/screens/homepage.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'package:flutter/cupertino.dart';
21
import 'package:flutter/gestures.dart';
32
import 'package:flutter/material.dart';
43
import 'package:google_fonts/google_fonts.dart';

‎lib/screens/new.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class _NewPageState extends State<NewPage> {
2727
void initState() {
2828
super.initState();
2929
newArc = callApi.newListApi() as Future<NewModel>?;
30-
WidgetsBinding.instance!
30+
WidgetsBinding.instance
3131
.addPostFrameCallback((_) => _refreshIndicatorKey.currentState!.show());
3232
}
3333

‎linux/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
flutter/ephemeral

‎linux/CMakeLists.txt

Lines changed: 138 additions & 0 deletions
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 "hashnode")
8+
# The unique GTK application identifier for this application. See:
9+
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
10+
set(APPLICATION_ID "com.acctgen1.hashnode")
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()

‎linux/flutter/CMakeLists.txt

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# This file controls Flutter-level build steps. It should not be edited.
2+
cmake_minimum_required(VERSION 3.10)
3+
4+
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5+
6+
# Configuration provided via flutter tool.
7+
include(${EPHEMERAL_DIR}/generated_config.cmake)
8+
9+
# TODO: Move the rest of this into files in ephemeral. See
10+
# https://github.com/flutter/flutter/issues/57146.
11+
12+
# Serves the same purpose as list(TRANSFORM ... PREPEND ...),
13+
# which isn't available in 3.10.
14+
function(list_prepend LIST_NAME PREFIX)
15+
set(NEW_LIST "")
16+
foreach(element ${${LIST_NAME}})
17+
list(APPEND NEW_LIST "${PREFIX}${element}")
18+
endforeach(element)
19+
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
20+
endfunction()
21+
22+
# === Flutter Library ===
23+
# System-level dependencies.
24+
find_package(PkgConfig REQUIRED)
25+
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
26+
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
27+
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
28+
29+
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
30+
31+
# Published to parent scope for install step.
32+
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
33+
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
34+
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
35+
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
36+
37+
list(APPEND FLUTTER_LIBRARY_HEADERS
38+
"fl_basic_message_channel.h"
39+
"fl_binary_codec.h"
40+
"fl_binary_messenger.h"
41+
"fl_dart_project.h"
42+
"fl_engine.h"
43+
"fl_json_message_codec.h"
44+
"fl_json_method_codec.h"
45+
"fl_message_codec.h"
46+
"fl_method_call.h"
47+
"fl_method_channel.h"
48+
"fl_method_codec.h"
49+
"fl_method_response.h"
50+
"fl_plugin_registrar.h"
51+
"fl_plugin_registry.h"
52+
"fl_standard_message_codec.h"
53+
"fl_standard_method_codec.h"
54+
"fl_string_codec.h"
55+
"fl_value.h"
56+
"fl_view.h"
57+
"flutter_linux.h"
58+
)
59+
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
60+
add_library(flutter INTERFACE)
61+
target_include_directories(flutter INTERFACE
62+
"${EPHEMERAL_DIR}"
63+
)
64+
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
65+
target_link_libraries(flutter INTERFACE
66+
PkgConfig::GTK
67+
PkgConfig::GLIB
68+
PkgConfig::GIO
69+
)
70+
add_dependencies(flutter flutter_assemble)
71+
72+
# === Flutter tool backend ===
73+
# _phony_ is a non-existent file to force this command to run every time,
74+
# since currently there's no way to get a full input/output list from the
75+
# flutter tool.
76+
add_custom_command(
77+
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
78+
${CMAKE_CURRENT_BINARY_DIR}/_phony_
79+
COMMAND ${CMAKE_COMMAND} -E env
80+
${FLUTTER_TOOL_ENVIRONMENT}
81+
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
82+
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
83+
VERBATIM
84+
)
85+
add_custom_target(flutter_assemble DEPENDS
86+
"${FLUTTER_LIBRARY}"
87+
${FLUTTER_LIBRARY_HEADERS}
88+
)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /