mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-13 09:20:31 -07:00
Init repo
This commit is contained in:
commit
764b6034e3
566 changed files with 212335 additions and 0 deletions
50
lib/widgets/navigation_scaffold/components/adaptive_fab.dart
Normal file
50
lib/widgets/navigation_scaffold/components/adaptive_fab.dart
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class AdaptiveFab {
|
||||
final BuildContext context;
|
||||
final String title;
|
||||
final Widget child;
|
||||
final Function() onPressed;
|
||||
final Key? key;
|
||||
AdaptiveFab({
|
||||
required this.context,
|
||||
this.title = '',
|
||||
required this.child,
|
||||
required this.onPressed,
|
||||
this.key,
|
||||
});
|
||||
|
||||
FloatingActionButton get normal {
|
||||
return FloatingActionButton(
|
||||
key: key,
|
||||
onPressed: onPressed,
|
||||
tooltip: title,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
Widget get extended {
|
||||
return AnimatedContainer(
|
||||
key: key,
|
||||
duration: const Duration(milliseconds: 250),
|
||||
height: 60,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: ElevatedButton(
|
||||
onPressed: onPressed,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
child,
|
||||
const Spacer(),
|
||||
Flexible(child: Text(title)),
|
||||
const Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue