-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
185 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ dependencies: | |
|
||
dev_dependencies: | ||
flutter_test: {sdk: flutter} | ||
lintall: ^0.1.0 | ||
lintall: ^0.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ dependencies: | |
|
||
dev_dependencies: | ||
flutter_test: {sdk: flutter} | ||
lintall: ^0.1.0 | ||
lintall: ^0.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49" | ||
channel: "stable" | ||
|
||
project_type: app | ||
|
||
# Tracks metadata for the flutter migrate command | ||
migration: | ||
platforms: | ||
- platform: root | ||
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 | ||
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 | ||
- platform: web | ||
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 | ||
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 | ||
|
||
# User provided section | ||
|
||
# List of Local paths (relative to this file) that should be | ||
# ignored by the migrate tool. | ||
# | ||
# Files that are not part of the templates will be ignored by default. | ||
unmanaged_files: | ||
- 'lib/main.dart' | ||
- 'ios/Runner.xcodeproj/project.pbxproj' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include: ../../analysis_options.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import 'package:color_chart/color_chart.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:modifier/modifier.dart'; | ||
|
||
void main() { | ||
runApp(const App()); | ||
} | ||
|
||
class App extends StatelessWidget { | ||
const App({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return builder((context) { | ||
final platformBrightness = MediaQuery.of(context).platformBrightness; | ||
final brightness = context.findAndTrust<Brightness>(); | ||
final theme = context.findAndTrust<Theme>(); | ||
return [ | ||
'Platform brightness: ${platformBrightness.name}'.asText, | ||
'Theme brightness: ${brightness.name}'.asText, | ||
'Foreground: ${theme.foreground.hex}'.asText, | ||
'Background: ${theme.background.hex}'.asText, | ||
].asColumn; | ||
}) | ||
.center | ||
.theme(light: const Theme.light(), dark: const Theme.dark()) | ||
.ensureDirection(context) | ||
.ensureMedia(context); | ||
} | ||
} | ||
|
||
class Theme with ThemeMixin { | ||
const Theme.light({ | ||
this.background = MonoColors.snow, | ||
this.foreground = MonoColors.ink, | ||
}); | ||
|
||
const Theme.dark({ | ||
this.background = MonoColors.night, | ||
this.foreground = MonoColors.lunar, | ||
}); | ||
|
||
@override | ||
final Color background; | ||
|
||
@override | ||
final Color foreground; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: common | ||
description: Example for theme and locale using the modifier package. | ||
publish_to: "none" | ||
version: 0.0.0 # The version code will always be zero. | ||
environment: {sdk: ">=3.4.3 <4.0.0"} | ||
|
||
dependencies: | ||
color_chart: ^0.2.0 | ||
flutter: {sdk: flutter} | ||
modifier: {path: ../../} | ||
|
||
dev_dependencies: | ||
flutter_test: {sdk: flutter} | ||
lintall: ^0.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<base href="$FLUTTER_BASE_HREF" /> | ||
<meta charset="UTF-8" /> | ||
<meta content="IE=Edge" http-equiv="X-UA-Compatible" /> | ||
<meta name="description" content="A new Flutter project." /> | ||
|
||
<meta name="apple-mobile-web-app-capable" content="yes" /> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> | ||
<meta name="apple-mobile-web-app-title" content="before" /> | ||
|
||
<title>common</title> | ||
<link rel="manifest" href="manifest.json" /> | ||
</head> | ||
<body> | ||
<script src="flutter_bootstrap.js" async></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "common", | ||
"short_name": "common", | ||
"start_url": ".", | ||
"display": "standalone", | ||
"background_color": "#0175C2", | ||
"theme_color": "#0175C2", | ||
"description": "Example for theme and locale customizations.", | ||
"orientation": "portrait-primary", | ||
"prefer_related_applications": false, | ||
"icons": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
echo_pos() { echo && echo "\033[34m[$1]\033[0m" && echo; } | ||
|
||
echo_pos "root" | ||
flutter pub get || exit 1 | ||
dart format --output=none --set-exit-if-changed . || exit 1 | ||
flutter analyze --fatal-infos || exit 1 | ||
flutter test || exit 1 | ||
|
||
# Build the examples to validate. | ||
cd example/before | ||
flutter build web || exit 1 | ||
cd ../after | ||
flutter build web || exit 1 | ||
cd ../.. | ||
process_example() { | ||
name=$1 | ||
echo_pos "example/$name" | ||
cd example/$name || exit 1 | ||
flutter pub get || exit 1 | ||
flutter build web || exit 1 | ||
cd ../.. | ||
} | ||
|
||
process_example before || exit 1 | ||
process_example after || exit 1 | ||
process_example common || exit 1 | ||
|
||
echo_pos "root" | ||
flutter pub publish --dry-run || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters