feat(ui_kit): finalize material ready buttons
This commit is contained in:
@@ -0,0 +1,126 @@
|
||||
// Copyright (C) 2023 WYATT GROUP
|
||||
// Please see the AUTHORS file for details.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||
import 'package:wyatt_ui_kit/wyatt_ui_kit.dart';
|
||||
import 'package:wyatt_ui_kit_example/theme/constants.dart';
|
||||
|
||||
class SymbolButtons extends StatelessWidget {
|
||||
const SymbolButtons({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Symbol Buttons',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
const Gap(20),
|
||||
SymbolButton(
|
||||
label: const TextWrapper('Text'),
|
||||
icon: const Icon(
|
||||
Icons.android,
|
||||
size: 25,
|
||||
color: Constants.white,
|
||||
),
|
||||
),
|
||||
const Gap(20),
|
||||
SymbolButton(
|
||||
label: const TextWrapper('Enabled'),
|
||||
icon: const Icon(
|
||||
Icons.android,
|
||||
size: 25,
|
||||
color: Constants.white,
|
||||
),
|
||||
)
|
||||
..bloc.enable()
|
||||
..bloc.freeze(),
|
||||
const Gap(20),
|
||||
SymbolButton(
|
||||
label: const TextWrapper('Disabled'),
|
||||
icon: const Icon(
|
||||
Icons.android,
|
||||
size: 25,
|
||||
color: Constants.white,
|
||||
),
|
||||
)
|
||||
..bloc.disable()
|
||||
..bloc.freeze(),
|
||||
const Gap(20),
|
||||
SymbolButton(
|
||||
label: const TextWrapper('Hovered'),
|
||||
icon: const Icon(
|
||||
Icons.android,
|
||||
size: 25,
|
||||
color: Constants.white,
|
||||
),
|
||||
)
|
||||
..bloc.onMouseEnter()
|
||||
..bloc.freeze(),
|
||||
const Gap(20),
|
||||
SymbolButton(
|
||||
label: const TextWrapper('Focused'),
|
||||
icon: const Icon(
|
||||
Icons.android,
|
||||
size: 25,
|
||||
color: Constants.white,
|
||||
),
|
||||
)
|
||||
..bloc.onFocus()
|
||||
..bloc.freeze(),
|
||||
const Gap(20),
|
||||
SymbolButton(
|
||||
label: const TextWrapper('Tapped'),
|
||||
icon: const Icon(
|
||||
Icons.android,
|
||||
size: 25,
|
||||
color: Constants.white,
|
||||
),
|
||||
)
|
||||
..bloc.onClickDown()
|
||||
..bloc.freeze(),
|
||||
const Gap(20),
|
||||
SymbolButton(
|
||||
label: const TextWrapper('Selected'),
|
||||
icon: const Icon(
|
||||
Icons.android,
|
||||
size: 25,
|
||||
color: Constants.white,
|
||||
),
|
||||
)
|
||||
..bloc.select()
|
||||
..bloc.freeze(),
|
||||
const Gap(20),
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Constants.red1),
|
||||
),
|
||||
child: SymbolButton(
|
||||
label: const TextWrapper('Trigger zone'),
|
||||
icon: const Icon(
|
||||
Icons.android,
|
||||
size: 25,
|
||||
color: Constants.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Gap(20),
|
||||
],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user