Skip to content

Commit 85d8abf

Browse files
committed
remove FlatButton use
1 parent cf9868d commit 85d8abf

File tree

5 files changed

+35
-33
lines changed

5 files changed

+35
-33
lines changed

lib/stores/habr_storage.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'package:habr_app/utils/log.dart';
99
import 'package:either_dart/either.dart';
1010
import 'package:habr_app/app_error.dart';
1111
import 'package:hive/hive.dart';
12-
import 'package:tuple/tuple.dart';
1312

1413
enum PostsFlow { saved, dayTop, weekTop, yearTop, time, news }
1514

lib/utils/html_to_json/transformer.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'dart:ui';
2-
31
import 'element_builders.dart';
42
import 'package:html/dom.dart' as dom;
53

lib/widgets/informing/internet_error_view.dart

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
44
class LossInternetConnection extends StatelessWidget {
55
final VoidCallback onPressReload;
66

7-
8-
const LossInternetConnection({
9-
@required
10-
this.onPressReload
11-
});
7+
const LossInternetConnection({@required this.onPressReload});
128

139
@override
1410
Widget build(BuildContext context) {
@@ -18,14 +14,13 @@ class LossInternetConnection extends StatelessWidget {
1814
crossAxisAlignment: CrossAxisAlignment.center,
1915
children: [
2016
Image.asset("assets/images/ufo.png"),
21-
SizedBox(height: 30,),
17+
const SizedBox(height: 30),
2218
Text(localization.lossInternet),
23-
SizedBox(height: 10),
24-
FlatButton(
19+
const SizedBox(height: 10),
20+
TextButton(
2521
onPressed: onPressReload,
2622
child: Text(localization.reload),
2723
)
28-
]
29-
);
24+
]);
3025
}
31-
}
26+
}

lib/widgets/material_buttons.dart

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,34 @@ class MaterialButton extends StatelessWidget {
1111
@override
1212
Widget build(BuildContext context) {
1313
final mainColor = color ?? Theme.of(context).colorScheme.secondary;
14-
return FlatButton(
15-
shape: RoundedRectangleBorder(
16-
borderRadius: BorderRadius.circular(12.0),
17-
side: BorderSide(width: 2, color: mainColor)),
18-
padding: const EdgeInsets.all(15),
14+
return TextButton(
15+
style: ButtonStyle(
16+
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
17+
const EdgeInsets.all(15)),
18+
shape: MaterialStateProperty.all(
19+
RoundedRectangleBorder(
20+
borderRadius: BorderRadius.circular(12.0),
21+
side: BorderSide(width: 2, color: mainColor)),
22+
),
23+
),
1924
onPressed: onPressed,
2025
child: Row(
21-
mainAxisAlignment: MainAxisAlignment.center,
22-
crossAxisAlignment: CrossAxisAlignment.center,
23-
children: [
24-
Icon(iconData, color: mainColor,),
25-
const SizedBox(width: 10,),
26-
Text(text, style: TextStyle(color: mainColor),),
27-
]
28-
)
26+
mainAxisAlignment: MainAxisAlignment.center,
27+
crossAxisAlignment: CrossAxisAlignment.center,
28+
children: [
29+
Icon(
30+
iconData,
31+
color: mainColor,
32+
),
33+
const SizedBox(
34+
width: 10,
35+
),
36+
Text(
37+
text,
38+
style: TextStyle(color: mainColor),
39+
),
40+
],
41+
),
2942
);
3043
}
3144
}
@@ -42,8 +55,7 @@ class CommentsButton extends StatelessWidget {
4255
onPressed: onPressed,
4356
color: color,
4457
iconData: Icons.chat_bubble,
45-
text: "Комментарии"
46-
);
58+
text: "Комментарии");
4759
}
4860
}
4961

@@ -59,7 +71,6 @@ class SearchButton extends StatelessWidget {
5971
onPressed: onPressed,
6072
color: color,
6173
iconData: Icons.search,
62-
text: "Поиск"
63-
);
74+
text: "Поиск");
6475
}
65-
}
76+
}

lib/widgets/routing/home_menu.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class MainMenu extends StatelessWidget {
88
@override
99
Widget build(BuildContext context) {
1010
final localization = AppLocalizations.of(context);
11-
final onDesktop = isDesktop(context);
1211
return Drawer(
1312
child: ListView(
1413
children: [

0 commit comments

Comments
 (0)