Skip to content

Commit

Permalink
1.1.0 update
Browse files Browse the repository at this point in the history
Update to 1.1.0 and small bug fixes. Enjoy!
  • Loading branch information
GeorgeYT9769 committed Nov 3, 2024
1 parent 4b4e0e1 commit ce76b19
Show file tree
Hide file tree
Showing 14 changed files with 416 additions and 241 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ android {
namespace "com.georgeyt9769.cardabase"
testNamespace "com.georgeyt9769.cardabase.test"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
ndkVersion "25.1.8937393"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
5 changes: 4 additions & 1 deletion fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ Acknowledgments:
By downloading the app you agree:
- To accept the MIT license;
- That the owner, creators, and contributors are not responsible for any hardware, software, emotional, or other damages made by the app. Download and use on your own risk;
- To allow Cardabase use local storage (and camera - optional).
- To allow Cardabase use local storage (and camera - optional).

Note:
- Images might differ from actual app design.
6 changes: 6 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:cardabase/pages/settings.dart';
import 'package:flutter/material.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:cardabase/theme/color_schemes.g.dart';
import 'package:flutter/services.dart';

void main() async {
await Hive.initFlutter();
Expand Down Expand Up @@ -31,6 +32,11 @@ class Main extends StatelessWidget {
themeData = ThemeData(useMaterial3: true, colorScheme: darkColorScheme);
}

SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);

return MaterialApp(
debugShowCheckedModeBanner: false,
home: const Homepage(),
Expand Down
224 changes: 125 additions & 99 deletions lib/pages/createcardnew.dart

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions lib/pages/generate_barcode_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import 'package:cardabase/util/button_tile.dart';
import 'package:flutter/material.dart';
import 'package:barcode_widget/barcode_widget.dart';

class GenerateBarcode extends StatelessWidget {

String cardid;
String cardtext;
Color iconcolor;

GenerateBarcode({super.key, required this.cardid, required this.cardtext, required this.iconcolor});

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface,
appBar: AppBar(
leading: IconButton(icon: Icon(Icons.arrow_back_ios_new, color: Theme.of(context).colorScheme.secondary,), onPressed: () => Navigator.of(context).pop(),),
title: Text(
'Details',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w900,
fontFamily: 'xirod',
letterSpacing: 8,
color: Theme.of(context).colorScheme.tertiary,
)
),
centerTitle: true,
elevation: 0.0,
backgroundColor: Theme.of(context).colorScheme.surface,
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
//FRONT FACE
SizedBox(
height: MediaQuery.of(context).size.width / 1.50, //height of button
width: MediaQuery.of(context).size.width,
child: Container(
margin: const EdgeInsets.all(20),
decoration: BoxDecoration(color: iconcolor, borderRadius: BorderRadius.circular(15)),
child: Center(
child: Wrap(
children: [
Container(
margin: const EdgeInsets.fromLTRB(20, 0, 20, 00),
child: Text(
cardtext,
style: const TextStyle(
fontSize: 50,
fontWeight: FontWeight.bold,
fontFamily: 'Roboto-Regular.ttf',
color: Colors.white,
),
maxLines: 2,
textAlign: TextAlign.center,
),
),
]),
),
)
),
const SizedBox(height: 10,),
//BACK FACE
SizedBox(
height: MediaQuery.of(context).size.width / 1.50, //height of button
width: MediaQuery.of(context).size.width,
child: Container(
padding: const EdgeInsets.all(10),
margin: const EdgeInsets.all(20),
decoration: BoxDecoration(color: iconcolor, borderRadius: BorderRadius.circular(15)),
child: Container(
height: 120,
padding: const EdgeInsets.all(15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: Colors.white),
child: BarcodeWidget(
padding: const EdgeInsets.all(5),
data: cardid,
barcode: Barcode.ean13(drawEndChar: true),
drawText: true,
style: const TextStyle(color: Colors.black),
),
),
)
),
const SizedBox(height: 30,),
ButtonTile(buttonText: 'DONE', buttonAction: () => Navigator.pop(context)),
const SizedBox(height: 30,),
]
),
);
}
}
15 changes: 11 additions & 4 deletions lib/pages/homepage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,17 @@ class _HomePageState extends State<Homepage> {
elevation: 0.0,
backgroundColor: Theme.of(context).colorScheme.surface,
),
floatingActionButton: FloatingActionButton( //createNewCard
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => const CreateCard()), ).then((value) => setState(() {}));},
child: const Icon(Icons.add_card),
//createNewCard
floatingActionButton: Container(
height: 70,
width: 70,
child: FittedBox(
child: FloatingActionButton(
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => const CreateCard()), ).then((value) => setState(() {}));},
child: const Icon(Icons.add_card),
),
),
),
body:
ListView.builder(
Expand Down
43 changes: 42 additions & 1 deletion lib/pages/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,47 @@ class _SettingsState extends State<Settings> {

body: ListView(
children: [
Container(
margin: const EdgeInsets.only(top: 10, left: 20),
child: const Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'App Settings',
style: TextStyle(
fontWeight: FontWeight.bold,
fontFamily: 'Roboto-Regular.ttf',
fontSize: 23,
),
),
],
),
),
MySetting(
aboutSettingHeader:
'Switches theme between dark blue and white',
'Switches theme between blue and white',
settingAction: switchTheme, //() => Provider.of<ThemeProvider>(context, listen: false).toggleTheme()
settingHeader: 'Switch theme',
settingIcon: Icons.palette
),
Container(
margin: const EdgeInsets.only(top: 20, left: 20,),
child: const Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Social Networks',
style: TextStyle(
fontWeight: FontWeight.bold,
fontFamily: 'Roboto-Regular.ttf',
fontSize: 23,
),
),
],
),
),
MySetting(
aboutSettingHeader:
'Visit website for this project',
Expand All @@ -93,6 +127,13 @@ class _SettingsState extends State<Settings> {
settingAction: () => _launchUrl(Uri.parse('https://github.com/GeorgeYT9769/cardabase-app')),
settingHeader: 'GitHub',
settingIcon: Icons.code
),
MySetting(
aboutSettingHeader:
'Visit F-Droid page of this project',
settingAction: () => _launchUrl(Uri.parse('https://f-droid.org/en/packages/com.georgeyt9769.cardabase/')),
settingHeader: 'F-Droid',
settingIcon: Icons.store
)
],
),
Expand Down
36 changes: 36 additions & 0 deletions lib/util/button_tile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'package:flutter/material.dart';
import 'package:flutter_bounceable/flutter_bounceable.dart';

class ButtonTile extends StatelessWidget {

final String buttonText;
final buttonAction;


const ButtonTile({super.key, required this.buttonText, required this.buttonAction});

@override
Widget build(BuildContext context) {
return Bounceable(
onTap: () {},
child: Container(
margin: const EdgeInsets.all(20),
alignment: Alignment.center,
child: OutlinedButton(
style: OutlinedButton.styleFrom(
padding: const EdgeInsets.all(15),
side: BorderSide(color: Theme.of(context).colorScheme.primary, width: 2),
backgroundColor: Colors.transparent,
elevation: 0.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
minimumSize: const Size.fromHeight(65),
),
onPressed: buttonAction,
child: Text(buttonText, style: TextStyle(color: Theme.of(context).colorScheme.tertiary, fontSize: 20, fontFamily: 'Roboto-Regular.ttf',)),
)
),
);
}
}
35 changes: 17 additions & 18 deletions lib/util/card_tile.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:cardabase/util/generate_barcode.dart';
import 'package:cardabase/pages/generate_barcode_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bounceable/flutter_bounceable.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
Expand All @@ -17,23 +17,24 @@ class CardTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.all(30),
margin: const EdgeInsets.all(20),
alignment: Alignment.center,
child: Slidable(
endActionPane: ActionPane(
motion: const BehindMotion(),
children: [
SlidableAction(onPressed: deleteFunction,
borderRadius: BorderRadius.circular(15),
icon: Icons.delete,
backgroundColor: Colors.red.shade700,
label: 'Delete card',
label: 'DELETE',
),
],
),
child: Bounceable(
onTap: () {},
child: SizedBox(
height: MediaQuery.of(context).size.width / 1.59 - 30, //height of button
height: MediaQuery.of(context).size.width / 1.585 - 30, //height of button
width: double.infinity,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
Expand All @@ -44,20 +45,18 @@ class CardTile extends StatelessWidget {
borderRadius: BorderRadius.circular(15)
),
),
onPressed: () {
showDialog(
context: context,
builder: (context) {
return GenerateQR(cardid: cardnumber, sn: shopName, iconcolor: iconColor,);
}
)
;
},
child: Text(shopName, style: const TextStyle(
fontSize: 50,
fontWeight: FontWeight.bold,
fontFamily: 'Roboto-Regular.ttf',
),),
onPressed:() {
Navigator.push(context, MaterialPageRoute(builder: (context) => GenerateBarcode(cardid: cardnumber, cardtext: shopName, iconcolor: iconColor)));},
child: Text(
shopName,
style: const TextStyle(
fontSize: 50,
fontWeight: FontWeight.bold,
fontFamily: 'Roboto-Regular.ttf',
),
textAlign: TextAlign.center,
maxLines: 2,
),
)
),
),
Expand Down
45 changes: 33 additions & 12 deletions lib/util/color_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,50 @@ class ColorPickerSecondDialog extends StatefulWidget {
_ColorPickerSecondDialogState();
}

class _ColorPickerSecondDialogState extends State<ColorPickerSecondDialog> with ChangeNotifier {
class _ColorPickerSecondDialogState extends State<ColorPickerSecondDialog> {
Color? currentColor;

@override
void initState() {
super.initState();
currentColor = widget.cardColor; // Initialize the local color variable
}

@override
void dispose() {
super.dispose(); // Call super.dispose() to ensure proper cleanup
}

@override
Widget build(BuildContext context) {
return AlertDialog(
backgroundColor: Theme.of(context).colorScheme.background,
title: const Text('Pick a color!', style: TextStyle(fontFamily: 'Roboto-Regular.ttf',),),
title: const Text(
'Pick a color!',
style: TextStyle(fontFamily: 'Roboto-Regular.ttf'),
),
content: SingleChildScrollView(
child: ColorPicker(
enableAlpha: false,
pickerColor: widget.cardColor,
portraitOnly: true,
onColorChanged: (value) {
child: ColorPicker(
enableAlpha: false,
pickerColor: currentColor!,
portraitOnly: true,
onColorChanged: (value) {
if (mounted) { // Check if the widget is still mounted
setState(() {
widget.cardColor = value;
currentColor = value; // Update the local color variable
});
},
)),
}
},
),
),
actions: <Widget>[
ElevatedButton(
child: const Text('Got it', style: TextStyle(fontFamily: 'Roboto-Regular.ttf',),),
child: const Text(
'Got it',
style: TextStyle(fontFamily: 'Roboto-Regular.ttf'),
),
onPressed: () {
Navigator.pop(context, widget.cardColor);
Navigator.pop(context, currentColor); // Pass the current color
},
),
],
Expand Down
Loading

0 comments on commit ce76b19

Please sign in to comment.