Skip to content

Commit

Permalink
feat: Initial Commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Nov 19, 2022
1 parent 5e20ae8 commit e6eb848
Show file tree
Hide file tree
Showing 50 changed files with 3,182 additions and 5,384 deletions.
2 changes: 1 addition & 1 deletion packages/katana_theme/example/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# katana_listenables_example
# katana_theme_example

A new Flutter project.

Expand Down
235 changes: 235 additions & 0 deletions packages/katana_theme/example/assets/Localization.csv

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added packages/katana_theme/example/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/katana_theme/example/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions packages/katana_theme/example/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
41 changes: 41 additions & 0 deletions packages/katana_theme/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
22 changes: 22 additions & 0 deletions packages/katana_theme/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PODS:
- Flutter (1.0.0)
- path_provider_ios (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `Flutter`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)

EXTERNAL SOURCES:
Flutter:
:path: Flutter
path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3

COCOAPODS: 1.11.3
68 changes: 68 additions & 0 deletions packages/katana_theme/example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
4156FC010F2832F9DCC9F7EB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A7710B75AC0BC14927D1C2A /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
Expand Down Expand Up @@ -42,19 +43,32 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9A35E8C26B41CE3072D29944 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
9A7710B75AC0BC14927D1C2A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
C6B114DBCC57008EEDF12E23 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
E8F809518DB69E904D8AC26C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4156FC010F2832F9DCC9F7EB /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
127C5F1D46F53DA020BA5EC9 /* Frameworks */ = {
isa = PBXGroup;
children = (
9A7710B75AC0BC14927D1C2A /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
Expand All @@ -72,6 +86,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
B82730F705ABA070FF9A372E /* Pods */,
127C5F1D46F53DA020BA5EC9 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand All @@ -98,19 +114,32 @@
path = Runner;
sourceTree = "<group>";
};
B82730F705ABA070FF9A372E /* Pods */ = {
isa = PBXGroup;
children = (
9A35E8C26B41CE3072D29944 /* Pods-Runner.debug.xcconfig */,
E8F809518DB69E904D8AC26C /* Pods-Runner.release.xcconfig */,
C6B114DBCC57008EEDF12E23 /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
5F888FA9A1C71157EEDCB88B /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
156B88983ADCA4785D5372EE /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -169,6 +198,23 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
156B88983ADCA4785D5372EE /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -183,6 +229,28 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
5F888FA9A1C71157EEDCB88B /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 69 additions & 5 deletions packages/katana_theme/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:katana_theme/katana_theme.dart';

import 'package:flutter/material.dart';

part 'main.theme.dart';

@appTheme
final theme = AppThemeData.light(
primary: Colors.red,
secondary: Colors.orange,
tertiary: Colors.teal,
);

void main() {
runApp(const MyApp());
}
Expand All @@ -13,11 +22,66 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return MaterialApp(
home: const ListenablePage(),
title: "Flutter Demo",
theme: ThemeData(
primarySwatch: Colors.blue,
return AppThemeScope(
theme: theme,
child: MaterialApp(
home: const MyHomePage(
title: "Flutter Demo",
),
title: "Flutter Demo",
theme: theme.toThemeData(
defaultFontFamily: theme.font.notoSerifJP,
),
),
);
}
}

@immutable
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});

final String title;

@override
State<StatefulWidget> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;

void _incrementCounter() {
setState(() {
_counter++;
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
"You have pushed the button this many times:",
style: theme.text.labelMedium,
),
Text(
"$_counter",
style: theme.text.displayMedium,
),
],
),
),
floatingActionButton: FloatingActionButton(
backgroundColor: theme.color.tertiary,
onPressed: _incrementCounter,
tooltip: "Increment",
child: Icon(Icons.add, color: theme.color.onTertiary),
),
);
}
Expand Down
58 changes: 58 additions & 0 deletions packages/katana_theme/example/lib/main.theme.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// ignore_for_file: unused_field, unused_element, require_trailing_commas, prefer_const_constructors, unnecessary_overrides, prefer_const_literals_to_create_immutables, unnecessary_null_in_if_null_operators, library_prefixes, directives_ordering, no_leading_underscores_for_local_identifiers, unnecessary_brace_in_string_interps, unnecessary_type_check, library_private_types_in_public_api

part of 'main.dart';

// **************************************************************************
// ThemeGenerator
// **************************************************************************

extension $ThemeAssetsExtensions on AssetThemeData {
_$01208c4b24c6b5e728eca36851bc335174a144dc get icon =>
const _$01208c4b24c6b5e728eca36851bc335174a144dc();
_$f06c88961712f1c49d6696007c8b6c3da5a53947 get localization =>
const _$f06c88961712f1c49d6696007c8b6c3da5a53947();
_$a5ad3eaf62869fd7eb3d770139e27947e8686dd1 get background =>
const _$a5ad3eaf62869fd7eb3d770139e27947e8686dd1();
_$021a869279104ac41a650f69ae9eb60afb135864 get defaultIcon =>
const _$021a869279104ac41a650f69ae9eb60afb135864();
}

extension $FontAssetsExtensions on FontThemeData {
String get notoSerifJP => "NotoSerifJP";
}

extension $FontTextStyleExtensions on TextStyle {
TextStyle withNotoSerifJPFont() => copyWith(fontFamily: "NotoSerifJP");
}

class _$01208c4b24c6b5e728eca36851bc335174a144dc {
const _$01208c4b24c6b5e728eca36851bc335174a144dc();

final path = "assets/icon.png";

ImageProvider get provider => AssetImage(path);
}

class _$f06c88961712f1c49d6696007c8b6c3da5a53947 {
const _$f06c88961712f1c49d6696007c8b6c3da5a53947();

final path = "assets/Localization.csv";

TextProvider get provider => AssetTextProvider(path);
}

class _$a5ad3eaf62869fd7eb3d770139e27947e8686dd1 {
const _$a5ad3eaf62869fd7eb3d770139e27947e8686dd1();

final path = "assets/background.jpg";

ImageProvider get provider => AssetImage(path);
}

class _$021a869279104ac41a650f69ae9eb60afb135864 {
const _$021a869279104ac41a650f69ae9eb60afb135864();

final path = "assets/default_icon.png";

ImageProvider get provider => AssetImage(path);
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
Loading

0 comments on commit e6eb848

Please sign in to comment.