Skip to content

Commit

Permalink
Fix di Dart allo stile.
Browse files Browse the repository at this point in the history
Took 12 seconds
  • Loading branch information
emiliodallatorre committed Oct 24, 2023
1 parent 5f9f657 commit b57444c
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/interface/pages/book_sell_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class _BookSellPageState extends State<BookSellPage> {
@override
void initState() {
if (!Provider.of<UserModel>(context, listen: false).hasGoneThroughShowcase!)
WidgetsBinding.instance!.addPostFrameCallback((_) => ShowCaseWidget.of(context)?.startShowCase([
WidgetsBinding.instance.addPostFrameCallback((_) => ShowCaseWidget.of(context).startShowCase([
Keys.floatingActionButtonKey,
Keys.chatKey,
Keys.searchBottomKey,
Expand Down
12 changes: 6 additions & 6 deletions lib/interface/screen/book_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class _BookScreenState extends State<BookScreen> {
children: [
BookCover(book: _book!, horizontalPadding: false),

Text(S.current.bookState, style: Theme.of(context).textTheme.headline4),
Text(S.current.bookState, style: Theme.of(context).textTheme.headlineMedium),
Column(
children: [
Row(
Expand All @@ -95,7 +95,7 @@ class _BookScreenState extends State<BookScreen> {
),
],
),
if (_book!.note!.isNotEmpty) Text(S.current.note, style: Theme.of(context).textTheme.caption),
if (_book!.note!.isNotEmpty) Text(S.current.note, style: Theme.of(context).textTheme.bodySmall),
if (_book!.note!.isNotEmpty) Text(_book!.note!),
if (_book!.userUid != Provider.of<UserModel>(context).uid) _buildSellerInfo(context),
// _buildSellerInfo(context),
Expand All @@ -113,15 +113,15 @@ class _BookScreenState extends State<BookScreen> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Divider(),
Text(S.current.soldBy, style: Theme.of(context).textTheme.headline4),
Text(S.current.soldBy, style: Theme.of(context).textTheme.headlineMedium),
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(_book!.user!.displayName, style: Theme.of(context).textTheme.headline6),
Text(_book!.user!.city!, style: Theme.of(context).textTheme.caption),
Text(_book!.user!.displayName, style: Theme.of(context).textTheme.titleLarge),
Text(_book!.user!.city!, style: Theme.of(context).textTheme.bodySmall),
],
),
],
Expand Down Expand Up @@ -172,7 +172,7 @@ class _BookScreenState extends State<BookScreen> {
children: [
Padding(
padding: const EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
child: Text(S.current.removeBookFromSell, style: Theme.of(context).textTheme.headline5),
child: Text(S.current.removeBookFromSell, style: Theme.of(context).textTheme.headlineSmall),
),
ListTile(
title: Text(S.current.removeBookBecauseSell),
Expand Down
2 changes: 1 addition & 1 deletion lib/interface/screen/isbn_editor_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class _IsbnEditorScreenState extends State<IsbnEditorScreen> {
authorUid: Provider.of<UserModel>(context, listen: false).uid,
);

WidgetsBinding.instance!.addPostFrameCallback((_) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!shownFirstFrame) {
shownFirstFrame = true;

Expand Down
6 changes: 3 additions & 3 deletions lib/interface/screen/login_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class LoginScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(S.current.login, style: Theme.of(context).textTheme.headline5),
Text(S.current.login, style: Theme.of(context).textTheme.headlineSmall),
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: state.loginStep == LoginStep.SIGN_IN
Expand All @@ -110,10 +110,10 @@ class LoginScreen extends StatelessWidget {
InputCodeField(
control: state.codeController,
autofocus: true,
decoration: InputCodeDecoration(textStyle: Theme.of(context).textTheme.headline5),
decoration: InputCodeDecoration(textStyle: Theme.of(context).textTheme.headlineSmall),
),
SizedBox(height: 8.0),
Text(S.current.insertSmsCode, style: Theme.of(context).textTheme.caption),
Text(S.current.insertSmsCode, style: Theme.of(context).textTheme.bodySmall),
],
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/interface/screen/search_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SearchScreen extends StatelessWidget {
return Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(S.current.noSearch, style: Theme.of(context).textTheme.bodyText1, textAlign: TextAlign.center),
child: Text(S.current.noSearch, style: Theme.of(context).textTheme.bodyLarge, textAlign: TextAlign.center),
),
);
else {
Expand All @@ -54,7 +54,7 @@ class SearchScreen extends StatelessWidget {
return Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(S.current.noResults, style: Theme.of(context).textTheme.bodyText1, textAlign: TextAlign.center),
child: Text(S.current.noResults, style: Theme.of(context).textTheme.bodyLarge, textAlign: TextAlign.center),
),
);
else
Expand Down
4 changes: 2 additions & 2 deletions lib/interface/screen/splash_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class _SplashScreenState extends State<SplashScreen> {
void initState() {
// debugPrint(S.delegate.supportedLocales.toString());

WidgetsBinding.instance!.addPostFrameCallback((_) async {
WidgetsBinding.instance.addPostFrameCallback((_) async {
final DateTime firstFrame = DateTime.now();

await InitHelper(context).initialize().then((bool isLogged) async {
Expand Down Expand Up @@ -59,7 +59,7 @@ class _SplashScreenState extends State<SplashScreen> {
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(References.appName, style: GoogleFonts.lobster(textStyle: Theme.of(context).textTheme.headline5!.copyWith(fontSize: 64.0))),
Text(References.appName, style: GoogleFonts.lobster(textStyle: Theme.of(context).textTheme.headlineSmall!.copyWith(fontSize: 64.0))),
CircularProgressIndicator(),
],
),
Expand Down
4 changes: 2 additions & 2 deletions lib/interface/widget/book_cover.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class BookCover extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(this.book!.title!, style: Theme.of(context).textTheme.headline6),
Text(this.book!.authorString, style: Theme.of(context).textTheme.bodyText1),
Text(this.book!.title!, style: Theme.of(context).textTheme.titleLarge),
Text(this.book!.authorString, style: Theme.of(context).textTheme.bodyLarge),
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/interface/widget/centered_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CenteredText extends StatelessWidget {
return Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(this.label!, style: Theme.of(context).textTheme.bodyText1, textAlign: TextAlign.center),
child: Text(this.label!, style: Theme.of(context).textTheme.bodyLarge, textAlign: TextAlign.center),
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ConfirmSearchRemovalBottomSheet<bool> extends StatelessWidget {
shrinkWrap: true,
children: [
BookCover(book: book, horizontalPadding: false),
Text(S.current.removeBookSearch, style: Theme.of(context).textTheme.headline6),
Text(S.current.removeBookSearch, style: Theme.of(context).textTheme.titleLarge),
Text(S.current.removeBookSearchExtended),
Row(
mainAxisSize: MainAxisSize.max,
Expand Down
4 changes: 2 additions & 2 deletions lib/interface/widget/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ class Message extends StatelessWidget {
Expanded(
flex: 3,
child: Container(
color: Theme.of(context).backgroundColor.withOpacity(iAmTheSender(context) ? 1.0 : 0.5),
color: Theme.of(context).colorScheme.background.withOpacity(iAmTheSender(context) ? 1.0 : 0.5),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(this.message.body!),
SizedBox(height: 4.0),
Align(alignment: AlignmentDirectional.bottomEnd, child: Text(format(this.message.sentDateTime!), style: Theme.of(context).textTheme.caption)),
Align(alignment: AlignmentDirectional.bottomEnd, child: Text(format(this.message.sentDateTime!), style: Theme.of(context).textTheme.bodySmall)),
],
),
),
Expand Down
1 change: 1 addition & 0 deletions lib/resources/helper/auth_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class AuthHelper {
final ConfirmationResult confirmationResult = await FirebaseAuth.instance.signInWithPhoneNumber(phoneNumber);
return confirmationResult;
}
return null;
}

static Future<void> loginWithCredential(String? verificationId, String smsCode, [ConfirmationResult? confirmationResult]) async {
Expand Down
1 change: 1 addition & 0 deletions lib/resources/helper/image_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ class ImageHelper {
XFile? pickedImage = await ImagePicker().pickImage(source: source);

if (pickedImage != null) return File(pickedImage.path);
return null;
}
}

0 comments on commit b57444c

Please sign in to comment.