sense_flutter_plugin 0.0.1
sense_flutter_plugin: ^0.0.1 copied to clipboard
Sense is a device intelligence and identification tool. This tool collects a comprehensive set of attributes unique to a device or browser, forming an identity that will help businesses.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'passiveSignal.dart';
import 'rawData.dart';
import 'webviewscreen.dart';
import 'home_page.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const BottomNavigation(),
);
}
}
class BottomNavigation extends StatefulWidget {
const BottomNavigation({super.key});
@override
// ignore: library_private_types_in_public_api
_BottomNavigationState createState() => _BottomNavigationState();
}
class _BottomNavigationState extends State<BottomNavigation> {
int _selectedIndex = 0; // Track the currently selected tab index
// List of widgets representing the content of each tab
final List<Widget> _pages = [
HomePage(),
PassiveSignal(requestId: ''),
Rawdata(requestId: '')
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: _pages[_selectedIndex],
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType
.fixed, // Prevent shifting on more than 3 items
items: const [
BottomNavigationBarItem(
icon: ImageIcon(AssetImage("assets/images/home-line.png")),
label: 'Home',
),
BottomNavigationBarItem(
icon: ImageIcon(AssetImage("assets/images/file-06.png")),
label: 'Documentation',
),
BottomNavigationBarItem(
icon: ImageIcon(AssetImage("assets/images/shield-tick.png")),
label: 'Policy',
),
BottomNavigationBarItem(
icon: ImageIcon(AssetImage("assets/images/life-buoy-01.png")),
label: 'Support',
),
],
onTap: (index) {
switch (index) {
case 0:
setState(() {
_selectedIndex = index;
});
break;
case 1:
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const WebViewScreen(url: 'https://sense.tutelar.io/')),
);
break;
case 2:
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const WebViewScreen(url: 'https://sense.tutelar.io/')),
);
break;
case 3:
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const WebViewScreen(url: 'https://sense.tutelar.io/')),
);
break;
}
},
currentIndex: _selectedIndex, // Set the currently selected tab
// onTap: _onItemTapped, // Handle taps on bottom navigation items
selectedItemColor: const Color(0xFF6941C6), // Color for the selected item
unselectedItemColor: Colors.grey, // Color for unselected items
),
);
}
}