Skip to content

Commit

Permalink
Publish Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bwolfs2 committed Aug 8, 2022
1 parent fe5a36a commit ecd0c85
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 70 deletions.
10 changes: 5 additions & 5 deletions example/integration_test/asuka_integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
10 changes: 6 additions & 4 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -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'),
},
);
}
Expand Down
24 changes: 12 additions & 12 deletions example/lib/src/home.controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
),
],
),
Expand All @@ -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),
),
],
Expand All @@ -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),
),
Expand All @@ -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),
),
],
Expand Down
41 changes: 21 additions & 20 deletions example/lib/src/home_page.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -9,7 +10,7 @@ class HomePage extends StatefulWidget {
const HomePage({Key key, this.title}) : super(key: key);

@override
_HomePageState createState() => _HomePageState();
State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
Expand All @@ -21,65 +22,65 @@ class _HomePageState extends State<HomePage> {
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();
},
Expand All @@ -98,9 +99,9 @@ class _HomePageState extends State<HomePage> {
),
],
),
TextField(),
const TextField(),
ElevatedButton(
child: Text('Show Modal Bottom Sheet'),
child: const Text('Show Modal Bottom Sheet'),
onPressed: () {
homeController.onClickModalBottomSheet();
},
Expand Down
26 changes: 13 additions & 13 deletions example/lib/src/second/second_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class SecondPage extends StatefulWidget {
const SecondPage({Key key, this.title}) : super(key: key);

@override
_SecondPageState createState() => _SecondPageState();
State<SecondPage> createState() => _SecondPageState();
}

class _SecondPageState extends State<SecondPage> {
Expand All @@ -16,7 +16,7 @@ class _SecondPageState extends State<SecondPage> {
resizeToAvoidBottomInset: false,
appBar: AppBar(
centerTitle: true,
title: Text("Asuka"),
title: const Text("Asuka"),
),
body: Center(
child: Column(
Expand All @@ -29,54 +29,54 @@ class _SecondPageState extends State<SecondPage> {
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);
}),
Expand Down
Loading

0 comments on commit ecd0c85

Please sign in to comment.