13 Commits

22 changed files with 384 additions and 551 deletions

View File

@ -1,4 +1,6 @@
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'dart:io' show Platform; import 'dart:io' show Platform;
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:google_nav_bar/google_nav_bar.dart'; import 'package:google_nav_bar/google_nav_bar.dart';
@ -34,45 +36,30 @@ class MyApp extends StatelessWidget {
const MyApp({super.key}); const MyApp({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return DynamicColorBuilder(
builder: (BuildContext context, Widget? child) { builder: (ColorScheme? lightDynamic, ColorScheme? darkDynamic) {
return MediaQuery( return MaterialApp(
data: MediaQuery.of(context).copyWith( // builder: (BuildContext context, Widget? child) {
textScaleFactor: 1.0, // return MediaQuery(
), // data: MediaQuery.of(context).copyWith(
child: child!, // textScaleFactor: 1.0,
); // ),
}, // child: child!,
debugShowCheckedModeBanner: false, // );
title: 'Openlib', // },
theme: ThemeData( debugShowCheckedModeBanner: false,
primaryColor: Colors.white, title: 'Openlib',
colorScheme: ColorScheme.light( theme: ThemeData(
primary: Colors.white,
secondary: '#FB0101'.toColor(),
tertiary: Colors.black,
tertiaryContainer: '#F2F2F2'.toColor(),
),
textTheme: const TextTheme(
displayLarge: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 21,
),
displayMedium: TextStyle(
fontSize: 13,
fontWeight: FontWeight.bold,
color: Colors.black,
overflow: TextOverflow.ellipsis,
),
),
fontFamily: GoogleFonts.nunito().fontFamily,
useMaterial3: true, useMaterial3: true,
textSelectionTheme: TextSelectionThemeData( colorScheme: lightDynamic,
selectionColor: '#FB0101'.toColor(), ),
selectionHandleColor: '#FB0101'.toColor())), darkTheme: ThemeData(
home: const HomePage(), useMaterial3: true,
); colorScheme: darkDynamic,
),
home: const HomePage(),
);
});
} }
} }
@ -94,67 +81,37 @@ class _HomePageState extends ConsumerState<HomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final selectedIndex = ref.watch(selectedIndexProvider); final selectedIndex = ref.watch(selectedIndexProvider);
return Scaffold( return AnnotatedRegion<SystemUiOverlayStyle>(
appBar: AppBar( value: SystemUiOverlayStyle(
backgroundColor: Theme.of(context).colorScheme.primary, systemNavigationBarColor: ElevationOverlay.applySurfaceTint(
title: const Text("Openlib"), Theme.of(context).colorScheme.surface,
titleTextStyle: Theme.of(context).textTheme.displayLarge, Theme.of(context).colorScheme.surfaceTint,
), 3)),
body: _widgetOptions.elementAt(selectedIndex), child: Scaffold(
bottomNavigationBar: SafeArea( backgroundColor: Theme.of(context).colorScheme.background,
child: GNav( appBar: AppBar(
rippleColor: Colors.redAccent, leading:
backgroundColor: Colors.black, Icon(Icons.book, color: Theme.of(context).colorScheme.primary),
haptic: true, title: const Text(
tabBorderRadius: 50, "Openlib",
tabActiveBorder: Border.all( style: TextStyle(fontWeight: FontWeight.w600),
color: Theme.of(context).colorScheme.secondary,
), ),
tabMargin: const EdgeInsets.fromLTRB(13, 6, 13, 2.5), titleSpacing: 1,
curve: Curves.easeInOut, // tab animation curves ),
duration: const Duration(milliseconds: 150), body: _widgetOptions.elementAt(selectedIndex),
gap: 5, bottomNavigationBar: NavigationBar(
color: const Color.fromARGB(255, 255, 255, 255), destinations: const [
activeColor: const Color.fromARGB(255, 255, 255, 255), NavigationDestination(
iconSize: 21, // tab button icon size icon: Icon(Icons.trending_up), label: "Trending"),
tabBackgroundColor: Theme.of(context).colorScheme.secondary, NavigationDestination(icon: Icon(Icons.search), label: "Search"),
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 6.5), NavigationDestination(
tabs: const [ icon: Icon(Icons.collections_bookmark), label: "My Library"),
GButton(
icon: Icons.trending_up,
text: 'Trending',
iconColor: Colors.white,
textStyle: TextStyle(
fontWeight: FontWeight.w900,
color: Colors.white,
fontSize: 13,
),
),
GButton(
icon: Icons.search,
text: 'Search',
iconColor: Colors.white,
textStyle: TextStyle(
fontWeight: FontWeight.w900,
color: Colors.white,
fontSize: 13,
),
),
GButton(
icon: Icons.collections_bookmark,
text: 'My Library',
iconColor: Colors.white,
textStyle: TextStyle(
fontWeight: FontWeight.w900,
color: Colors.white,
fontSize: 13,
),
),
], ],
selectedIndex: selectedIndex, selectedIndex: selectedIndex,
onTabChange: (index) async { onDestinationSelected: (index) async {
ref.read(selectedIndexProvider.notifier).state = index; ref.read(selectedIndexProvider.notifier).state = index;
}, },
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
), ),
), ),
); );

View File

@ -23,18 +23,21 @@ import 'package:openlib/ui/components/file_buttons_widget.dart';
import 'package:openlib/ui/components/snack_bar_widget.dart'; import 'package:openlib/ui/components/snack_bar_widget.dart';
class BookInfoPage extends ConsumerWidget { class BookInfoPage extends ConsumerWidget {
const BookInfoPage({Key? key, required this.url}) : super(key: key); const BookInfoPage({Key? key, required this.url, required this.title})
: super(key: key);
final String url; final String url;
final String title;
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final bookInfo = ref.watch(bookInfoProvider(url)); final bookInfo = ref.watch(bookInfoProvider(url));
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.primary, // backgroundColor: Theme.of(context).colorScheme.primary,
title: const Text("Openlib"), title: Text(title),
titleTextStyle: Theme.of(context).textTheme.displayLarge, titleSpacing: 0,
// titleTextStyle: Theme.of(context).textTheme.displayLarge,
), ),
body: bookInfo.when( body: bookInfo.when(
data: (data) { data: (data) {
@ -95,21 +98,23 @@ class _ActionButtonWidgetState extends ConsumerState<ActionButtonWidget> {
} else { } else {
return Padding( return Padding(
padding: const EdgeInsets.only(top: 21, bottom: 21), padding: const EdgeInsets.only(top: 21, bottom: 21),
child: TextButton( child: ElevatedButton(
style: TextButton.styleFrom( // style: ElevatedButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.secondary, // // backgroundColor: Theme.of(context).colorScheme.secondary,
textStyle: const TextStyle( // textStyle: const TextStyle(
fontSize: 13, // // fontSize: 13,
fontWeight: FontWeight.w900, // fontWeight: FontWeight.w500,
color: Colors.white, // // color: Colors.white,
)), // )),
onPressed: () async { onPressed: () async {
await downloadFileWidget(ref, context, widget.data); await downloadFileWidget(ref, context, widget.data);
}, },
child: const Padding( child: const Text('Add To My Library',
padding: EdgeInsets.all(8.0), style: TextStyle(
child: Text('Add To My Library'), fontSize: 14,
), fontWeight: FontWeight.w400,
// color: Colors.white,
)),
), ),
); );
} }
@ -190,111 +195,33 @@ class _ShowDialog extends ConsumerWidget {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
return Stack( return AlertDialog(
alignment: Alignment.center, title: const Text("Downloading Book"),
children: [ content: Column(
Padding( mainAxisSize: MainAxisSize.min,
padding: const EdgeInsets.all(15.0), children: [
child: Container( Text(title),
width: double.infinity, const SizedBox(
height: 255, height: 20,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
),
padding: const EdgeInsets.fromLTRB(20, 20, 20, 20),
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Padding(
padding: EdgeInsets.all(8),
child: Text(
"Downloading Book",
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 54, 54, 54),
decoration: TextDecoration.none),
),
),
Padding(
padding: const EdgeInsets.all(8),
child: Text(
title,
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.bold,
color: Colors.black54,
decoration: TextDecoration.none),
overflow: TextOverflow.ellipsis,
maxLines: 2,
textAlign: TextAlign.start,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.all(8),
child: Text(
'$downloadedFileSize/$fileSize',
style: TextStyle(
fontSize: 9,
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.secondary,
decoration: TextDecoration.none,
letterSpacing: 1),
overflow: TextOverflow.ellipsis,
maxLines: 1,
textAlign: TextAlign.start,
),
),
],
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(50)),
child: LinearProgressIndicator(
color: Theme.of(context).colorScheme.secondary,
backgroundColor: Colors.black26,
value: downloadProgress,
minHeight: 4,
),
),
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
style: TextButton.styleFrom(
backgroundColor:
Theme.of(context).colorScheme.secondary,
textStyle: const TextStyle(
fontSize: 11,
fontWeight: FontWeight.w900,
color: Colors.white,
)),
onPressed: () {
ref.read(cancelCurrentDownload).cancel();
Navigator.of(context).pop();
},
child: const Padding(
padding: EdgeInsets.all(3.0),
child: Text('Cancel'),
),
)
],
),
)
],
),
),
), ),
LinearProgressIndicator(
value: downloadProgress,
),
const SizedBox(
height: 20,
),
Text(
'$downloadedFileSize/$fileSize',
)
],
),
actions: <Widget>[
TextButton(
onPressed: () {
ref.read(cancelCurrentDownload).cancel();
Navigator.pop(context, 'Cancel');
},
child: const Text('Cancel'),
), ),
], ],
); );

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:openlib/ui/extensions.dart'; import 'package:openlib/ui/extensions.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
// TODO: Redesign this widget
class BookInfoCard extends StatelessWidget { class BookInfoCard extends StatelessWidget {
const BookInfoCard( const BookInfoCard(
{Key? key, {Key? key,
@ -22,26 +23,29 @@ class BookInfoCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return Card(
onTap: onClick, shadowColor: Colors.black.withOpacity(0),
child: Container( margin: const EdgeInsets.only(bottom: 20),
width: double.infinity, shape: RoundedRectangleBorder(
height: 120, borderRadius: BorderRadius.circular(5),
decoration: BoxDecoration( side: BorderSide(
borderRadius: BorderRadius.circular(5), color: Theme.of(context).colorScheme.surfaceVariant,
color: Theme.of(context).colorScheme.tertiaryContainer, width: 1,
), ),
margin: const EdgeInsets.only(bottom: 10), ),
child: InkWell(
onTap: onClick,
borderRadius: BorderRadius.circular(5),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
CachedNetworkImage( CachedNetworkImage(
height: 120, height: 140,
width: 90, width: 105,
imageUrl: thumbnail ?? "", imageUrl: thumbnail ?? "",
imageBuilder: (context, imageProvider) => Container( imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(5)), borderRadius: BorderRadius.circular(5),
image: DecorationImage( image: DecorationImage(
image: imageProvider, image: imageProvider,
fit: BoxFit.fill, fit: BoxFit.fill,
@ -51,7 +55,7 @@ class BookInfoCard extends StatelessWidget {
placeholder: (context, url) => Container( placeholder: (context, url) => Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
color: "#F8C0C8".toColor(), color: Theme.of(context).colorScheme.surfaceVariant,
), ),
height: 120, height: 120,
width: 90, width: 90,
@ -60,7 +64,7 @@ class BookInfoCard extends StatelessWidget {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
color: "#F8C0C8".toColor(), color: Theme.of(context).colorScheme.surfaceVariant,
), ),
height: 120, height: 120,
width: 90, width: 90,
@ -72,7 +76,7 @@ class BookInfoCard extends StatelessWidget {
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.all(5), padding: const EdgeInsets.all(18),
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
child: Column( child: Column(
@ -82,29 +86,33 @@ class BookInfoCard extends StatelessWidget {
Text( Text(
title, title,
style: const TextStyle( style: const TextStyle(
fontSize: 15, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, // color: Colors.black,
), ),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
), ),
Text( Padding(
publisher, padding: const EdgeInsets.symmetric(vertical: 4),
style: TextStyle( child: Text(
fontSize: 12, publisher,
fontWeight: FontWeight.bold, style: const TextStyle(
color: "#4D4D4D".toColor(), fontSize: 12,
fontWeight: FontWeight.w500,
// color: "#4D4D4D".toColor(),
),
overflow: TextOverflow.ellipsis,
maxLines: 1,
), ),
overflow: TextOverflow.ellipsis,
maxLines: 1,
), ),
Text( Text(
author, author,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.w500,
color: "#7B7B7B".toColor(), // color: "#7B7B7B".toColor(),
color: Theme.of(context).colorScheme.onSurfaceVariant,
), ),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,

View File

@ -12,10 +12,10 @@ class BookInfoWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
physics: const BouncingScrollPhysics(), // physics: const BouncingScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 15, right: 15, top: 10), padding: const EdgeInsets.only(left: 20, right: 20, top: 10),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -26,8 +26,8 @@ class BookInfoWidget extends StatelessWidget {
), ),
Center( Center(
child: CachedNetworkImage( child: CachedNetworkImage(
height: 230, height: 240,
width: 170, width: 180,
imageUrl: data.thumbnail, imageUrl: data.thumbnail,
imageBuilder: (context, imageProvider) => Container( imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -43,8 +43,8 @@ class BookInfoWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
color: Colors.grey, color: Colors.grey,
), ),
height: 230, height: 240,
width: 170, width: 180,
), ),
errorWidget: (context, url, error) { errorWidget: (context, url, error) {
return Container( return Container(
@ -63,21 +63,22 @@ class BookInfoWidget extends StatelessWidget {
), ),
_TopPaddedText( _TopPaddedText(
text: data.title, text: data.title,
fontSize: 19, fontSize: 22,
topPadding: 15, topPadding: 15,
color: Colors.black, fontWeight: FontWeight.w600,
// color: Colors.black,
maxLines: 7, maxLines: 7,
), ),
_TopPaddedText( _TopPaddedText(
text: data.publisher ?? "unknown", text: data.publisher ?? "unknown",
fontSize: 15, fontSize: 17,
topPadding: 7, topPadding: 7,
color: "#595E60".toColor(), color: Theme.of(context).colorScheme.onSecondaryContainer,
maxLines: 4, maxLines: 4,
), ),
_TopPaddedText( _TopPaddedText(
text: data.author ?? "unknown", text: data.author ?? "unknown",
fontSize: 13, fontSize: 20,
topPadding: 7, topPadding: 7,
color: "#7F7F7F".toColor(), color: "#7F7F7F".toColor(),
maxLines: 3, maxLines: 3,
@ -91,33 +92,41 @@ class BookInfoWidget extends StatelessWidget {
), ),
// child slot of page // child slot of page
child, child,
Column( Card(
mainAxisAlignment: MainAxisAlignment.start, shape: RoundedRectangleBorder(
crossAxisAlignment: CrossAxisAlignment.start, borderRadius: BorderRadius.circular(15),
children: [ ),
Text( child: SizedBox(
"Description", width: double.infinity,
style: TextStyle( child: Padding(
fontSize: 16, padding: const EdgeInsets.all(20.0),
fontWeight: FontWeight.w900, child: Column(
color: Theme.of(context).colorScheme.tertiary, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Description",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurface,
),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
Padding(
padding: const EdgeInsets.only(top: 15, bottom: 10),
child: Text(
data.description ?? "",
style: const TextStyle(
fontSize: 16,
),
),
)
],
), ),
overflow: TextOverflow.ellipsis,
maxLines: 1,
), ),
Padding( ),
padding: const EdgeInsets.only(top: 7, bottom: 10),
child: Text(
data.description ?? "",
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.bold,
color: "#6B6B6B".toColor(),
letterSpacing: 1.5,
),
),
)
],
) )
], ],
), ),
@ -130,14 +139,16 @@ class _TopPaddedText extends StatelessWidget {
final String text; final String text;
final double fontSize; final double fontSize;
final double topPadding; final double topPadding;
final Color color; final Color? color;
final int maxLines; final int maxLines;
final FontWeight fontWeight;
const _TopPaddedText( const _TopPaddedText(
{required this.text, {required this.text,
required this.fontSize, required this.fontSize,
required this.topPadding, required this.topPadding,
required this.color, this.color,
this.fontWeight = FontWeight.w400,
required this.maxLines, required this.maxLines,
Key? key}) Key? key})
: super(key: key); : super(key: key);
@ -150,9 +161,9 @@ class _TopPaddedText extends StatelessWidget {
text, text,
style: TextStyle( style: TextStyle(
fontSize: fontSize, fontSize: fontSize,
fontWeight: FontWeight.w900, fontWeight: fontWeight,
color: color, color: color,
letterSpacing: 0.5, // letterSpacing: 0.5,
), ),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: maxLines, maxLines: maxLines,

View File

@ -16,117 +16,28 @@ class ShowDeleteDialog extends ConsumerWidget {
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
return Stack( // if (false) {
alignment: Alignment.center, // return
children: [ // }
Padding(
padding: const EdgeInsets.all(15.0),
child: Container(
width: double.infinity,
height: 219,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
),
padding: const EdgeInsets.fromLTRB(20, 50, 20, 20),
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Padding(
padding: EdgeInsets.all(8),
child: Text(
"Delete Book",
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 54, 54, 54),
decoration: TextDecoration.none),
),
),
const Padding(
padding: EdgeInsets.all(8),
child: Text(
"This is permanent and cannot be undone",
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.bold,
color: Colors.black54,
decoration: TextDecoration.none),
overflow: TextOverflow.ellipsis,
maxLines: 2,
textAlign: TextAlign.start,
),
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
style: ButtonStyle(
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50.0),
side: BorderSide(
width: 3,
color: Theme.of(context)
.colorScheme
.secondary),
),
),
),
onPressed: () {
ref.read(deleteFileFromMyLib(
FileName(md5: id, format: format)));
Navigator.of(context).pop();
showSnackBar( return AlertDialog(
context: context, title: const Text("Delete Book?"),
message: 'Book has been Deleted!'); content: const Text("This is permanent and cannot be undone"),
actions: <Widget>[
TextButton(
onPressed: () {
ref.read(deleteFileFromMyLib(FileName(md5: id, format: format)));
Navigator.of(context).pop();
onDelete(); showSnackBar(context: context, message: 'Book has been Deleted!');
},
child: const Padding( onDelete();
padding: EdgeInsets.all(5.0), },
child: Text( child: const Text('Delete'),
'Delete', ),
style: TextStyle( TextButton(
fontSize: 11, onPressed: () => Navigator.pop(context, 'Cancel'),
fontWeight: FontWeight.bold, child: const Text('Cancel'),
color: Colors.black,
),
),
),
),
const SizedBox(
width: 10,
),
TextButton(
style: TextButton.styleFrom(
backgroundColor:
Theme.of(context).colorScheme.secondary,
textStyle: const TextStyle(
fontSize: 11,
fontWeight: FontWeight.w900,
color: Colors.white,
)),
onPressed: () {
Navigator.of(context).pop();
},
child: const Padding(
padding: EdgeInsets.all(5.0),
child: Text('Cancel'),
),
)
],
),
)
],
),
),
),
), ),
], ],
); );

View File

@ -24,7 +24,7 @@ class FileOpenAndDeleteButtons extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
TextButton( FilledButton(
style: TextButton.styleFrom( style: TextButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.secondary, backgroundColor: Theme.of(context).colorScheme.secondary,
textStyle: const TextStyle( textStyle: const TextStyle(
@ -60,7 +60,7 @@ class FileOpenAndDeleteButtons extends StatelessWidget {
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
TextButton( OutlinedButton(
style: ButtonStyle( style: ButtonStyle(
shape: MaterialStateProperty.all( shape: MaterialStateProperty.all(
RoundedRectangleBorder( RoundedRectangleBorder(
@ -82,14 +82,14 @@ class FileOpenAndDeleteButtons extends StatelessWidget {
); );
}); });
}, },
child: const Padding( child: Padding(
padding: EdgeInsets.all(5.3), padding: const EdgeInsets.all(5.3),
child: Text( child: Text(
'Delete', 'Delete',
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Theme.of(context).colorScheme.onSurface,
), ),
), ),
), ),

View File

@ -7,13 +7,13 @@ class TitleText extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Padding(
padding: const EdgeInsets.only(left: 10, bottom: 7), padding: const EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 10),
child: Text( child: Text(
text, text,
style: TextStyle( style: const TextStyle(
fontSize: 19, fontSize: 25,
fontWeight: FontWeight.bold, fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.secondary, // color: Theme.of(context).colorScheme.onInverseSurface,
), ),
), ),
); );

View File

@ -5,14 +5,14 @@ void showSnackBar({required BuildContext context, required String message}) {
content: Text( content: Text(
message, message,
style: const TextStyle( style: const TextStyle(
fontSize: 11, fontSize: 12,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
color: Colors.white, // color: Colors.white,
), ),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
// ignore: use_build_context_synchronously // ignore: use_build_context_synchronously
backgroundColor: Theme.of(context).colorScheme.secondary, // backgroundColor: Theme.of(context).colorScheme.secondary,
width: 300, width: 300,
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(50))), borderRadius: BorderRadius.all(Radius.circular(50))),

View File

@ -24,18 +24,18 @@ class _EpubViewState extends ConsumerState<EpubViewerWidget> {
}, error: (error, stack) { }, error: (error, stack) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.primary, // backgroundColor: Theme.of(context).colorScheme.primary,
title: const Text("Openlib"), title: const Text("Openlib"),
titleTextStyle: Theme.of(context).textTheme.displayLarge, // titleTextStyle: Theme.of(context).textTheme.displayLarge,
), ),
body: Center(child: Text(error.toString())), body: Center(child: Text(error.toString())),
); );
}, loading: () { }, loading: () {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.primary, // backgroundColor: Theme.of(context).colorScheme.primary,
title: const Text("Openlib"), title: const Text("Openlib"),
titleTextStyle: Theme.of(context).textTheme.displayLarge, // titleTextStyle: Theme.of(context).textTheme.displayLarge,
), ),
body: Center( body: Center(
child: SizedBox( child: SizedBox(
@ -94,9 +94,10 @@ class _EpubViewerState extends ConsumerState<EpubViewer> {
final position = ref.watch(getBookPosition(widget.fileName)); final position = ref.watch(getBookPosition(widget.fileName));
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.primary, // backgroundColor: Theme.of(context).colorScheme.primary,
title: const Text("Openlib"), title: const Text("Openlib"),
titleTextStyle: Theme.of(context).textTheme.displayLarge, titleSpacing: 0,
// titleTextStyle: Theme.of(context).textTheme.displayLarge,
), ),
endDrawer: Drawer( endDrawer: Drawer(
child: EpubViewTableOfContents(controller: _epubReaderController), child: EpubViewTableOfContents(controller: _epubReaderController),

View File

@ -7,17 +7,18 @@ import 'package:openlib/ui/components/book_info_widget.dart';
import 'package:openlib/ui/components/file_buttons_widget.dart'; import 'package:openlib/ui/components/file_buttons_widget.dart';
class BookPage extends StatelessWidget { class BookPage extends StatelessWidget {
const BookPage({Key? key, required this.id}) : super(key: key); const BookPage({Key? key, required this.id, required this.title})
: super(key: key);
final String id; final String id;
final String title;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.primary, title: Text(title),
title: const Text("Openlib"), titleSpacing: 0,
titleTextStyle: Theme.of(context).textTheme.displayLarge,
), ),
body: Consumer( body: Consumer(
builder: (BuildContext context, WidgetRef ref, _) { builder: (BuildContext context, WidgetRef ref, _) {
@ -42,12 +43,8 @@ class BookPage extends StatelessWidget {
); );
} else { } else {
return Center( return Center(
child: SizedBox( child: CircularProgressIndicator(
width: 25, color: Theme.of(context).colorScheme.secondary,
height: 25,
child: CircularProgressIndicator(
color: Theme.of(context).colorScheme.secondary,
),
)); ));
} }
}); });

View File

@ -38,7 +38,7 @@ class MyLibraryPage extends ConsumerWidget {
onClick: () { onClick: () {
Navigator.push(context, MaterialPageRoute( Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) { builder: (BuildContext context) {
return BookPage(id: i.id); return BookPage(id: i.id, title: i.title);
})); }));
})) }))
.toList()), .toList()),
@ -81,12 +81,8 @@ class MyLibraryPage extends ConsumerWidget {
}, },
loading: () { loading: () {
return Center( return Center(
child: SizedBox( child: CircularProgressIndicator(
width: 25, color: Theme.of(context).colorScheme.secondary,
height: 25,
child: CircularProgressIndicator(
color: Theme.of(context).colorScheme.secondary,
),
)); ));
}, },
); );

View File

@ -38,9 +38,9 @@ class _PdfViewState extends ConsumerState<PdfView> {
}, loading: () { }, loading: () {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.primary, // backgroundColor: Theme.of(context).colorScheme.primary,
title: const Text("Openlib"), title: const Text("Openlib"),
titleTextStyle: Theme.of(context).textTheme.displayLarge, // titleTextStyle: Theme.of(context).textTheme.displayLarge,
), ),
body: Center( body: Center(
child: SizedBox( child: SizedBox(
@ -111,9 +111,10 @@ class _PdfViewerState extends ConsumerState<PdfViewer> {
final totalPages = ref.watch(totalPdfPage); final totalPages = ref.watch(totalPdfPage);
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.primary, // backgroundColor: Theme.of(context).colorScheme.primary,
title: const Text("Openlib"), title: const Text("Openlib"),
titleTextStyle: Theme.of(context).textTheme.displayLarge, titleSpacing: 0,
// titleTextStyle: Theme.of(context).textTheme.displayLarge,
actions: isMobile actions: isMobile
? [ ? [
IconButton( IconButton(
@ -186,12 +187,8 @@ class _PdfViewerState extends ConsumerState<PdfViewer> {
}, },
loading: () { loading: () {
return Center( return Center(
child: SizedBox( child: CircularProgressIndicator(
width: 25, color: Theme.of(context).colorScheme.secondary,
height: 25,
child: CircularProgressIndicator(
color: Theme.of(context).colorScheme.secondary,
),
)); ));
}, },
) )

View File

@ -23,22 +23,30 @@ class ResultPage extends ConsumerWidget {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.primary, // backgroundColor: Theme.of(context).colorScheme.primary,
title: const Text("Openlib"), title: const Text(
titleTextStyle: Theme.of(context).textTheme.displayLarge, "Results",
style: TextStyle(fontWeight: FontWeight.w500),
),
titleSpacing: 0,
// titleTextStyle: Theme.of(context).textTheme.displayLarge,
), ),
body: searchBooks.when( body: searchBooks.when(
data: (data) { data: (data) {
if (data.isNotEmpty) { if (data.isNotEmpty) {
return Padding( return Padding(
padding: const EdgeInsets.only(left: 5, right: 5, top: 10), padding: const EdgeInsets.only(
left: 5,
right: 5,
),
child: CustomScrollView( child: CustomScrollView(
slivers: <Widget>[ slivers: <Widget>[
const SliverToBoxAdapter( // const SliverToBoxAdapter(
child: TitleText("Results"), // child: TitleText("Results"),
), // ),
SliverPadding( SliverPadding(
padding: const EdgeInsets.only(left: 5, right: 5, top: 10), padding: const EdgeInsets.only(left: 5, right: 5, top: 15),
sliver: SliverList( sliver: SliverList(
delegate: SliverChildListDelegate(data delegate: SliverChildListDelegate(data
.map((i) => BookInfoCard( .map((i) => BookInfoCard(
@ -50,7 +58,8 @@ class ResultPage extends ConsumerWidget {
onClick: () { onClick: () {
Navigator.push(context, MaterialPageRoute( Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) { builder: (BuildContext context) {
return BookInfoPage(url: i.link); return BookInfoPage(
url: i.link, title: i.title);
})); }));
}, },
)) ))
@ -103,22 +112,14 @@ class ResultPage extends ConsumerWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const Padding(
padding: EdgeInsets.only(left: 5, right: 5, top: 10),
child: TitleText("Results"),
),
Expanded( Expanded(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Center( Center(
child: SizedBox( child: CircularProgressIndicator(
width: 25, color: Theme.of(context).colorScheme.secondary,
height: 25,
child: CircularProgressIndicator(
color: Theme.of(context).colorScheme.secondary,
),
)) ))
], ],
), ),

View File

@ -39,19 +39,23 @@ class SearchPage extends ConsumerWidget {
padding: const EdgeInsets.only(left: 7, right: 7, top: 10), padding: const EdgeInsets.only(left: 7, right: 7, top: 10),
child: TextField( child: TextField(
showCursor: true, showCursor: true,
cursorColor: Theme.of(context).colorScheme.secondary, // cursorColor: Theme.of(context).colorScheme.secondary,
decoration: InputDecoration( decoration: InputDecoration(
enabledBorder: const OutlineInputBorder( label: const Text("Search"),
borderSide: BorderSide(color: Colors.black45, width: 2), enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(50)), borderSide: BorderSide(
color: Theme.of(context).colorScheme.outline, width: 2),
borderRadius: const BorderRadius.all(Radius.circular(50)),
), ),
focusedBorder: const OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black54, width: 2), borderSide: BorderSide(
borderRadius: BorderRadius.all(Radius.circular(50)), color: Theme.of(context).colorScheme.outline, width: 2),
borderRadius: const BorderRadius.all(Radius.circular(50)),
), ),
suffixIcon: IconButton( suffixIcon: IconButton(
padding: const EdgeInsets.only(right: 5), padding: const EdgeInsets.only(right: 10),
color: Theme.of(context).colorScheme.secondary, // color: Theme.of(context).colorScheme.secondary,
icon: const Icon( icon: const Icon(
Icons.search, Icons.search,
size: 23, size: 23,
@ -59,16 +63,16 @@ class SearchPage extends ConsumerWidget {
onPressed: () => onSubmit(context, ref), onPressed: () => onSubmit(context, ref),
), ),
filled: true, filled: true,
hintStyle: const TextStyle( // hintStyle: const TextStyle(
color: Colors.grey, fontWeight: FontWeight.bold), // color: Colors.grey, fontWeight: FontWeight.bold),
hintText: "Search", hintText: "Search books ,author or ISBN",
fillColor: Theme.of(context).colorScheme.primary, // fillColor: Theme.of(context).colorScheme.primary,
), ),
onSubmitted: (String value) => onSubmit(context, ref), onSubmitted: (String value) => onSubmit(context, ref),
style: TextStyle( style: const TextStyle(
color: Theme.of(context).colorScheme.tertiary, // color: Theme.of(context).colorScheme.tertiary,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 14,
), ),
onChanged: (String value) { onChanged: (String value) {
ref.read(searchQueryProvider.notifier).state = value; ref.read(searchQueryProvider.notifier).state = value;
@ -83,17 +87,21 @@ class SearchPage extends ConsumerWidget {
decoration: InputDecoration( decoration: InputDecoration(
labelText: 'Type', labelText: 'Type',
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: 11, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.secondary, color: Theme.of(context).colorScheme.secondary,
), ),
enabledBorder: const OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black54, width: 2), borderSide: BorderSide(
borderRadius: BorderRadius.all(Radius.circular(50)), color: Theme.of(context).colorScheme.outline,
width: 2),
borderRadius: const BorderRadius.all(Radius.circular(50)),
), ),
focusedBorder: const OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black54, width: 2), borderSide: BorderSide(
borderRadius: BorderRadius.all(Radius.circular(50)), color: Theme.of(context).colorScheme.outline,
width: 2),
borderRadius: const BorderRadius.all(Radius.circular(50)),
), ),
), ),
icon: const Icon(Icons.arrow_drop_down), icon: const Icon(Icons.arrow_drop_down),
@ -105,7 +113,7 @@ class SearchPage extends ConsumerWidget {
value: value, value: value,
child: Text( child: Text(
value, value,
style: const TextStyle(fontSize: 12), style: const TextStyle(fontSize: 14),
), ),
); );
}).toList(), }).toList(),
@ -123,17 +131,21 @@ class SearchPage extends ConsumerWidget {
decoration: InputDecoration( decoration: InputDecoration(
labelText: 'Sort by', labelText: 'Sort by',
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: 11, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.secondary, color: Theme.of(context).colorScheme.secondary,
), ),
enabledBorder: const OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black45, width: 2), borderSide: BorderSide(
borderRadius: BorderRadius.all(Radius.circular(50)), color: Theme.of(context).colorScheme.outline,
width: 2),
borderRadius: const BorderRadius.all(Radius.circular(50)),
), ),
focusedBorder: const OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black54, width: 2), borderSide: BorderSide(
borderRadius: BorderRadius.all(Radius.circular(50)), color: Theme.of(context).colorScheme.outline,
width: 2),
borderRadius: const BorderRadius.all(Radius.circular(50)),
), ),
), ),
value: dropdownSortValue, value: dropdownSortValue,
@ -144,7 +156,7 @@ class SearchPage extends ConsumerWidget {
value: value, value: value,
child: Text( child: Text(
value, value,
style: const TextStyle(fontSize: 12), style: const TextStyle(fontSize: 14),
), ),
); );
}).toList(), }).toList(),
@ -153,7 +165,7 @@ class SearchPage extends ConsumerWidget {
}, },
), ),
), ),
) ),
], ],
), ),
), ),

View File

@ -19,7 +19,7 @@ class TrendingPage extends ConsumerWidget {
final trendingBooks = ref.watch(getTrendingBooks); final trendingBooks = ref.watch(getTrendingBooks);
return trendingBooks.when(data: (data) { return trendingBooks.when(data: (data) {
return Padding( return Padding(
padding: const EdgeInsets.only(left: 5, right: 5, top: 10), padding: const EdgeInsets.only(left: 5, right: 5, top: 0),
child: CustomScrollView( child: CustomScrollView(
slivers: [ slivers: [
const SliverToBoxAdapter( const SliverToBoxAdapter(
@ -37,6 +37,7 @@ class TrendingPage extends ConsumerWidget {
delegate: SliverChildBuilderDelegate( delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) { (BuildContext context, int index) {
return InkWell( return InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(context,
MaterialPageRoute(builder: (BuildContext context) { MaterialPageRoute(builder: (BuildContext context) {
@ -45,72 +46,66 @@ class TrendingPage extends ConsumerWidget {
); );
})); }));
}, },
child: Container( child: Column(
width: double.infinity, mainAxisAlignment: MainAxisAlignment.start,
height: double.infinity, crossAxisAlignment: CrossAxisAlignment.center,
color: const Color.fromARGB(255, 255, 255, 255), children: [
child: Column( CachedNetworkImage(
mainAxisAlignment: MainAxisAlignment.start, height: imageHeight,
crossAxisAlignment: CrossAxisAlignment.center, width: imageWidth,
children: [ imageUrl: data[index].thumbnail!,
CachedNetworkImage( imageBuilder: (context, imageProvider) =>
height: imageHeight, Container(
width: imageWidth, decoration: BoxDecoration(
imageUrl: data[index].thumbnail!, borderRadius: const BorderRadius.all(
imageBuilder: (context, imageProvider) => Radius.circular(5)),
Container( image: DecorationImage(
decoration: BoxDecoration( image: imageProvider,
boxShadow: const [ fit: BoxFit.fill,
BoxShadow(
color: Colors.grey,
spreadRadius: 0.1,
blurRadius: 1)
],
borderRadius: const BorderRadius.all(
Radius.circular(5)),
image: DecorationImage(
image: imageProvider,
fit: BoxFit.fill,
),
), ),
), ),
placeholder: (context, url) => Container( ),
placeholder: (context, url) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
// color: "#E3E8E9".toColor(),
color: Theme.of(context)
.colorScheme
.surfaceVariant,
),
height: imageHeight,
width: imageWidth,
),
errorWidget: (context, url, error) {
return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
color: "#E3E8E9".toColor(), color: Theme.of(context)
.colorScheme
.surfaceVariant,
), ),
height: imageHeight, height: imageHeight,
width: imageWidth, width: imageWidth,
), child: const Center(
errorWidget: (context, url, error) { child: Icon(Icons.image_rounded),
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: Colors.grey,
),
height: imageHeight,
width: imageWidth,
child: const Center(
child: Icon(Icons.image_rounded),
),
);
},
),
Padding(
padding: const EdgeInsets.only(top: 4),
child: SizedBox(
width: imageWidth,
child: Text(
data[index].title!,
style: Theme.of(context)
.textTheme
.displayMedium,
maxLines: 2,
), ),
);
},
),
Padding(
padding: const EdgeInsets.only(top: 8),
child: SizedBox(
width: imageWidth,
child: Text(
data[index].title!,
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w400),
maxLines: 2,
), ),
), ),
]), ),
), ]),
); );
}, },
childCount: data.length, childCount: data.length,
@ -130,13 +125,13 @@ class TrendingPage extends ConsumerWidget {
}, },
); );
}, loading: () { }, loading: () {
return Center( return const Center(
child: SizedBox( child: SizedBox(
width: 25, width: 25,
height: 25, height: 25,
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: Theme.of(context).colorScheme.secondary, // color: Theme.of(context).colorScheme.secondary,
), ),
)); ));
}); });
} }

View File

@ -6,9 +6,13 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <dynamic_color/dynamic_color_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h> #include <url_launcher_linux/url_launcher_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);

View File

@ -3,6 +3,7 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
dynamic_color
url_launcher_linux url_launcher_linux
) )

View File

@ -5,11 +5,13 @@
import FlutterMacOS import FlutterMacOS
import Foundation import Foundation
import dynamic_color
import path_provider_foundation import path_provider_foundation
import sqflite import sqflite
import url_launcher_macos import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))

View File

@ -145,6 +145,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.3.0" version: "5.3.0"
dynamic_color:
dependency: "direct main"
description:
name: dynamic_color
sha256: de4798a7069121aee12d5895315680258415de9b00e717723a1bd73d58f0126d
url: "https://pub.dev"
source: hosted
version: "1.6.6"
epub_view: epub_view:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -56,6 +56,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
dev: ^1.0.0 dev: ^1.0.0
dynamic_color: ^1.6.6
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

View File

@ -6,9 +6,12 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <dynamic_color/dynamic_color_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h> #include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
DynamicColorPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar( UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows")); registry->GetRegistrarForPlugin("UrlLauncherWindows"));
} }

View File

@ -3,6 +3,7 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
dynamic_color
url_launcher_windows url_launcher_windows
) )