Skip to content

Commit

Permalink
Fix example runners for IJ/AS and Code to use the new folder names
Browse files Browse the repository at this point in the history
- Scrollbehavior drag also with pen and trackpad
- Examples 1,2,3,4 Set ListView primary to true in PageBody
- Copy-paste from playground, use typography 2021
  • Loading branch information
rydmike committed Aug 11, 2022
1 parent be0672f commit 7658e4e
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .run/Example theme - Copy Paste.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Example theme - Copy Playground Theme" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/example/lib/example_copy_paste/main.dart" />
<option name="filePath" value="$PROJECT_DIR$/example/lib/example_copy_paste_from_playground/main.dart" />
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion .run/Example1.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Example1 - Basic Theme Usage" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/example/lib/example1/main.dart" />
<option name="filePath" value="$PROJECT_DIR$/example/lib/example1_basic_theme_usage/main.dart" />
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion .run/Example2.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Example2 - Custom Theme" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/example/lib/example2/main.dart" />
<option name="filePath" value="$PROJECT_DIR$/example/lib/example2_custom_theme/main.dart" />
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion .run/Example3.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Example3 - Four Themes" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/example/lib/example3/main.dart" />
<option name="filePath" value="$PROJECT_DIR$/example/lib/example3_four_themes/main.dart" />
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion .run/Example4.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Example4 - All Themes" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/example/lib/example4/main.dart" />
<option name="filePath" value="$PROJECT_DIR$/example/lib/example4_all_themes/main.dart" />
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion .run/Example5.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Example5 - Themes Playground" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/example/lib/example5/main.dart" />
<option name="filePath" value="$PROJECT_DIR$/example/lib/example5_themes_playground/main.dart" />
<method v="2" />
</configuration>
</component>
12 changes: 6 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,42 @@
"cwd": "example",
"request": "launch",
"type": "dart",
"program": "lib/example_copy_paste/main.dart"
"program": "lib/example_copy_paste_from_playground/main.dart"
},
{
"name": "Example 1 - Basic Theme Usage",
"cwd": "example",
"request": "launch",
"type": "dart",
"program": "lib/example1/main.dart"
"program": "lib/example1_basic_theme_usage/main.dart"
},
{
"name": "Example 2 - Custom Theme",
"cwd": "example",
"request": "launch",
"type": "dart",
"program": "lib/example2/main.dart"
"program": "lib/example2_custom_theme/main.dart"
},
{
"name": "Example 3 - Four Themes",
"cwd": "example",
"request": "launch",
"type": "dart",
"program": "lib/example3/main.dart"
"program": "lib/example3_four_themes/main.dart"
},
{
"name": "Example 4 - All Themes",
"cwd": "example",
"request": "launch",
"type": "dart",
"program": "lib/example4/main.dart"
"program": "lib/example4_all_themes/main.dart"
},
{
"name": "Example 5 - Themes Playground",
"cwd": "example",
"request": "launch",
"type": "dart",
"program": "lib/example5/main.dart"
"program": "lib/example5_themes_playground/main.dart"
}
]
}
1 change: 1 addition & 0 deletions example/lib/example1_basic_theme_usage/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class HomePage extends StatelessWidget {
body: PageBody(
constraints: const BoxConstraints(maxWidth: AppData.maxBodyWidth),
child: ListView(
primary: true,
padding: EdgeInsets.all(margins),
children: <Widget>[
const Text(
Expand Down
1 change: 1 addition & 0 deletions example/lib/example2_custom_theme/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class HomePage extends StatelessWidget {
body: PageBody(
constraints: const BoxConstraints(maxWidth: AppData.maxBodyWidth),
child: ListView(
primary: true,
padding: EdgeInsets.all(margins),
children: <Widget>[
const Text(
Expand Down
1 change: 1 addition & 0 deletions example/lib/example3_four_themes/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class HomePage extends StatelessWidget {
body: PageBody(
constraints: const BoxConstraints(maxWidth: AppData.maxBodyWidth),
child: ListView(
primary: true,
padding: EdgeInsets.all(margins),
children: <Widget>[
const Text(
Expand Down
1 change: 1 addition & 0 deletions example/lib/example4_all_themes/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class HomePage extends StatelessWidget {
body: PageBody(
constraints: const BoxConstraints(maxWidth: AppData.maxBodyWidth),
child: ListView(
primary: true,
padding: EdgeInsets.all(margins),
children: <Widget>[
const Text(
Expand Down
8 changes: 4 additions & 4 deletions example/lib/example_copy_paste_from_playground/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class _DemoAppState extends State<DemoApp> {
// Material Design 2 color scheme, uncomment and use the theme setup below
// and comment the copy-pasted themes further below,
theme: ThemeData.from(colorScheme: const ColorScheme.light()).copyWith(
typography: Typography.material2018(platform: defaultTargetPlatform),
typography: Typography.material2021(platform: defaultTargetPlatform),
),
darkTheme: ThemeData.from(colorScheme: const ColorScheme.dark()).copyWith(
typography: Typography.material2018(platform: defaultTargetPlatform),
typography: Typography.material2021(platform: defaultTargetPlatform),
),

// This is where you would put a copy-pasted theme definition from
Expand Down Expand Up @@ -99,10 +99,10 @@ class _DemoAppState extends State<DemoApp> {
// FlexThemeData extensions and opinionated component themes.

// theme: ThemeData.from(colorScheme: flexSchemeLight).copyWith(
// typography: Typography.material2018(platform: defaultTargetPlatform),
// typography: Typography.material2021(platform: defaultTargetPlatform),
// ),
// darkTheme: ThemeData.from(colorScheme: flexSchemeDark).copyWith(
// typography: Typography.material2018(platform: defaultTargetPlatform),
// typography: Typography.material2021(platform: defaultTargetPlatform),
// ),

// ThemeMode toggle via callback
Expand Down
2 changes: 1 addition & 1 deletion example/lib/shared/const/app_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AppData {
static const String versionBuild = '01';
static const String version = '$versionMajor.2.0 Build-$versionBuild';
static const String packageVersion = '5.2.0-dev.1';
static const String flutterVersion = 'master 3.1.0-0.0.pre.2199';
static const String flutterVersion = 'master 3.1.0-0.0.pre.2216';
static const String copyright = '© 2020, 2021, 2022';
static const String author = 'Mike Rydstrom';
static const String license = 'BSD 3-Clause License';
Expand Down
2 changes: 2 additions & 0 deletions example/lib/shared/utils/app_scroll_behavior.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class AppScrollBehavior extends MaterialScrollBehavior {
Set<PointerDeviceKind> get dragDevices => <PointerDeviceKind>{
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
PointerDeviceKind.trackpad,
PointerDeviceKind.stylus,
};
}

Expand Down

0 comments on commit 7658e4e

Please sign in to comment.