Skip to content

Commit

Permalink
chore: Fix flutter lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
holzeis committed May 29, 2024
1 parent e058582 commit 4ee2164
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 68 deletions.
4 changes: 2 additions & 2 deletions mobile/lib/common/poll_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class _PollWidgetState extends State<PollWidget> {
},
style: ButtonStyle(
padding:
MaterialStateProperty.all<EdgeInsets>(const EdgeInsets.all(15)),
backgroundColor: MaterialStateProperty.all<Color>(Colors.white),
WidgetStateProperty.all<EdgeInsets>(const EdgeInsets.all(15)),
backgroundColor: WidgetStateProperty.all<Color>(Colors.white),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
Expand Down
14 changes: 7 additions & 7 deletions mobile/lib/common/settings/emergency_kit_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,19 +284,19 @@ class EmergencyKitButton extends StatelessWidget {
});
},
style: ButtonStyle(
fixedSize: MaterialStateProperty.all(const Size(double.infinity, 50)),
iconSize: MaterialStateProperty.all<double>(20.0),
elevation: MaterialStateProperty.all<double>(0),
side: MaterialStateProperty.all(const BorderSide(width: 1.0, color: tenTenOnePurple)),
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
fixedSize: WidgetStateProperty.all(const Size(double.infinity, 50)),
iconSize: WidgetStateProperty.all<double>(20.0),
elevation: WidgetStateProperty.all<double>(0),
side: WidgetStateProperty.all(const BorderSide(width: 1.0, color: tenTenOnePurple)),
padding: WidgetStateProperty.all<EdgeInsetsGeometry>(
const EdgeInsets.fromLTRB(20, 12, 20, 12),
),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
),
backgroundColor: MaterialStateProperty.all<Color>(Colors.transparent),
backgroundColor: WidgetStateProperty.all<Color>(Colors.transparent),
),
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
icon,
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/features/trade/trade_tabs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class TradeTabs extends StatelessWidget {
isScrollable: true,
tabAlignment: TabAlignment.start,
// suppress overlay color (used for e.g. mouse-over) because it looks weird in this tab setup
overlayColor: MaterialStateColor.resolveWith((states) => Colors.transparent),
overlayColor: WidgetStateColor.resolveWith((states) => Colors.transparent),

// We don't have a bottom indicator; set to 0 to avoid it taking space when being unseleced.
indicatorWeight: 0,
Expand Down
40 changes: 20 additions & 20 deletions mobile/lib/features/wallet/receive_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import 'package:bitcoin_icons/bitcoin_icons.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:get_10101/common/custom_app_bar.dart';
import 'package:get_10101/bridge_generated/bridge_definitions.dart' as bridge;
import 'package:get_10101/common/amount_text.dart';
import 'package:get_10101/common/application/switch.dart';
import 'package:get_10101/common/color.dart';
import 'package:get_10101/common/custom_app_bar.dart';
import 'package:get_10101/common/custom_qr_code.dart';
import 'package:get_10101/common/dlc_channel_change_notifier.dart';
import 'package:get_10101/common/domain/model.dart';
Expand All @@ -22,7 +23,6 @@ import 'package:get_10101/features/wallet/wallet_screen.dart';
import 'package:get_10101/logger/logger.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
import 'package:get_10101/bridge_generated/bridge_definitions.dart' as bridge;
import 'package:share_plus/share_plus.dart';

class ReceiveScreen extends StatefulWidget {
Expand Down Expand Up @@ -384,12 +384,12 @@ class ReceiveActionButton extends StatelessWidget {
return ElevatedButton(
onPressed: onPressed,
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all<Color>(Colors.grey.shade200),
elevation: MaterialStateProperty.all<double>(1), // this reduces the shade
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
backgroundColor: WidgetStateProperty.all<Color>(Colors.grey.shade200),
elevation: WidgetStateProperty.all<double>(1), // this reduces the shade
padding: WidgetStateProperty.all<EdgeInsetsGeometry>(
const EdgeInsets.fromLTRB(24, 12, 24, 12),
),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
Expand Down Expand Up @@ -479,22 +479,22 @@ class SelectableButton extends StatelessWidget {
return OutlinedButton.icon(
onPressed: onPressed,
style: ButtonStyle(
iconSize: MaterialStateProperty.all<double>(20.0),
elevation: MaterialStateProperty.all<double>(0),
side: MaterialStateProperty.all(BorderSide(
iconSize: WidgetStateProperty.all<double>(20.0),
elevation: WidgetStateProperty.all<double>(0),
side: WidgetStateProperty.all(BorderSide(
width: isSelected ? 1.0 : 0,
color: isSelected ? selectedColor.withOpacity(1) : Colors.grey.shade300)),
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
padding: WidgetStateProperty.all<EdgeInsetsGeometry>(
const EdgeInsets.fromLTRB(20, 12, 20, 12),
),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
),
backgroundColor: isSelected
? MaterialStateProperty.all<Color>(selectedColor.withOpacity(0.05))
: MaterialStateProperty.all<Color>(Colors.grey.shade200),
? WidgetStateProperty.all<Color>(selectedColor.withOpacity(0.05))
: WidgetStateProperty.all<Color>(Colors.grey.shade200),
),
icon: Icon(icon, color: isSelected ? selectedColor.withOpacity(1) : Colors.grey),
label: Text(buttonText,
Expand Down Expand Up @@ -621,21 +621,21 @@ class _InvoiceDrawerScreen extends State<InvoiceDrawerScreen> {
child: OutlinedButton(
onPressed: () => widget.onConfirm(_amount ?? 0, _description),
style: ButtonStyle(
fixedSize: MaterialStateProperty.all(const Size(double.infinity, 50)),
iconSize: MaterialStateProperty.all<double>(20.0),
elevation: MaterialStateProperty.all<double>(0),
fixedSize: WidgetStateProperty.all(const Size(double.infinity, 50)),
iconSize: WidgetStateProperty.all<double>(20.0),
elevation: WidgetStateProperty.all<double>(0),
// this reduces the shade
side: MaterialStateProperty.all(
side: WidgetStateProperty.all(
const BorderSide(width: 1.0, color: tenTenOnePurple)),
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
padding: WidgetStateProperty.all<EdgeInsetsGeometry>(
const EdgeInsets.fromLTRB(20, 12, 20, 12),
),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
),
backgroundColor: MaterialStateProperty.all<Color>(Colors.transparent),
backgroundColor: WidgetStateProperty.all<Color>(Colors.transparent),
),
child: const Text("Continue"),
),
Expand Down
10 changes: 5 additions & 5 deletions mobile/lib/features/wallet/scanner_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,16 @@ class _ScannerScreenState extends State<ScannerScreen> {
});
},
style: ButtonStyle(
padding: MaterialStateProperty.all<EdgeInsets>(const EdgeInsets.all(15)),
backgroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled)) {
padding: WidgetStateProperty.all<EdgeInsets>(const EdgeInsets.all(15)),
backgroundColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return tenTenOnePurple.shade100;
} else {
return tenTenOnePurple;
}
}),
shape: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled)) {
shape: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
side: BorderSide(color: tenTenOnePurple.shade100),
Expand Down
12 changes: 6 additions & 6 deletions mobile/lib/features/wallet/send/send_onchain_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get_10101/common/custom_app_bar.dart';
import 'package:get_10101/common/color.dart';
import 'package:get_10101/common/custom_app_bar.dart';
import 'package:get_10101/common/domain/model.dart';
import 'package:get_10101/common/scrollable_safe_area.dart';
import 'package:get_10101/features/wallet/application/util.dart';
Expand Down Expand Up @@ -345,16 +345,16 @@ class _SendOnChainScreenState extends State<SendOnChainScreen> {
: null,
style: ButtonStyle(
padding:
MaterialStateProperty.all<EdgeInsets>(const EdgeInsets.all(15)),
backgroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled)) {
WidgetStateProperty.all<EdgeInsets>(const EdgeInsets.all(15)),
backgroundColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return tenTenOnePurple.shade100;
} else {
return tenTenOnePurple;
}
}),
shape: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled)) {
shape: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
side: BorderSide(color: tenTenOnePurple.shade100),
Expand Down
10 changes: 5 additions & 5 deletions mobile/lib/features/welcome/onboarding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ class _Onboarding extends State<Onboarding> {
child: ElevatedButton(
onPressed: () => GoRouter.of(context).go(WelcomeScreen.route),
style: ButtonStyle(
padding: MaterialStateProperty.all<EdgeInsets>(const EdgeInsets.all(15)),
backgroundColor: MaterialStateProperty.all<Color>(tenTenOnePurple),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
padding: WidgetStateProperty.all<EdgeInsets>(const EdgeInsets.all(15)),
backgroundColor: WidgetStateProperty.all<Color>(tenTenOnePurple),
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40.0),
side: const BorderSide(color: tenTenOnePurple),
Expand All @@ -171,8 +171,8 @@ class _Onboarding extends State<Onboarding> {
child: TextButton(
onPressed: () => GoRouter.of(context).go(SeedPhraseImporter.route),
style: ButtonStyle(
padding: MaterialStateProperty.all<EdgeInsets>(const EdgeInsets.all(15)),
backgroundColor: MaterialStateProperty.all<Color>(Colors.white),
padding: WidgetStateProperty.all<EdgeInsets>(const EdgeInsets.all(15)),
backgroundColor: WidgetStateProperty.all<Color>(Colors.white),
),
child: const Wrap(
children: <Widget>[
Expand Down
12 changes: 6 additions & 6 deletions mobile/lib/features/welcome/seed_import_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class SeedPhraseImporterState extends State<SeedPhraseImporter> {
width: 120,
child: ElevatedButton(
style: ButtonStyle(
padding: MaterialStateProperty.all<EdgeInsets>(
padding: WidgetStateProperty.all<EdgeInsets>(
const EdgeInsets.fromLTRB(20, 10, 20, 10)),
),
onPressed: () {
Expand All @@ -116,18 +116,18 @@ class SeedPhraseImporterState extends State<SeedPhraseImporter> {
width: 120,
child: ElevatedButton(
style: ButtonStyle(
padding: MaterialStateProperty.all<EdgeInsets>(
padding: WidgetStateProperty.all<EdgeInsets>(
const EdgeInsets.fromLTRB(20, 10, 20, 10)),
backgroundColor:
MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return Colors.grey; // Change to the desired disabled color
}
return tenTenOnePurple; // Change to the desired enabled color
}),
foregroundColor:
MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return Colors.black; // Change to the desired disabled text color
}
return Colors.white; // Change to the desired enabled text color
Expand Down
16 changes: 8 additions & 8 deletions mobile/lib/features/welcome/welcome_screen.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import 'package:get_10101/util/environment.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get_10101/common/application/switch.dart';
import 'package:get_10101/common/color.dart';
import 'package:get_10101/features/welcome/loading_screen.dart';
import 'package:get_10101/ffi.dart';
import 'package:get_10101/logger/logger.dart';
import 'package:flutter/material.dart';
import 'package:get_10101/util/environment.dart';
import 'package:get_10101/util/file.dart';
import 'package:get_10101/util/preferences.dart';
import 'package:go_router/go_router.dart';
import 'package:get_10101/ffi.dart';

class WelcomeScreen extends StatefulWidget {
static const route = "/welcome";
Expand Down Expand Up @@ -211,17 +211,17 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
}
},
style: ButtonStyle(
padding: MaterialStateProperty.all<EdgeInsets>(
padding: WidgetStateProperty.all<EdgeInsets>(
const EdgeInsets.all(15)),
backgroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled)) {
backgroundColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return tenTenOnePurple.shade100;
} else {
return tenTenOnePurple;
}
}),
shape: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled)) {
shape: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
side: BorderSide(color: tenTenOnePurple.shade100),
Expand Down
16 changes: 8 additions & 8 deletions mobile/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import 'package:get_10101/common/init_service.dart';
import 'package:get_10101/common/routes.dart';
import 'package:get_10101/features/trade/trade_theme.dart';
import 'package:get_10101/features/wallet/wallet_theme.dart';
import 'package:get_10101/logger/logger.dart';
import 'package:get_10101/util/notifications.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
import 'package:get_10101/logger/logger.dart';

const Color appBackgroundColor = Color(0xFFFAFAFA);

Expand Down Expand Up @@ -81,23 +81,23 @@ class _TenTenOneAppState extends State<TenTenOneApp> with WidgetsBindingObserver
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
// this is the button background color
backgroundColor: MaterialStateProperty.all<Color>(tenTenOnePurple),
backgroundColor: WidgetStateProperty.all<Color>(tenTenOnePurple),
// this is the button text color
foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
foregroundColor: WidgetStateProperty.all<Color>(Colors.white),
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
),
),
),
),
inputDecorationTheme: InputDecorationTheme(
prefixIconColor: MaterialStateColor.resolveWith(
(Set<MaterialState> states) {
if (states.contains(MaterialState.focused)) {
prefixIconColor: WidgetStateColor.resolveWith(
(Set<WidgetState> states) {
if (states.contains(WidgetState.focused)) {
return tenTenOnePurple;
}
if (states.contains(MaterialState.error)) {
if (states.contains(WidgetState.error)) {
return Colors.red;
}
return Colors.grey;
Expand Down

0 comments on commit 4ee2164

Please sign in to comment.