fyral_comms 0.0.3
fyral_comms: ^0.0.3 copied to clipboard
Communication feature package for Fleet Glide Admin
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:fyral_comms/comms.dart';
void main() {
runApp(const CommsExampleApp());
}
/// A premium Example Application demonstrating the usage of the `comms` package.
class CommsExampleApp extends StatelessWidget {
const CommsExampleApp({super.key});
static final GoRouter _router = GoRouter(
initialLocation: '/',
routes: [
GoRoute(
path: '/',
builder: (context, state) => const CommsPage(),
),
GoRoute(
path: '/chat/:title',
builder: (context, state) {
final title = state.pathParameters['title'] ?? 'Chat';
return ConversationDetailPage(title: title);
},
),
],
);
@override
Widget build(BuildContext context) {
return MaterialApp.router(
title: 'Comms Package Example',
themeMode: ThemeMode.system,
debugShowCheckedModeBanner: false,
// Premium Light Theme
theme: ThemeData(
useMaterial3: true,
brightness: Brightness.light,
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF653DAA), // Modern purple seed color
primary: const Color(0xFF653DAA),
secondary: const Color(0xFFF97316), // Vibrant orange
surface: Colors.white,
onSurface: const Color(0xFF1E293B),
),
scaffoldBackgroundColor: const Color(0xFFF8FAFC),
appBarTheme: const AppBarTheme(
backgroundColor: Colors.transparent,
elevation: 0,
centerTitle: false,
),
),
// Premium Dark Theme
darkTheme: ThemeData(
useMaterial3: true,
brightness: Brightness.dark,
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF8B5CF6),
brightness: Brightness.dark,
primary: const Color(0xFFA78BFA),
secondary: const Color(0xFFFB923C),
surface: const Color(0xFF0F172A),
onSurface: const Color(0xFFF1F5F9),
),
scaffoldBackgroundColor: const Color(0xFF020617),
appBarTheme: const AppBarTheme(
backgroundColor: Colors.transparent,
elevation: 0,
centerTitle: false,
),
),
routerConfig: _router,
);
}
}