Skip to content

Commit

Permalink
fix: all dart analyze warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ali77gh committed Mar 10, 2023
1 parent 9d45ad6 commit 5b822fb
Show file tree
Hide file tree
Showing 28 changed files with 91 additions and 117 deletions.
6 changes: 3 additions & 3 deletions example/lib/01_simple_text_sample/main.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import 'dart:async';

import 'package:app/01_simple_text_sample/simple_text_sample.dart';
import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {

return MaterialApp(
theme: ThemeData(fontFamily: 'IranSans'),
debugShowCheckedModeBanner: false,
home: TextSample()
home: const TextSample()
);
}
}
4 changes: 2 additions & 2 deletions example/lib/01_simple_text_sample/simple_text_sample.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'package:flutter/material.dart';
import 'package:telescope/src/telescope.dart';
import 'package:telescope/telescope.dart';


class TextSample extends StatefulWidget {
const TextSample({Key? key}) : super(key: key);

@override
State<TextSample> createState() => TextSampleState();
Expand All @@ -16,7 +17,6 @@ class TextSampleState extends State<TextSample> {
Widget build(BuildContext context) {

var style = const TextStyle(fontSize: 60);
print("build");
return Material(
type: MaterialType.transparency,
child: SafeArea(
Expand Down
8 changes: 6 additions & 2 deletions example/lib/02_object_apply_sample/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,25 @@ class Human{

@override
int get hashCode => (name.hashCode) * age.hashCode;

@override
bool operator ==(Object other) => hashCode==other.hashCode;
}

void main() {
runApp(MyApp());
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {

return MaterialApp(
theme: ThemeData(fontFamily: 'IranSans'),
debugShowCheckedModeBanner: false,
home: ObjectApplySampleLayout()
home: const ObjectApplySampleLayout()
);
}
}
5 changes: 2 additions & 3 deletions example/lib/02_object_apply_sample/object_apply_sample.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import 'package:app/02_object_apply_sample/main.dart';
import 'package:flutter/material.dart';
import 'package:telescope/src/telescope.dart';
import 'package:telescope/telescope.dart';


class ObjectApplySampleLayout extends StatefulWidget {
const ObjectApplySampleLayout({Key? key}) : super(key: key);

@override
State<ObjectApplySampleLayout> createState() => ObjectApplySampleLayoutState();
Expand All @@ -15,8 +16,6 @@ class ObjectApplySampleLayoutState extends State<ObjectApplySampleLayout> {

@override
Widget build(BuildContext context) {

print("build");
return Material(
type: MaterialType.transparency,
child: SafeArea(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import 'package:flutter/material.dart';
import 'package:telescope/src/telescope.dart';
import 'package:telescope/telescope.dart';


class DependObservableSampleLayout extends StatefulWidget {
const DependObservableSampleLayout({Key? key}) : super(key: key);

@override
State<DependObservableSampleLayout> createState() => DependObservableSampleLayoutState();
}
Expand Down Expand Up @@ -35,7 +37,6 @@ class DependObservableSampleLayoutState extends State<DependObservableSampleLayo
Widget build(BuildContext context) {

var style = const TextStyle(fontSize: 40);
print("build");
return Material(
type: MaterialType.transparency,
child: SafeArea(
Expand Down
6 changes: 4 additions & 2 deletions example/lib/03_depend_observable_sample/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ import 'package:app/03_depend_observable_sample/depends_on_sample.dart';
import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);


@override
Widget build(BuildContext context) {

return MaterialApp(
theme: ThemeData(fontFamily: 'IranSans'),
debugShowCheckedModeBanner: false,
home: DependObservableSampleLayout()
home: const DependObservableSampleLayout()
);
}
}
5 changes: 3 additions & 2 deletions example/lib/04_1_save_on_disk_sample/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ import 'package:flutter/material.dart';
import './save_on_disk_sample.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {

return MaterialApp(
theme: ThemeData(fontFamily: 'IranSans'),
debugShowCheckedModeBanner: false,
home: SaveOnDiskSampleLayout()
home: const SaveOnDiskSampleLayout()
);
}
}
5 changes: 3 additions & 2 deletions example/lib/04_1_save_on_disk_sample/save_on_disk_sample.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import 'package:flutter/material.dart';
import 'package:telescope/src/telescope.dart';
import 'package:telescope/telescope.dart';


class SaveOnDiskSampleLayout extends StatefulWidget {
const SaveOnDiskSampleLayout({Key? key}) : super(key: key);

@override
State<SaveOnDiskSampleLayout> createState() => SaveOnDiskSampleLayoutState();
}
Expand All @@ -26,7 +28,6 @@ class SaveOnDiskSampleLayoutState extends State<SaveOnDiskSampleLayout> {
Widget build(BuildContext context) {

var style = const TextStyle(fontSize: 40);
print("build");
return Material(
type: MaterialType.transparency,
child: SafeArea(
Expand Down
5 changes: 3 additions & 2 deletions example/lib/04_2_save_non_built_in_on_disk/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ import 'package:flutter/material.dart';
import './save_non_built_in_on_disk_sample.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {

return MaterialApp(
theme: ThemeData(fontFamily: 'IranSans'),
debugShowCheckedModeBanner: false,
home: SaveNonBuiltInOnDiskSampleLayout()
home: const SaveNonBuiltInOnDiskSampleLayout()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ class Human{

@override
int get hashCode => height*weight;

@override
bool operator ==(Object other) => hashCode==other.hashCode;
}
class HumanOnDiskAbility implements OnDiskSaveAbility<Human>{
@override
Expand All @@ -22,6 +25,8 @@ class HumanOnDiskAbility implements OnDiskSaveAbility<Human>{


class SaveNonBuiltInOnDiskSampleLayout extends StatefulWidget {
const SaveNonBuiltInOnDiskSampleLayout({Key? key}) : super(key: key);

@override
State<SaveNonBuiltInOnDiskSampleLayout> createState() => SaveNonBuiltInOnDiskSampleLayoutState();
}
Expand All @@ -44,7 +49,6 @@ class SaveNonBuiltInOnDiskSampleLayoutState extends State<SaveNonBuiltInOnDiskSa
Widget build(BuildContext context) {

var style = const TextStyle(fontSize: 40);
print("build");
return Material(
type: MaterialType.transparency,
child: SafeArea(
Expand Down
8 changes: 3 additions & 5 deletions example/lib/05_share_telescope_as_param/input_child.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:flutter/material.dart';
import 'package:telescope/src/telescope.dart';
import 'package:telescope/telescope.dart';

class InputLayout extends StatefulWidget {

Telescope<String> text;
InputLayout(this.text);
final Telescope<String> text;
const InputLayout(this.text, {Key? key}) : super(key: key);

@override
State<InputLayout> createState() => InputLayoutState();
Expand All @@ -14,8 +14,6 @@ class InputLayoutState extends State<InputLayout> {

@override
Widget build(BuildContext context) {

print("input build");
return TextField(
controller: TextEditingController(text: ""),
onChanged: (content){
Expand Down
5 changes: 3 additions & 2 deletions example/lib/05_share_telescope_as_param/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ import 'package:app/05_share_telescope_as_param/parent.dart';
import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {

return MaterialApp(
theme: ThemeData(fontFamily: 'IranSans'),
debugShowCheckedModeBanner: false,
home: ParentLayout()
home: const ParentLayout()
);
}
}
8 changes: 3 additions & 5 deletions example/lib/05_share_telescope_as_param/output_child.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:flutter/material.dart';
import 'package:telescope/src/telescope.dart';
import 'package:telescope/telescope.dart';

class OutputLayout extends StatefulWidget {

Telescope<String> text;
OutputLayout(this.text);
final Telescope<String> text;
const OutputLayout(this.text, {Key? key}) : super(key: key);

@override
State<OutputLayout> createState() => OutputLayoutState();
Expand All @@ -14,8 +14,6 @@ class OutputLayoutState extends State<OutputLayout> {

@override
Widget build(BuildContext context) {

print("output build");
return Text(widget.text.watch(this));
}
}
4 changes: 2 additions & 2 deletions example/lib/05_share_telescope_as_param/parent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'package:telescope/telescope.dart';


class ParentLayout extends StatefulWidget {
const ParentLayout({Key? key}) : super(key: key);

@override
State<ParentLayout> createState() => ParentLayoutState();
}
Expand All @@ -15,8 +17,6 @@ class ParentLayoutState extends State<ParentLayout> {

@override
Widget build(BuildContext context) {

print("parent build");
return Material(
type: MaterialType.transparency,
child: SafeArea(
Expand Down
4 changes: 2 additions & 2 deletions example/lib/06_1_list/list_sample.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'package:flutter/material.dart';
import 'package:telescope/src/telescope.dart';
import 'package:telescope/telescope.dart';
import 'dart:math';


class ListSampleLayout extends StatefulWidget {
const ListSampleLayout({Key? key}) : super(key: key);

@override
State<ListSampleLayout> createState() => ListSampleLayoutState();
}
Expand All @@ -30,7 +31,6 @@ class ListSampleLayoutState extends State<ListSampleLayout> {
@override
Widget build(BuildContext context) {

print("build");
return Material(
type: MaterialType.transparency,
child: SafeArea(
Expand Down
6 changes: 4 additions & 2 deletions example/lib/06_1_list/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ import './list_sample.dart';
import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);


@override
Widget build(BuildContext context) {

return MaterialApp(
theme: ThemeData(fontFamily: 'IranSans'),
debugShowCheckedModeBanner: false,
home: ListSampleLayout()
home: const ListSampleLayout()
);
}
}
5 changes: 2 additions & 3 deletions example/lib/06_2_list_on_disk/list_sample_on_disk.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'package:flutter/material.dart';
import 'package:telescope/src/telescope.dart';
import 'package:telescope/telescope.dart';
import 'dart:math';


class ListSampleOnDiskLayout extends StatefulWidget {
const ListSampleOnDiskLayout({Key? key}) : super(key: key);

@override
State<ListSampleOnDiskLayout > createState() => ListSampleOnDiskLayoutState();
}
Expand All @@ -29,8 +30,6 @@ class ListSampleOnDiskLayoutState extends State<ListSampleOnDiskLayout > {

@override
Widget build(BuildContext context) {

print("build");
return Material(
type: MaterialType.transparency,
child: SafeArea(
Expand Down
Loading

0 comments on commit 5b822fb

Please sign in to comment.