mirror of
https://github.com/h7x4/Jisho-Study-Tool.git
synced 2025-01-03 10:37:30 +01:00
57 lines
1.5 KiB
Dart
57 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:jisho_study_tool/bloc/kanji/kanji_bloc.dart';
|
|
|
|
//TODO: Make buttons have an effect
|
|
|
|
class KanjiSearchOptionsBar extends StatelessWidget {
|
|
const KanjiSearchOptionsBar({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
_IconButton(
|
|
icon: Text(
|
|
"部",
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontSize: 18,
|
|
),
|
|
),
|
|
onPressed: () =>
|
|
BlocProvider.of<KanjiBloc>(context).add(ReturnToInitialState()),
|
|
),
|
|
_IconButton(
|
|
icon: Icon(Icons.category),
|
|
onPressed: () =>
|
|
BlocProvider.of<KanjiBloc>(context).add(ReturnToInitialState()),
|
|
),
|
|
_IconButton(
|
|
icon: Icon(Icons.mode),
|
|
onPressed: () =>
|
|
BlocProvider.of<KanjiBloc>(context).add(ReturnToInitialState()),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _IconButton extends StatelessWidget {
|
|
final Widget icon;
|
|
final void Function()? onPressed;
|
|
const _IconButton({
|
|
required this.icon,
|
|
required this.onPressed,
|
|
Key? key,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return IconButton(onPressed: onPressed, icon: icon);
|
|
}
|
|
}
|