extract SectionDivider widget

This commit is contained in:
Serhii 2022-12-23 23:58:39 +02:00
parent 00c008ed8b
commit 89028500e7
7 changed files with 26 additions and 39 deletions

View file

@ -1,6 +1,7 @@
import 'dart:ui';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/filter_tile.dart';
import 'package:cake_wallet/src/widgets/section_divider.dart';
import 'package:cake_wallet/src/widgets/standard_checkbox.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:flutter/cupertino.dart';
@ -141,15 +142,3 @@ class FilterWidget extends StatelessWidget {
);
}
}
class SectionDivider extends StatelessWidget {
const SectionDivider();
@override
Widget build(BuildContext context) {
return Container(
height: 1,
color: Theme.of(context).dividerColor,
);
}
}

View file

@ -1,4 +1,5 @@
import 'dart:ui';
import 'package:cake_wallet/src/widgets/section_divider.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
@ -83,11 +84,7 @@ class MoneroAccountListPage extends StatelessWidget {
ListView.separated(
padding: EdgeInsets.zero,
controller: controller,
separatorBuilder: (context, index) =>
Container(
height: 1,
color: Theme.of(context).dividerColor,
),
separatorBuilder: (context, index) => SectionDivider(),
itemCount: accounts.length ?? 0,
itemBuilder: (context, index) {
final account = accounts[index];

View file

@ -1,4 +1,5 @@
import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
import 'package:cake_wallet/src/widgets/section_divider.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
@ -135,8 +136,7 @@ class ReceivePage extends BasePage {
Observer(
builder: (_) => ListView.separated(
padding: EdgeInsets.all(0),
separatorBuilder: (context, _) => Container(
height: 1, color: Theme.of(context).dividerColor),
separatorBuilder: (context, _) => SectionDivider(),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: addressListViewModel.items.length,

View file

@ -1,4 +1,5 @@
import 'package:cake_wallet/src/widgets/cake_scrollbar.dart';
import 'package:cake_wallet/src/widgets/section_divider.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
@ -70,10 +71,7 @@ class ChooseYatAddressButtonsState extends State<ChooseYatAddressButtons> {
controller: controller,
padding: EdgeInsets.all(0),
itemCount: itemCount,
separatorBuilder: (_, __) => Container(
height: 1,
color: Theme.of(context).dividerColor,
),
separatorBuilder: (_, __) => SectionDivider(),
itemBuilder: (context, index) {
final address = addresses[index];

View file

@ -1,4 +1,5 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:cake_wallet/src/widgets/section_divider.dart';
import 'package:cake_wallet/utils/show_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
@ -57,10 +58,7 @@ class WalletKeysPage extends BasePage {
height: 1,
padding: EdgeInsets.only(left: 24),
color: Theme.of(context).accentTextTheme!.headline6!.backgroundColor!,
child: Container(
height: 1,
color: Theme.of(context).dividerColor,
),
child: SectionDivider(),
),
itemCount: walletKeysViewModel.items.length,
itemBuilder: (BuildContext context, int index) {

View file

@ -1,4 +1,5 @@
import 'dart:ui';
import 'package:cake_wallet/src/widgets/section_divider.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
@ -76,10 +77,7 @@ class BaseAlertDialog extends StatelessWidget {
),
)),
),
Container(
width: 1,
color: Theme.of(context).dividerColor,
),
SectionDivider(),
Expanded(
child: TextButton(
onPressed: actionRight,
@ -140,10 +138,7 @@ class BaseAlertDialog extends StatelessWidget {
isDividerExists
? Padding(
padding: EdgeInsets.only(top: 16, bottom: 8),
child: Container(
height: 1,
color: Theme.of(context).dividerColor,
),
child: SectionDivider(),
)
: Offstage(),
Padding(
@ -152,10 +147,7 @@ class BaseAlertDialog extends StatelessWidget {
)
],
),
Container(
height: 1,
color: Theme.of(context).dividerColor,
),
SectionDivider(),
actionButtons(context)
],
),

View file

@ -0,0 +1,13 @@
import 'package:flutter/material.dart';
class SectionDivider extends StatelessWidget {
const SectionDivider();
@override
Widget build(BuildContext context) {
return Container(
height: 1,
color: Theme.of(context).dividerColor,
);
}
}