Skip to content

Commit

Permalink
Flutter 1.15.17 (#98)
Browse files Browse the repository at this point in the history
* Updating flutter to 1.14.6

* Update generic_test.dart

* Updating linux

* Updating linux an windows

* updating macos and web

* Fixing fonts

* Update footer.dart

* Update footer.dart

Co-authored-by: Tomek Polanski <[email protected]>
  • Loading branch information
tomaszpolanski and Tomek Polanski authored Mar 25, 2020
1 parent 30d9ec1 commit 42d3057
Show file tree
Hide file tree
Showing 45 changed files with 292 additions and 336 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ 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.12.13+hotfix.5`:
* **Important**: Use `version` otherwise desktop won't be picked up: `v1.12.13+hotfix.5`
Last tested version of Flutter that works with this repo is `v1.15.17`:
* **Important**: Use `version` otherwise desktop won't be picked up: `v1.15.17`

## Building for Web
Upgrade flutter version to at least `v1.12.13+hotfix.5`, enable web compilation and run:
Upgrade flutter to minimum `v1.15.17`, enable web compilation and run:
```
flutter version v1.12.13+hotfix.5
flutter version v1.15.17
flutter config --enable-web
flutter run -d chrome -v
```
Expand Down
4 changes: 2 additions & 2 deletions lib/animated_widgets/default_text_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class _AnimatedDefaultTextStyleExampleState
return AnimatedDefaultTextStyle(
duration: const Duration(seconds: 4),
style: _showFirst
? Theme.of(context).textTheme.display1
: Theme.of(context).textTheme.display3,
? Theme.of(context).textTheme.headline4
: Theme.of(context).textTheme.headline2,
child: const Text('FlutterFlutterFlutterFlutterFlutterFlutter'),
);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/generic/not_found_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class NotFoundPage extends StatelessWidget {
children: <Widget>[
Text(
'0x‭194‬',
style: Theme.of(context).textTheme.display4.copyWith(
style: Theme.of(context).textTheme.headline1.copyWith(
color: Colors.black,
fontSize: 200,
),
),
Text(
'(404)',
style: Theme.of(context).textTheme.display1,
style: Theme.of(context).textTheme.headline4,
),
],
),
Expand Down
2 changes: 0 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import 'package:animation_cheat_page/animations_cheat_sheet.dart';
import 'package:animation_cheat_page/config.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';

void main() {
debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;
runApp(
const AnimationCheatSheet(
config: Configuration(),
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/licenses_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ class _LicensesPageState extends State<LicensesPage> {
children: <Widget>[
Text(
name,
style: Theme.of(context).textTheme.headline,
style: Theme.of(context).textTheme.headline5,
),
if (version != null)
Text(
version,
style: Theme.of(context).textTheme.body1,
style: Theme.of(context).textTheme.bodyText2,
),
const SizedBox(height: 18),
Text(
Expand All @@ -132,7 +132,7 @@ class _LicensesPageState extends State<LicensesPage> {
Container(height: 18),
Text(
'Powered by Flutter',
style: Theme.of(context).textTheme.body1,
style: Theme.of(context).textTheme.bodyText2,
),
Container(height: 24),
..._licenses,
Expand Down
4 changes: 2 additions & 2 deletions lib/shared/ui/description.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Description extends StatelessWidget {
width: 640,
padding: const EdgeInsets.symmetric(horizontal: 20),
child: DefaultTextStyle.merge(
style: Theme.of(context).textTheme.subhead.copyWith(fontSize: 25),
style: Theme.of(context).textTheme.subtitle1.copyWith(fontSize: 25),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expand Down Expand Up @@ -102,7 +102,7 @@ class _Description extends StatelessWidget {
return SizedBox(
width: 600,
child: RichText(
text: TextSpan(style: Theme.of(context).textTheme.subhead, children: [
text: TextSpan(style: Theme.of(context).textTheme.subtitle1, children: [
const TextSpan(
text: 'Do you need simple animation samples for Flutter?\n'
'I present you my set of Flutter animation code snippets. '
Expand Down
9 changes: 7 additions & 2 deletions lib/shared/ui/footer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ class Footer extends StatelessWidget {
_Button(
onPressed: () => Navigator.of(context).pushNamed(Routes.content),
icon: Icons.all_inclusive,
child: const Text('Content'),
child: Text(
'Content',
style: theme.textTheme.headline6.copyWith(
color: Colors.white,
),
),
),
_Button(
onPressed: () => Navigator.of(context).pushNamed(Routes.licenses),
Expand Down Expand Up @@ -73,7 +78,7 @@ class _Button extends StatelessWidget {
Icon(icon, color: Colors.white, size: 16),
const SizedBox(width: 5),
DefaultTextStyle.merge(
style: Theme.of(context).textTheme.title.copyWith(
style: Theme.of(context).textTheme.headline6.copyWith(
color: Colors.white,
),
child: child,
Expand Down
5 changes: 3 additions & 2 deletions lib/shared/ui/new_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class NewSection extends StatelessWidget {
]
.map((example) => Text(
' • ${example.title}',
style: Theme.of(context).textTheme.title.copyWith(fontSize: 25),
style:
Theme.of(context).textTheme.headline6.copyWith(fontSize: 25),
))
.toList(growable: false);
return children.isNotEmpty
Expand All @@ -46,7 +47,7 @@ class NewSection extends StatelessWidget {
NewLabel(),
Text(
' wigets:',
style: Theme.of(context).textTheme.display1.copyWith(
style: Theme.of(context).textTheme.headline4.copyWith(
fontWeight: FontWeight.bold, color: Colors.black),
),
],
Expand Down
4 changes: 2 additions & 2 deletions lib/shared/ui/search_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class _SearchBarState extends State<SearchBar> {
automaticallyImplyLeading: false,
title: TextField(
controller: _controller,
style: Theme.of(context).primaryTextTheme.title,
cursorColor: Theme.of(context).primaryTextTheme.title.color,
style: Theme.of(context).primaryTextTheme.headline6,
cursorColor: Theme.of(context).primaryTextTheme.headline6.color,
keyboardType: TextInputType.text,
autofocus: true,
),
Expand Down
13 changes: 8 additions & 5 deletions lib/shared/ui/section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class _SectionState extends State<Section> with SingleTickerProviderStateMixin {
),
const SizedBox(height: 20),
DefaultTextStyle.merge(
style: Theme.of(context).textTheme.subhead.copyWith(fontSize: 25),
style:
Theme.of(context).textTheme.subtitle1.copyWith(fontSize: 25),
child: widget.body,
),
const SizedBox(height: 20),
Expand Down Expand Up @@ -154,7 +155,8 @@ class DoubleSection extends StatelessWidget {
),
const SizedBox(height: 20),
DefaultTextStyle.merge(
style: Theme.of(context).textTheme.subhead.copyWith(fontSize: 25),
style:
Theme.of(context).textTheme.subtitle1.copyWith(fontSize: 25),
child: body,
),
const SizedBox(height: 20),
Expand Down Expand Up @@ -193,13 +195,14 @@ class SectionHeader extends StatelessWidget {
DefaultTextStyle.merge(
style: Theme.of(context)
.textTheme
.display1
.headline4
.copyWith(fontWeight: FontWeight.bold, color: Colors.black),
child: title,
),
const SizedBox(height: 20),
DefaultTextStyle.merge(
style: Theme.of(context).textTheme.subhead.copyWith(fontSize: 25),
style:
Theme.of(context).textTheme.subtitle1.copyWith(fontSize: 25),
child: child,
),
const SizedBox(height: 20),
Expand All @@ -226,7 +229,7 @@ class SectionTitle extends StatelessWidget {
Widget build(BuildContext context) {
final titleWidget = Text(
title,
style: Theme.of(context).textTheme.headline.copyWith(
style: Theme.of(context).textTheme.headline5.copyWith(
fontWeight: FontWeight.bold,
fontSize: 35,
),
Expand Down
4 changes: 2 additions & 2 deletions lib/transitions/default_text_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class DefaultTextStyleExample extends StatelessWidget {
style: animation
.drive(CurveTween(curve: Curves.fastOutSlowIn))
.drive(TextStyleTween(
begin: Theme.of(context).textTheme.display1,
end: Theme.of(context).textTheme.display3,
begin: Theme.of(context).textTheme.headline4,
end: Theme.of(context).textTheme.headline2,
)),
child: const Text('Flutter'),
);
Expand Down
73 changes: 31 additions & 42 deletions linux/Makefile
Original file line number Diff line number Diff line change
@@ -1,36 +1,10 @@
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Executable name.
BINARY_NAME=flutter_desktop_example
# Any extra source files to build.
EXTRA_SOURCES=
# Paths of any additional libraries to be bundled in the output directory.
EXTRA_BUNDLED_LIBRARIES=
# Extra flags (e.g., for library dependencies).
SYSTEM_LIBRARIES=
EXTRA_CXXFLAGS=
EXTRA_CPPFLAGS=
EXTRA_LDFLAGS=

# Default build type. For a release build, set BUILD=release.
# Currently this only sets NDEBUG, which is used to control the flags passed
# to the Flutter engine in the example shell, and not the complation settings
# (e.g., optimization level) of the C++ code.
include app_configuration.mk

# Default build type.
BUILD=debug

FLUTTER_EPHEMERAL_DIR=flutter/ephemeral
FLUTTER_MANAGED_DIR=flutter
FLUTTER_EPHEMERAL_DIR=$(FLUTTER_MANAGED_DIR)/ephemeral

# Configuration provided via flutter tool.
FLUTTER_CONFIG_FILE=$(FLUTTER_EPHEMERAL_DIR)/generated_config.mk
Expand All @@ -41,7 +15,7 @@ FLUTTER_APP_DIR=$(CURDIR)/..
FLUTTER_APP_BUILD_DIR=$(FLUTTER_APP_DIR)/build

OUT_DIR=$(FLUTTER_APP_BUILD_DIR)/linux
OBJ_DIR=$(OUT_DIR)/obj
OBJ_DIR=$(OUT_DIR)/obj/$(BUILD)

# Libraries
FLUTTER_LIB_NAME=flutter_linux_glfw
Expand Down Expand Up @@ -81,8 +55,9 @@ WRAPPER_SOURCES= \

# Use abspath for extra sources, which may also contain relative paths (see
# note above about WRAPPER_ROOT).
SOURCES=main.cc flutter/generated_plugin_registrant.cc $(WRAPPER_SOURCES) \
$(abspath $(EXTRA_SOURCES))
SOURCES=main.cc window_configuration.cc \
flutter/generated_plugin_registrant.cc \
$(WRAPPER_SOURCES) $(abspath $(EXTRA_SOURCES))

# Headers
WRAPPER_INCLUDE_DIR=$(WRAPPER_ROOT)/include
Expand All @@ -93,10 +68,14 @@ ifneq ($(strip $(SYSTEM_LIBRARIES)),)
EXTRA_CPPFLAGS+=$(patsubst -I%,-isystem%,$(shell pkg-config --cflags $(SYSTEM_LIBRARIES)))
EXTRA_LDFLAGS+=$(shell pkg-config --libs $(SYSTEM_LIBRARIES))
endif
CXX=clang++ $(EXTRA_CXXFLAGS)
CXXFLAGS.release=-DNDEBUG
CXXFLAGS=-std=c++14 -Wall -Werror $(CXXFLAGS.$(BUILD))
CPPFLAGS=$(patsubst %,-I%,$(INCLUDE_DIRS)) $(EXTRA_CPPFLAGS)
CXX=clang++
CPPFLAGS.release=-DNDEBUG
CPPFLAGS.profile=$(CPPFLAGS.release)
CXXFLAGS.release=-O2
CXXFLAGS.profile=$(CXXFLAGS.release)
CXXFLAGS=-std=c++14 -Wall -Werror $(CXXFLAGS.$(BUILD)) $(EXTRA_CXXFLAGS)
CPPFLAGS=$(patsubst %,-I%,$(INCLUDE_DIRS)) \
$(CPPFLAGS.$(BUILD)) $(EXTRA_CPPFLAGS)
LDFLAGS=-L$(BUNDLE_LIB_DIR) \
-l$(FLUTTER_LIB_NAME) \
$(EXTRA_LDFLAGS) \
Expand All @@ -111,6 +90,12 @@ DEPENDENCY_FILES=$(OBJ_FILES:%.o=%.d)
.PHONY: all
all: $(BIN_OUT) bundle

# Add the plugin targets, and their associated settings.
include $(FLUTTER_MANAGED_DIR)/generated_plugins.mk
EXTRA_BUNDLED_LIBRARIES+=$(PLUGIN_LIBRARIES)
EXTRA_LDFLAGS+=$(PLUGIN_LDFLAGS)
EXTRA_CPPFLAGS+=$(PLUGIN_CPPFLAGS)

# This is a phony target because the flutter tool cannot describe
# its inputs and outputs yet.
.PHONY: sync
Expand All @@ -124,8 +109,13 @@ $(BIN_OUT): $(OBJ_FILES) $(ALL_LIBS_OUT)
mkdir -p $(@D)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OBJ_FILES) $(LDFLAGS) -o $@

$(WRAPPER_SOURCES) $(FLUTTER_LIB) $(ICU_DATA_SOURCE) $(FLUTTER_ASSETS_SOURCE): \
| sync
$(WRAPPER_SOURCES) $(FLUTTER_LIB) $(ICU_DATA_SOURCE) $(FLUTTER_ASSETS_SOURCE) \
$(PLUGIN_TARGETS): | sync

# Plugin library bundling pattern.
$(BUNDLE_LIB_DIR)/%: $(OUT_DIR)/%
mkdir -p $(BUNDLE_LIB_DIR)
cp $< $@

$(FLUTTER_LIB_OUT): $(FLUTTER_LIB)
mkdir -p $(@D)
Expand All @@ -143,8 +133,7 @@ $(OBJ_DIR)/%.o : %.cc | sync

# Fully re-copy the assets directory on each build to avoid having to keep a
# comprehensive list of all asset files here, which would be fragile to changes
# in the Flutter example (e.g., adding a new font to pubspec.yaml would require
# changes here).
# in other files (e.g., adding a new font to pubspec.yaml).
.PHONY: bundleflutterassets
bundleflutterassets: $(FLUTTER_ASSETS_SOURCE)
mkdir -p $(BUNDLE_DATA_DIR)
Expand Down
16 changes: 16 additions & 0 deletions linux/app_configuration.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file contains variables that applications are likely to need to
# change, to isolate them from the main Makefile where the build rules are still
# in flux. This should simplify re-creating the runner while preserving local
# changes.

# Executable name.
BINARY_NAME=animation_cheat_page
# Any extra source files to build.
EXTRA_SOURCES=
# Paths of any additional libraries to be bundled in the output directory.
EXTRA_BUNDLED_LIBRARIES=
# Extra flags (e.g., for library dependencies).
SYSTEM_LIBRARIES=
EXTRA_CXXFLAGS=
EXTRA_CPPFLAGS=
EXTRA_LDFLAGS=
40 changes: 0 additions & 40 deletions linux/build.sh

This file was deleted.

1 change: 1 addition & 0 deletions linux/flutter/.template_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
Loading

0 comments on commit 42d3057

Please sign in to comment.