Skip to content

Commit

Permalink
Flutter 1.19.0 4.1.pre (#103)
Browse files Browse the repository at this point in the history
* Flutter 1.19.0-4.1.pre

* Update README.md

* LINT

* WIP

* Web

Co-authored-by: Tomek Polanski <[email protected]>
  • Loading branch information
tomaszpolanski and Tomek Polanski authored Jun 13, 2020
1 parent ef6a571 commit dd67181
Show file tree
Hide file tree
Showing 43 changed files with 858 additions and 537 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,18 @@ Available as a [webpage](https://flutter-animations-cheat-sheet.codemagic.app/#/
The content of the page is [searchable](https://flutter-animations-cheat-sheet.codemagic.app/#/content).

# Building
Last tested version of Flutter that works with this repo is `v1.17.0`:
* **Important**: Use `version` otherwise desktop won't be picked up: `v1.17.0`
Last tested version of Flutter that works with this repo is `1.19.0-4.1.pre`:
* **Important**: Use `version` otherwise desktop won't be picked up: `1.19.0-4.1.pre`

## Building for Web
Upgrade flutter to minimum `v1.17.0`, enable web compilation and run:
Upgrade flutter to minimum `1.19.0-4.1.pre`, enable web compilation and run:
```
flutter version v1.17.0
flutter version 1.19.0-4.1.pre
flutter config --enable-web
flutter run -d chrome -v
```

## Building for Desktop
Enable desktop builds by running in the terminal:
```
flutter config --enable-linux-desktop --enable-macos-desktop --enable-windows-desktop
```
### Linux
- Add the following to `.bash_profile` replacing `$HOME/flutter/` with path to your Flutter folder.
```
Expand Down
9 changes: 7 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ linter:
- curly_braces_in_flow_control_structures
# - diagnostic_describe_all_properties # nice to have for libs but overkill for applications
- directives_ordering
# - do_not_use_environment TODO when available
- empty_catches
- empty_constructor_bodies
- empty_statements
- exhaustive_cases
- file_names
# - flutter_style_todos # don't need those for now
- hash_and_equals
Expand All @@ -89,6 +91,7 @@ linter:
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
# - no_default_cases TODO not yet available
- no_duplicate_case_values
- no_logic_in_create_state
- no_runtimeType_toString
Expand Down Expand Up @@ -143,6 +146,7 @@ linter:
- provide_deprecation_message
# - public_member_api_docs # do not use for an application, only a library
- recursive_getters
- sized_box_for_whitespace
- slash_for_doc_comments
- sort_child_properties_last
- sort_constructors_first
Expand Down Expand Up @@ -170,14 +174,15 @@ linter:
- unnecessary_string_interpolations
- unnecessary_this
- unrelated_type_equality_checks
- unsafe_html
# - unsafe_html We do this
- use_full_hex_values_for_flutter_colors
- use_function_type_syntax_for_parameters
- use_is_even_rather_than_modulo
- use_key_in_widget_constructors
- use_raw_strings
- use_rethrow_when_possible
- use_setters_to_change_properties
- use_string_buffers
- use_to_and_as_if_applicable
- valid_regexps
- void_checks
- void_checks
2 changes: 1 addition & 1 deletion lib/animated_widgets/container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class _ContainerExampleState extends State<ContainerExample> {
? const BoxDecoration(color: Colors.yellowAccent)
: BoxDecoration(
color: Colors.blue,
border: Border.all(color: Colors.black, width: 5),
border: Border.all(width: 5),
borderRadius: const BorderRadius.all(Radius.circular(15)),
),
child: const Icon(
Expand Down
4 changes: 2 additions & 2 deletions lib/animated_widgets/cross_fade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class _CrossFadeExampleState extends State<CrossFadeExample> {
return AnimatedCrossFade(
duration: const Duration(seconds: 4),
firstChild: widget.child,
secondChild: Card(
secondChild: const Card(
color: Colors.greenAccent,
child: Padding(
padding: const EdgeInsets.all(40),
padding: EdgeInsets.all(40),
child: Icon(
Icons.public,
size: 50,
Expand Down
2 changes: 0 additions & 2 deletions lib/curves/curves.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ class _CurvesSectionState extends State<CurvesSection> {
children: <Widget>[
singleCurveExample.body,
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Expanded(
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/code/code_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class _CodeButtonState extends State<CodeButton> {
width: 20,
child: CircularProgressIndicator(),
)
: Icon(Icons.code),
: const Icon(Icons.code),
tooltip: 'Show code',
onPressed: () async {
setState(() => _isLoading = true);
Expand Down
1 change: 0 additions & 1 deletion lib/shared/ui/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class Header extends StatelessWidget {
for (int i = 0; i < rowCount; i++)
Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: children.sublist(
i * (children.length / rowCount).round(),
(i + 1) * (children.length / rowCount).round(),
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/ui/search_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class _SearchBarState extends State<SearchBar> {
),
actions: <Widget>[
IconButton(
icon: Icon(Icons.clear),
icon: const Icon(Icons.clear),
onPressed: _controller.clear,
)
],
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/ui/section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class _SectionState extends State<Section> with SingleTickerProviderStateMixin {
},
)
: IconButton(
icon: Icon(Icons.content_copy),
icon: const Icon(Icons.content_copy),
tooltip: 'Copy code',
onPressed: () async {
await copyText(_code);
Expand Down
1 change: 0 additions & 1 deletion lib/shared/ui/separator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class Separator extends StatelessWidget {
Widget build(BuildContext context) {
return Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
for (var i = 0; i < 3; i++)
Container(
Expand Down
4 changes: 2 additions & 2 deletions lib/transitions/decorated_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ class DecoratedBoxExample extends StatelessWidget {
decoration: animation.drive(DecorationTween(
begin: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.black, width: 0),
border: Border.all(width: 0),
borderRadius: const BorderRadius.all(Radius.circular(0)),
),
end: BoxDecoration(
color: Colors.yellowAccent,
border: Border.all(color: Colors.black, width: 35),
border: Border.all(width: 35),
borderRadius: const BorderRadius.all(Radius.circular(30)),
),
)),
Expand Down
90 changes: 90 additions & 0 deletions linux/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
cmake_minimum_required(VERSION 3.10)
project(runner LANGUAGES CXX)

set(BINARY_NAME "animation_cheat_page")

cmake_policy(SET CMP0063 NEW)

set(CMAKE_INSTALL_RPATH "\$ORIGIN")

# Configure build options.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Debug" CACHE
STRING "Flutter build mode" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Profile" "Release")
endif()

# Compilation settings that should be applied to most targets.
function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_features(${TARGET} PUBLIC cxx_std_14)
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
endfunction()

set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")

# Flutter library and tool build rules.
add_subdirectory(${FLUTTER_MANAGED_DIR})

# Application build
add_executable(${BINARY_NAME}
"main.cc"
"window_configuration.cc"
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
)
apply_standard_settings(${BINARY_NAME})
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
add_dependencies(${BINARY_NAME} flutter_assemble)

# Generated plugin build rules, which manage building the plugins and adding
# them to the application.
include(flutter/generated_plugins.cmake)


# === Installation ===
# By default, "installing" just makes a relocatable bundle in the build
# directory.
set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
endif()

# BundleUtilities doesn't re-copy changed files, so start with a clean build
# bundle directory every time.
INSTALL(CODE "
file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
" COMPONENT Runtime)

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)

file(GLOB FLUTTER_PLUGIN_DIRS "${PROJECT_BINARY_DIR}/plugins/*")

INSTALL(CODE "
include(BundleUtilities)
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${BINARY_NAME}\" \"\"
\"${FLUTTER_PLUGIN_DIRS};${FLUTTER_LIBRARY_DIR}\")
" COMPONENT Runtime)

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

# Fully re-copy the assets directory on each build to avoid having stale files
# from a previous install.
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
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)

# Install the lib directory on non-Debug builds only.
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
INSTALL(DIRECTORY "${PROJECT_BUILD_DIR}/lib"
DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime)
endif()
Loading

0 comments on commit dd67181

Please sign in to comment.