Skip to content

Commit 149b3f3

Browse files
authored
Linux support in example app & fix linter warnings (#190)
1 parent b71dcf8 commit 149b3f3

14 files changed

+528
-135
lines changed

example/analysis_options.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options

example/lib/detailscreen.dart

+31-20
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
22
import 'package:showcaseview/showcaseview.dart';
33

44
class Detail extends StatefulWidget {
5+
const Detail({Key? key}) : super(key: key);
6+
57
@override
68
_DetailState createState() => _DetailState();
79
}
@@ -14,9 +16,10 @@ class _DetailState extends State<Detail> {
1416
void initState() {
1517
super.initState();
1618
WidgetsBinding.instance!.addPostFrameCallback(
17-
(_) => Future.delayed(Duration(milliseconds: 200), () {
18-
ShowCaseWidget.of(myContext!)!.startShowCase([_one]);
19-
}));
19+
(_) => Future.delayed(const Duration(milliseconds: 200), () {
20+
ShowCaseWidget.of(myContext!)!.startShowCase([_one]);
21+
}),
22+
);
2023
}
2124

2225
@override
@@ -30,7 +33,7 @@ class _DetailState extends State<Detail> {
3033
backgroundColor: Colors.transparent,
3134
elevation: 0,
3235
leading: IconButton(
33-
icon: Icon(
36+
icon: const Icon(
3437
Icons.arrow_back,
3538
color: Colors.black,
3639
),
@@ -40,7 +43,7 @@ class _DetailState extends State<Detail> {
4043
),
4144
),
4245
body: Padding(
43-
padding: const EdgeInsets.all(16.0),
46+
padding: const EdgeInsets.all(16),
4447
child: ListView(
4548
children: <Widget>[
4649
Showcase(
@@ -49,40 +52,48 @@ class _DetailState extends State<Detail> {
4952
description: 'Desc',
5053
child: InkWell(
5154
onTap: () {},
52-
child: Text(
55+
child: const Text(
5356
'Flutter Notification',
5457
style: TextStyle(
55-
fontSize: 25, fontWeight: FontWeight.w600),
58+
fontSize: 25,
59+
fontWeight: FontWeight.w600,
60+
),
5661
),
5762
),
5863
),
59-
SizedBox(
64+
const SizedBox(
6065
height: 16,
6166
),
62-
Text(
67+
const Text(
6368
'Hi, you have new Notification from flutter group, open slack and check it out',
6469
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
6570
),
66-
SizedBox(
71+
const SizedBox(
6772
height: 16,
6873
),
6974
RichText(
70-
text: TextSpan(
75+
text: const TextSpan(
7176
style: TextStyle(
72-
fontWeight: FontWeight.w400, color: Colors.black),
77+
fontWeight: FontWeight.w400,
78+
color: Colors.black,
79+
),
7380
children: [
7481
TextSpan(text: 'Hi team,\n\n'),
7582
TextSpan(
76-
text:
77-
'As some of you know, we’re moving to Slack for our internal team communications. Slack is a messaging app where we can talk, share files, and work together. It also connects with tools we already use, like [add your examples here], plus 900+ other apps.\n\n'),
83+
text:
84+
'As some of you know, we’re moving to Slack for our internal team communications. Slack is a messaging app where we can talk, share files, and work together. It also connects with tools we already use, like [add your examples here], plus 900+ other apps.\n\n',
85+
),
7886
TextSpan(
79-
text: 'Why are we moving to Slack?\n\n',
80-
style: TextStyle(
81-
fontWeight: FontWeight.w600,
82-
color: Colors.black)),
87+
text: 'Why are we moving to Slack?\n\n',
88+
style: TextStyle(
89+
fontWeight: FontWeight.w600,
90+
color: Colors.black,
91+
),
92+
),
8393
TextSpan(
84-
text:
85-
'We want to use the best communication tools to make our lives easier and be more productive. Having everything in one place will help us work together better and faster, rather than jumping around between emails, IMs, texts and a bunch of other programs. Everything you share in Slack is automatically indexed and archived, creating a searchable archive of all our work.'),
94+
text:
95+
'We want to use the best communication tools to make our lives easier and be more productive. Having everything in one place will help us work together better and faster, rather than jumping around between emails, IMs, texts and a bunch of other programs. Everything you share in Slack is automatically indexed and archived, creating a searchable archive of all our work.',
96+
),
8697
],
8798
),
8899
),

0 commit comments

Comments
 (0)