first commit
This commit is contained in:
76
lib/core/widgets/riotz_button.dart
Normal file
76
lib/core/widgets/riotz_button.dart
Normal file
@@ -0,0 +1,76 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../theme/app_colors.dart';
|
||||
|
||||
enum RiotzButtonStyle { primary, secondary, outline }
|
||||
|
||||
class RiotzButton extends StatelessWidget {
|
||||
const RiotzButton({
|
||||
required this.label,
|
||||
required this.onPressed,
|
||||
this.style = RiotzButtonStyle.primary,
|
||||
this.isLoading = false,
|
||||
this.fullWidth = true,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final String label;
|
||||
final VoidCallback? onPressed;
|
||||
final RiotzButtonStyle style;
|
||||
final bool isLoading;
|
||||
final bool fullWidth;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
Widget content = isLoading
|
||||
? const SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: CircularProgressIndicator(strokeWidth: 2, color: AppColors.white),
|
||||
)
|
||||
: Text(label.toUpperCase(), style: theme.textTheme.labelLarge);
|
||||
|
||||
if (fullWidth) {
|
||||
content = Center(child: content);
|
||||
}
|
||||
|
||||
return InkWell(
|
||||
onTap: isLoading ? null : onPressed,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 24),
|
||||
decoration: BoxDecoration(
|
||||
color: _getBgColor(),
|
||||
border: Border.all(
|
||||
color: _getBorderColor(),
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
child: content,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Color _getBgColor() {
|
||||
switch (style) {
|
||||
case RiotzButtonStyle.primary:
|
||||
return AppColors.neonRed;
|
||||
case RiotzButtonStyle.secondary:
|
||||
return AppColors.bloodRed;
|
||||
case RiotzButtonStyle.outline:
|
||||
return Colors.transparent;
|
||||
}
|
||||
}
|
||||
|
||||
Color _getBorderColor() {
|
||||
switch (style) {
|
||||
case RiotzButtonStyle.primary:
|
||||
return AppColors.neonRed;
|
||||
case RiotzButtonStyle.secondary:
|
||||
return AppColors.bloodRed;
|
||||
case RiotzButtonStyle.outline:
|
||||
return AppColors.white;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
lib/core/widgets/riotz_card.dart
Normal file
35
lib/core/widgets/riotz_card.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../theme/app_colors.dart';
|
||||
|
||||
class RiotzCard extends StatelessWidget {
|
||||
const RiotzCard({
|
||||
required this.child,
|
||||
this.padding,
|
||||
this.onTap,
|
||||
this.isAccent = false,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
final VoidCallback? onTap;
|
||||
final bool isAccent;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
padding: padding ?? const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.surface,
|
||||
border: Border.all(
|
||||
color: isAccent ? AppColors.neonRed : AppColors.border,
|
||||
width: isAccent ? 2 : 1,
|
||||
),
|
||||
),
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
68
lib/core/widgets/riotz_scaffold.dart
Normal file
68
lib/core/widgets/riotz_scaffold.dart
Normal file
@@ -0,0 +1,68 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../theme/app_colors.dart';
|
||||
|
||||
class RiotzScaffold extends StatelessWidget {
|
||||
const RiotzScaffold({
|
||||
required this.body,
|
||||
this.appBar,
|
||||
this.bottomNavigationBar,
|
||||
this.floatingActionButton,
|
||||
this.useSafeArea = true,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final Widget body;
|
||||
final PreferredSizeWidget? appBar;
|
||||
final Widget? bottomNavigationBar;
|
||||
final Widget? floatingActionButton;
|
||||
final bool useSafeArea;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: appBar,
|
||||
body: Stack(
|
||||
children: [
|
||||
// Base Layer: Deep Black
|
||||
Container(color: AppColors.black),
|
||||
|
||||
// Aesthetic Layer: Subtle Brutalist Gradient
|
||||
Positioned.fill(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
AppColors.black,
|
||||
AppColors.deepRed.withOpacity(0.05),
|
||||
AppColors.black,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Texture Layer: Grunge Overlay
|
||||
// Note: Add 'assets/textures/noise.png' to pubspec and uncomment below
|
||||
/*
|
||||
Positioned.fill(
|
||||
child: Opacity(
|
||||
opacity: 0.03,
|
||||
child: Image.asset(
|
||||
'assets/textures/noise.png',
|
||||
repeat: ImageRepeat.repeat,
|
||||
),
|
||||
),
|
||||
),
|
||||
*/
|
||||
|
||||
// Content Layer
|
||||
useSafeArea ? SafeArea(child: body) : body,
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: bottomNavigationBar,
|
||||
floatingActionButton: floatingActionButton,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user