Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: examples/alice #194

Merged
merged 1 commit into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions examples/alice/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
1include: package:very_good_analysis/analysis_options.yaml
analyzer:
exclude:
- "lib/generated_plugin_registrant.dart"
- "**.g.dart"
- "**.mocks.dart"
- "**.gen.dart"

include: package:flutter_lints/flutter.yaml

linter:
rules:
public_member_api_docs: false
flutter_style_todos: false
avoid_final_parameters: false
sort_constructors_first: false
avoid_function_literals_in_foreach_calls: false
avoid_positional_boolean_parameters: false
use_if_null_to_convert_nulls_to_bools: false
use_build_context_synchronously: false
prefer_constructors_over_static_methods: false
use_setters_to_change_properties: false
avoid_print: false
sort_pub_dependencies: false
#library_annotations: false
52 changes: 26 additions & 26 deletions examples/alice/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
import 'package:alice/alice.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());
void main() => runApp(const MyApp());

class MyApp extends StatefulWidget {
const MyApp({super.key});

@override
_MyAppState createState() => _MyAppState();
State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
late Alice _alice;

@override
void initState() {
_alice = Alice(
showNotification: true,
showInspectorOnShake: true,
maxCallsCount: 1000,
);

super.initState();
}
late final Alice _alice = Alice(
showNotification: true,
showInspectorOnShake: true,
maxCallsCount: 1000,
);

@override
Widget build(BuildContext context) {
Expand All @@ -32,27 +27,32 @@ class _MyAppState extends State<MyApp> {
title: const Text('Alice HTTP Inspector - Example'),
),
body: Container(
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
child: ListView(
children: [
const SizedBox(height: 8),
Text(
'Welcome to example of Alice Http Inspector. Click buttons below to generate sample data.'),
const Text(
style: TextStyle(fontSize: 14),
'Welcome to example of Alice Http Inspector. '
'Click buttons below to generate sample data.',
),
ElevatedButton(
child: Text(
onPressed: _logExampleData,
child: const Text(
'Log example data',
),
onPressed: _logExampleData,
),
const SizedBox(height: 24),
Text(
'After clicking on buttons above, you should receive notification.'
' Click on it to show inspector. You can also shake your device or click button below.'),
const SizedBox(height: 8),
const Text(
style: TextStyle(fontSize: 14),
'After clicking on buttons above, you should receive notification.'
' Click on it to show inspector. You can also shake your device or click button below.',
),
ElevatedButton(
child: Text(
onPressed: _runHttpInspector,
child: const Text(
'Run HTTP Inspector',
),
onPressed: _runHttpInspector,
)
],
),
Expand Down Expand Up @@ -84,7 +84,7 @@ class _MyAppState extends State<MyApp> {
message: 'Warning log',
),
);
final notNumber = 'afs';
const String notNumber = 'afs';
try {
int.parse(notNumber);
} catch (e, stacktrace) {
Expand Down
4 changes: 2 additions & 2 deletions examples/alice/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ dependencies:
sdk: flutter
chopper: ^8.0.0
path_provider:
alice:

alice: any
dev_dependencies:
build_runner:
chopper_generator: ^8.0.0
very_good_analysis: ^5.1.0
flutter_lints: ^4.0.0

dependency_overrides:
alice:
Expand Down
Loading