Skip to content

Commit

Permalink
Merge branch 'main' into botnav
Browse files Browse the repository at this point in the history
  • Loading branch information
Debajyoti14 authored Jun 4, 2023
2 parents 0da671d + e3d48c5 commit 5ec9d8e
Show file tree
Hide file tree
Showing 34 changed files with 886 additions and 397 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") ?? [];
}
}
6 changes: 5 additions & 1 deletion lib/data/widget_category.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,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 5ec9d8e

Please sign in to comment.