diff --git a/example/integration_test/asuka_integration_test.dart b/example/integration_test/asuka_integration_test.dart index e233d0a..3e7569e 100644 --- a/example/integration_test/asuka_integration_test.dart +++ b/example/integration_test/asuka_integration_test.dart @@ -97,7 +97,7 @@ void main() { MaterialApp( builder: Asuka.builder, home: Scaffold( - backgroundColor: Color.fromARGB(255, 230, 227, 227), + backgroundColor: const Color.fromARGB(255, 230, 227, 227), body: Builder( builder: (context) { return Center( @@ -137,7 +137,7 @@ void main() { MaterialApp( builder: Asuka.builder, home: Scaffold( - backgroundColor: Color.fromARGB(255, 230, 227, 227), + backgroundColor: const Color.fromARGB(255, 230, 227, 227), body: Builder( builder: (context) { return Center( @@ -186,7 +186,7 @@ void main() { MaterialApp( builder: Asuka.builder, home: Scaffold( - backgroundColor: Color.fromARGB(255, 230, 227, 227), + backgroundColor: const Color.fromARGB(255, 230, 227, 227), body: Builder( builder: (context) { return Center( @@ -248,7 +248,7 @@ void main() { MaterialApp( builder: Asuka.builder, home: Scaffold( - backgroundColor: Color.fromARGB(255, 230, 227, 227), + backgroundColor: const Color.fromARGB(255, 230, 227, 227), body: Builder( builder: (context) { return Center( @@ -310,7 +310,7 @@ MaterialApp showSnackbar(AsukaSnackbar asukaSnackbar, String buttonText) { return MaterialApp( builder: Asuka.builder, home: Scaffold( - backgroundColor: Color.fromARGB(255, 230, 227, 227), + backgroundColor: const Color.fromARGB(255, 230, 227, 227), body: Builder( builder: (context) { return Center( diff --git a/example/lib/main.dart b/example/lib/main.dart index a1c74ba..54d9cc9 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,14 +1,16 @@ +import 'package:asuka/asuka.dart'; import 'package:example/src/home_page.dart'; import 'package:flutter/material.dart'; -import 'package:asuka/asuka.dart'; import 'src/second/second_page.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( @@ -21,8 +23,8 @@ class MyApp extends StatelessWidget { initialRoute: '/', navigatorObservers: [Asuka.asukaHeroController], routes: { - '/': (_) => HomePage(title: 'Asuka'), - '/second': (_) => SecondPage(title: 'Second page'), + '/': (_) => const HomePage(title: 'Asuka'), + '/second': (_) => const SecondPage(title: 'Second page'), }, ); } diff --git a/example/lib/src/home.controller.dart b/example/lib/src/home.controller.dart index f0548ed..5c89d7c 100644 --- a/example/lib/src/home.controller.dart +++ b/example/lib/src/home.controller.dart @@ -3,26 +3,26 @@ import 'package:flutter/material.dart'; class HomeController { void onClickSnackbar() { - Asuka.showSnackBar(SnackBar(content: Text('New snackBar!!!'))); + Asuka.showSnackBar(const SnackBar(content: Text('New snackBar!!!'))); } void onClickDialog() { Asuka.showDialog( builder: (context) => AlertDialog( - title: Text('My Dialog'), - content: Text('This is Dialog Content'), + title: const Text('My Dialog'), + content: const Text('This is Dialog Content'), actions: [ TextButton( onPressed: () { Navigator.pop(context); }, - child: Text('Cancel'), + child: const Text('Cancel'), ), TextButton( onPressed: () { Navigator.pop(context); }, - child: Text('Ok'), + child: const Text('Ok'), ), ], ), @@ -37,14 +37,14 @@ class HomeController { height: MediaQuery.of(context).size.height / 2, child: ListView( children: [ - ListTile( + const ListTile( title: Text('Option 1'), ), - ListTile( + const ListTile( title: Text('Option 2'), ), ListTile( - title: Text('Cancel'), + title: const Text('Cancel'), onTap: () => Navigator.pop(context), ), ], @@ -57,7 +57,7 @@ class HomeController { void onClickModalBottomSheet() { Asuka.showModalBottomSheet( builder: (context) => Material( - borderRadius: BorderRadius.only( + borderRadius: const BorderRadius.only( topLeft: Radius.circular(16), topRight: Radius.circular(16), ), @@ -66,14 +66,14 @@ class HomeController { height: MediaQuery.of(context).size.height / 2, child: ListView( children: [ - ListTile( + const ListTile( title: Text('Option 1'), ), - ListTile( + const ListTile( title: Text('Option 2'), ), ListTile( - title: Text('Cancel'), + title: const Text('Cancel'), onTap: () => Navigator.pop(context), ), ], diff --git a/example/lib/src/home_page.dart b/example/lib/src/home_page.dart index d911908..518638d 100644 --- a/example/lib/src/home_page.dart +++ b/example/lib/src/home_page.dart @@ -1,5 +1,6 @@ import 'package:asuka/snackbars/asuka_snack_bar.dart'; import 'package:flutter/material.dart'; + import 'home.controller.dart'; import 'second/second_page.dart'; @@ -9,7 +10,7 @@ class HomePage extends StatefulWidget { const HomePage({Key key, this.title}) : super(key: key); @override - _HomePageState createState() => _HomePageState(); + State createState() => _HomePageState(); } class _HomePageState extends State { @@ -21,65 +22,65 @@ class _HomePageState extends State { backgroundColor: Colors.grey[200], appBar: AppBar( centerTitle: true, - title: Text("Asuka"), + title: const Text("Asuka"), ), body: ListView( - padding: EdgeInsets.all(20), + padding: const EdgeInsets.all(20), children: [ ElevatedButton( - child: Text('Second Page'), + child: const Text('Second Page'), onPressed: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => SecondPage(), + builder: (context) => const SecondPage(), ), ); }, ), - SizedBox(height: 10), - Divider(), - SizedBox(height: 10), + const SizedBox(height: 10), + const Divider(), + const SizedBox(height: 10), ElevatedButton( - child: Text('SnackBar'), onPressed: homeController.onClickSnackbar, + child: const Text('SnackBar'), ), - SizedBox(height: 10), + const SizedBox(height: 10), ElevatedButton( - child: Text('Dialog'), onPressed: homeController.onClickDialog, + child: const Text('Dialog'), ), - SizedBox(height: 10), + const SizedBox(height: 10), ElevatedButton( - child: Text('ModalSheet'), + child: const Text('ModalSheet'), onPressed: () => homeController.onClickBottomSheet(), ), ElevatedButton( - child: Text('SnackBar Warning'), + child: const Text('SnackBar Warning'), onPressed: () { AsukaSnackbar.warning("Warning").show(); }, ), ElevatedButton( - child: Text('SnackBar Success'), + child: const Text('SnackBar Success'), onPressed: () { AsukaSnackbar.success("Success").show(); }, ), ElevatedButton( - child: Text('SnackBar alert'), + child: const Text('SnackBar alert'), onPressed: () { AsukaSnackbar.alert("alert").show(); }, ), ElevatedButton( - child: Text('SnackBar info'), + child: const Text('SnackBar info'), onPressed: () { AsukaSnackbar.info("info").show(); }, ), ElevatedButton( - child: Text('SnackBar message'), + child: const Text('SnackBar message'), onPressed: () { AsukaSnackbar.message("message").show(); }, @@ -98,9 +99,9 @@ class _HomePageState extends State { ), ], ), - TextField(), + const TextField(), ElevatedButton( - child: Text('Show Modal Bottom Sheet'), + child: const Text('Show Modal Bottom Sheet'), onPressed: () { homeController.onClickModalBottomSheet(); }, diff --git a/example/lib/src/second/second_page.dart b/example/lib/src/second/second_page.dart index 5710a94..ca60df8 100644 --- a/example/lib/src/second/second_page.dart +++ b/example/lib/src/second/second_page.dart @@ -6,7 +6,7 @@ class SecondPage extends StatefulWidget { const SecondPage({Key key, this.title}) : super(key: key); @override - _SecondPageState createState() => _SecondPageState(); + State createState() => _SecondPageState(); } class _SecondPageState extends State { @@ -16,7 +16,7 @@ class _SecondPageState extends State { resizeToAvoidBottomInset: false, appBar: AppBar( centerTitle: true, - title: Text("Asuka"), + title: const Text("Asuka"), ), body: Center( child: Column( @@ -29,54 +29,54 @@ class _SecondPageState extends State { color: Colors.red, ), ), - TextField(), + const TextField(), ElevatedButton( - child: Text('Back to Home'), + child: const Text('Back to Home'), onPressed: () { Navigator.pop(context); }), ElevatedButton( - child: Text('Back to Home'), + child: const Text('Back to Home'), onPressed: () { Navigator.pop(context); }), ElevatedButton( - child: Text('Back to Home'), + child: const Text('Back to Home'), onPressed: () { Navigator.pop(context); }), ElevatedButton( - child: Text('Back to Home'), + child: const Text('Back to Home'), onPressed: () { Navigator.pop(context); }), ElevatedButton( - child: Text('Back to Home'), + child: const Text('Back to Home'), onPressed: () { Navigator.pop(context); }), ElevatedButton( - child: Text('Back to Home'), + child: const Text('Back to Home'), onPressed: () { Navigator.pop(context); }), ElevatedButton( - child: Text('Back to Home'), + child: const Text('Back to Home'), onPressed: () { Navigator.pop(context); }), ElevatedButton( - child: Text('Back to Home'), + child: const Text('Back to Home'), onPressed: () { Navigator.pop(context); }), ElevatedButton( - child: Text('Back to Home'), + child: const Text('Back to Home'), onPressed: () { Navigator.pop(context); }), ElevatedButton( - child: Text('Back to Home'), + child: const Text('Back to Home'), onPressed: () { Navigator.pop(context); }), diff --git a/example/pubspec.lock b/example/pubspec.lock index 1ffdc1d..8b134d1 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -14,14 +14,14 @@ packages: path: ".." relative: true source: path - version: "2.0.0" + version: "2.0.1" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.9.0" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -35,7 +35,14 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" clock: dependency: transitive description: @@ -56,7 +63,7 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "3.0.1" cupertino_icons: dependency: "direct main" description: @@ -88,6 +95,13 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -103,6 +117,13 @@ packages: description: flutter source: sdk version: "0.0.0" + lints: + dependency: transitive + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" matcher: dependency: transitive description: @@ -156,7 +177,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.9.0" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -177,7 +198,7 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.0" sync_http: dependency: transitive description: @@ -205,7 +226,7 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.3.0" vector_math: dependency: transitive description: @@ -219,7 +240,7 @@ packages: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "8.3.0" + version: "8.2.2" webdriver: dependency: transitive description: @@ -228,4 +249,5 @@ packages: source: hosted version: "3.0.0" sdks: - dart: ">=2.17.0-0 <3.0.0" + dart: ">=2.17.0-206.0.dev <3.0.0" + flutter: ">=2.3.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index bd71d47..76b3703 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -32,6 +32,7 @@ dependencies: cupertino_icons: ^0.1.3 dev_dependencies: + flutter_lints: flutter_test: sdk: flutter integration_test: diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart index 747db1d..f3c1285 100644 --- a/example/test/widget_test.dart +++ b/example/test/widget_test.dart @@ -5,15 +5,14 @@ // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. +import 'package:example/main.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:example/main.dart'; - void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); + await tester.pumpWidget(const MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); diff --git a/pubspec.lock b/pubspec.lock index b1ed4e7..4b68540 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.9.0" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,7 +21,14 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" clock: dependency: transitive description: @@ -92,7 +99,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.9.0" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -113,7 +120,7 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.0" term_glyph: dependency: transitive description: @@ -137,3 +144,4 @@ packages: version: "2.1.2" sdks: dart: ">=2.17.0-0 <3.0.0" + flutter: ">=2.3.0" diff --git a/pubspec.yaml b/pubspec.yaml index 9c16133..81b5370 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,6 +6,10 @@ homepage: https://github.com/Flutterando/asuka environment: sdk: ">=2.12.0-0 <3.0.0" flutter: ">=2.3.0 <4.0.0" + +dependencies: + flutter: + sdk: flutter dev_dependencies: