Skip to content

Commit

Permalink
Merge branch 'main' into labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhishikesh12 authored Jun 4, 2023
2 parents 9ba360e + a540c91 commit 04e368e
Show file tree
Hide file tree
Showing 41 changed files with 1,874 additions and 372 deletions.
12 changes: 12 additions & 0 deletions lib/data/hive_database.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:hive/hive.dart';

class HiveDatabase {
final _myDatabase = Hive.box("favorites_database");
void saveData(List<int> favs) {
_myDatabase.put("Favs", favs);
}

List<int> readData() {
return _myDatabase.get("Favs") ?? [];
}
}
9 changes: 7 additions & 2 deletions lib/data/widget_category.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:flutter_component_ui/ui_components/pricing_cards/pricing_cards.d
import 'package:flutter_component_ui/ui_components/segmented_controls/segmented_control_screen.dart';
import 'package:flutter_component_ui/ui_components/steppers/steppers.dart';


import '../ui_components/labels/lables.dart';
import '../ui_components/radios/radios.dart';
import '../ui_components/sliders/sliders.dart';
Expand All @@ -28,7 +29,7 @@ final List<Map<String, dynamic>> widgetCategoryData = [
},
{
'categoryName': 'Bottom Navigation Bars',
'categoryScreen': const AlertScreen(),
'categoryScreen': const BottomNavBarScreen(),
},
{
'categoryName': 'Avatars',
Expand Down Expand Up @@ -64,10 +65,14 @@ final List<Map<String, dynamic>> widgetCategoryData = [
},
{
'categoryName': 'Radio',
'categoryScreen': RadioScreen(),
'categoryScreen': const RadioScreen(),
},
{
'categoryName': 'Stepper',
'categoryScreen': StepperScreen(),
},
// {
// 'categoryName': 'Progress Bars',
// 'categoryScreen': const ProgressBar(),
// },
];
5 changes: 4 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import 'package:flutter/material.dart';
import 'package:flutter_component_ui/provider/favorite_provider.dart';
import 'package:flutter_component_ui/screens/splash_screen.dart';
import 'package:flutter_component_ui/theme/theme.dart';
import 'package:hive_flutter/adapters.dart';
import 'package:provider/provider.dart';

import 'screens/main_page.dart';

void main() {
void main() async {
await Hive.initFlutter();
await Hive.openBox("favorites_database");
runApp(const MyApp());
}

Expand Down
Loading

0 comments on commit 04e368e

Please sign in to comment.