Skip to content

Commit 778eaba

Browse files
committed
Update
1 parent 3907806 commit 778eaba

12 files changed

+70
-147
lines changed

analysis_options.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:flutter_lints/flutter.yaml

example/analysis_options.yaml

+1-28
Original file line numberDiff line numberDiff line change
@@ -1,28 +1 @@
1-
# This file configures the analyzer, which statically analyzes Dart code to
2-
# check for errors, warnings, and lints.
3-
#
4-
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5-
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6-
# invoked from the command line by running `flutter analyze`.
7-
8-
# The following line activates a set of recommended lints for Flutter apps,
9-
# packages, and plugins designed to encourage good coding practices.
10-
include: package:flutter_lints/flutter.yaml
11-
12-
linter:
13-
# The lint rules applied to this project can be customized in the
14-
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15-
# included above or to enable additional rules. A list of all available lints
16-
# and their documentation is published at https://dart.dev/lints.
17-
#
18-
# Instead of disabling a lint rule for the entire project in the
19-
# section below, it can also be suppressed for a single line of code
20-
# or a specific dart file by using the `// ignore: name_of_lint` and
21-
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
22-
# producing the lint.
23-
rules:
24-
# avoid_print: false # Uncomment to disable the `avoid_print` rule
25-
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26-
27-
# Additional information about this file can be found at
28-
# https://dart.dev/guides/language/analysis-options
1+
include: package:flutter_lints/flutter.yaml

example/ios/Flutter/Debug.xcconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "Generated.xcconfig"

example/ios/Flutter/Release.xcconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "Generated.xcconfig"

example/ios/Podfile

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '12.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24+
end
25+
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
30+
target 'Runner' do
31+
use_frameworks!
32+
use_modular_headers!
33+
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35+
target 'RunnerTests' do
36+
inherit! :search_paths
37+
end
38+
end
39+
40+
post_install do |installer|
41+
installer.pods_project.targets.each do |target|
42+
flutter_additional_ios_build_settings(target)
43+
end
44+
end

example/lib/main.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ class CenteredText extends StatelessWidget {
1515
return ExamplePage(Icons.text_fields, (context) => const CenteredText());
1616
}
1717

18-
const CenteredText();
18+
const CenteredText({super.key});
1919

2020
@override
2121
Widget build(BuildContext context) {
22-
return Center(
22+
return const Center(
2323
child: Text('Very simple example'),
2424
);
2525
}

example/pubspec.yaml

+8-75
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,23 @@
11
name: example
2-
description: "A new Flutter project."
3-
# The following line prevents the package from being accidentally published to
4-
# pub.dev using `flutter pub publish`. This is preferred for private packages.
2+
description: A new Flutter project.
53
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
64

7-
# The following defines the version and build number for your application.
8-
# A version number is three numbers separated by dots, like 1.2.43
9-
# followed by an optional build number separated by a +.
10-
# Both the version and the builder number may be overridden in flutter
11-
# build by specifying --build-name and --build-number, respectively.
12-
# In Android, build-name is used as versionName while build-number used as versionCode.
13-
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
14-
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
15-
# Read more about iOS versioning at
16-
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
17-
# In Windows, build-name is used as the major, minor, and patch parts
18-
# of the product and file versions while build-number is used as the build suffix.
19-
version: 1.0.0+1
5+
version: 1.0.0
206

217
environment:
22-
sdk: '>=3.4.4 <4.0.0'
8+
sdk: ^3.3.0
9+
flutter: '>=3.19.0'
2310

24-
# Dependencies specify other packages that your package needs in order to work.
25-
# To automatically upgrade your package dependencies to the latest versions
26-
# consider running `flutter pub upgrade --major-versions`. Alternatively,
27-
# dependencies can be manually updated by changing the version numbers below to
28-
# the latest version available on pub.dev. To see which dependencies have newer
29-
# versions available, run `flutter pub outdated`.
3011
dependencies:
3112
flutter:
3213
sdk: flutter
33-
34-
35-
# The following adds the Cupertino Icons font to your application.
36-
# Use with the CupertinoIcons class for iOS style icons.
37-
cupertino_icons: ^1.0.6
14+
baseflow_plugin_template:
15+
path: ../
3816

3917
dev_dependencies:
4018
flutter_test:
4119
sdk: flutter
20+
flutter_lints: ^4.0.0
4221

43-
# The "flutter_lints" package below contains a set of recommended lints to
44-
# encourage good coding practices. The lint set provided by the package is
45-
# activated in the `analysis_options.yaml` file located at the root of your
46-
# package. See that file for information about deactivating specific lint
47-
# rules and activating additional ones.
48-
flutter_lints: ^3.0.0
49-
50-
# For information on the generic Dart part of this file, see the
51-
# following page: https://dart.dev/tools/pub/pubspec
52-
53-
# The following section is specific to Flutter packages.
5422
flutter:
55-
56-
# The following line ensures that the Material Icons font is
57-
# included with your application, so that you can use the icons in
58-
# the material Icons class.
59-
uses-material-design: true
60-
61-
# To add assets to your application, add an assets section, like this:
62-
# assets:
63-
# - images/a_dot_burr.jpeg
64-
# - images/a_dot_ham.jpeg
65-
66-
# An image asset can refer to one or more resolution-specific "variants", see
67-
# https://flutter.dev/assets-and-images/#resolution-aware
68-
69-
# For details regarding adding assets from package dependencies, see
70-
# https://flutter.dev/assets-and-images/#from-packages
71-
72-
# To add custom fonts to your application, add a fonts section here,
73-
# in this "flutter" section. Each entry in this list should have a
74-
# "family" key with the font family name, and a "fonts" key with a
75-
# list giving the asset and other descriptors for the font. For
76-
# example:
77-
# fonts:
78-
# - family: Schyler
79-
# fonts:
80-
# - asset: fonts/Schyler-Regular.ttf
81-
# - asset: fonts/Schyler-Italic.ttf
82-
# style: italic
83-
# - family: Trajan Pro
84-
# fonts:
85-
# - asset: fonts/TrajanPro.ttf
86-
# - asset: fonts/TrajanPro_Bold.ttf
87-
# weight: 700
88-
#
89-
# For details regarding fonts from package dependencies,
90-
# see https://flutter.dev/custom-fonts/#from-packages
23+
uses-material-design: true

example/test/widget_test.dart

-30
This file was deleted.

lib/src/app.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ class BaseflowPluginExample extends StatelessWidget {
1515
createMaterialColor(const Color.fromRGBO(48, 49, 60, 1));
1616

1717
BaseflowPluginExample({
18-
Key? key,
18+
super.key,
1919
required this.pluginName,
2020
required String githubURL,
2121
required String pubDevURL,
2222
required this.pages,
2323
this.appBarActions,
24-
}) : super(key: key) {
24+
}) {
2525
pages.add(InfoPage.createPage(pluginName, githubURL, pubDevURL));
2626
}
2727

@@ -40,12 +40,12 @@ class BaseflowPluginExample extends StatelessWidget {
4040
splashColor: themeMaterialColor.shade50,
4141
textTheme: ButtonTextTheme.primary,
4242
),
43-
bottomAppBarTheme: BottomAppBarTheme(
44-
color: const Color.fromRGBO(57, 58, 71, 1),
43+
bottomAppBarTheme: const BottomAppBarTheme(
44+
color: Color.fromRGBO(57, 58, 71, 1),
4545
),
4646
hintColor: themeMaterialColor.shade500,
4747
primarySwatch: createMaterialColor(const Color.fromRGBO(48, 49, 60, 1)),
48-
textTheme: TextTheme(
48+
textTheme: const TextTheme(
4949
bodyLarge: TextStyle(
5050
color: Colors.white,
5151
fontSize: 16,

lib/src/home.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import 'package:flutter/material.dart';
44
/// A Flutter example demonstrating how the [pluginName] plugin could be used
55
class AppHome extends StatefulWidget {
66
/// Constructs the [AppHome] class
7-
AppHome({
8-
Key? key,
7+
const AppHome({
8+
super.key,
99
required this.title,
1010
required this.pages,
1111
this.appBarActions,
12-
}) : super(key: key);
12+
});
1313

1414
/// The [title] of the application, which is shown in the application's
1515
/// title bar.
@@ -18,7 +18,7 @@ class AppHome extends StatefulWidget {
1818
final List<Widget>? appBarActions;
1919

2020
@override
21-
_AppHomeState createState() => _AppHomeState();
21+
State createState() => _AppHomeState();
2222
}
2323

2424
class _AppHomeState extends State<AppHome> {

lib/src/info_page.dart

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class InfoPage extends StatelessWidget {
1111
String githubUrl,
1212
String pubDevUrl,
1313
) {
14-
return new ExamplePage(
14+
return ExamplePage(
1515
Icons.info_outline,
1616
(context) => InfoPage._(
1717
pluginName: pluginName,
@@ -25,11 +25,10 @@ class InfoPage extends StatelessWidget {
2525
final String pubDevUrl;
2626

2727
const InfoPage._({
28-
Key? key,
2928
required this.pluginName,
3029
required this.githubUrl,
3130
required this.pubDevUrl,
32-
}) : super(key: key);
31+
});
3332

3433
@override
3534
Widget build(BuildContext context) {

pubspec.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ dependencies:
1515
dev_dependencies:
1616
flutter_test:
1717
sdk: flutter
18+
flutter_lints: ^4.0.0
1819

1920
flutter:
2021
uses-material-design: true

0 commit comments

Comments
 (0)