v_chat_voice_player 4.0.1
v_chat_voice_player: ^4.0.1 copied to clipboard
v chat voice player package this item is part of v_chat_sdk and it can be used as a standalone package
// Copyright 2023, the hatemragab project author.
// All rights reserved. Use of this source code is governed by a
// MIT license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'app/routes/app_pages.dart';
void main() => runApp(const VoicePlayerExampleApp());
class VoicePlayerExampleApp extends StatelessWidget {
const VoicePlayerExampleApp({super.key});
static const _seedColor = Color(0xFF0F766E);
@override
Widget build(BuildContext context) {
return GetMaterialApp(
title: 'V Chat Voice Player',
debugShowCheckedModeBanner: false,
theme: _buildTheme(Brightness.light),
darkTheme: _buildTheme(Brightness.dark),
themeMode: ThemeMode.system,
initialRoute: AppPages.initial,
getPages: AppPages.routes,
);
}
ThemeData _buildTheme(Brightness brightness) {
final isDark = brightness == Brightness.dark;
final colorScheme = ColorScheme.fromSeed(
seedColor: _seedColor,
brightness: brightness,
);
return ThemeData(
useMaterial3: true,
brightness: brightness,
colorScheme: colorScheme,
scaffoldBackgroundColor: isDark
? const Color(0xFF0F172A)
: const Color(0xFFF6F8FB),
appBarTheme: AppBarTheme(
elevation: 0,
centerTitle: false,
scrolledUnderElevation: 1,
backgroundColor: isDark
? const Color(0xFF0F172A)
: const Color(0xFFF6F8FB),
titleTextStyle: TextStyle(
color: colorScheme.onSurface,
fontSize: 18,
fontWeight: FontWeight.w700,
),
),
cardTheme: CardThemeData(
elevation: 0,
color: isDark
? const Color(0xFF172033)
: colorScheme.surfaceContainerLowest,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24),
side: BorderSide(color: colorScheme.outlineVariant),
),
),
chipTheme: ChipThemeData(
side: BorderSide(color: colorScheme.outlineVariant),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
labelStyle: const TextStyle(fontWeight: FontWeight.w600),
),
filledButtonTheme: FilledButtonThemeData(
style: FilledButton.styleFrom(
minimumSize: const Size(48, 48),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(14),
),
),
),
iconButtonTheme: IconButtonThemeData(
style: IconButton.styleFrom(minimumSize: const Size(48, 48)),
),
textTheme: const TextTheme(
displaySmall: TextStyle(fontSize: 42, letterSpacing: -1.2),
headlineMedium: TextStyle(fontWeight: FontWeight.w800),
headlineSmall: TextStyle(fontWeight: FontWeight.w700),
titleLarge: TextStyle(fontWeight: FontWeight.w700),
titleMedium: TextStyle(fontWeight: FontWeight.w700),
),
);
}
}