You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
703 B
28 lines
703 B
import 'package:flutter/material.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
import 'package:loc_chain_app/widgets/navbar.dart';
|
|
import 'dart:math';
|
|
|
|
void main() async {
|
|
runApp(App());
|
|
final prefs = await SharedPreferences.getInstance();
|
|
final id = prefs.getString('id') ?? '0';
|
|
if (id == '0') {
|
|
prefs.setString('id', Random().nextInt(10000).toString());
|
|
}
|
|
}
|
|
|
|
class App extends StatelessWidget {
|
|
// This widget is the root of your application.
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Flutter Demo',
|
|
theme: ThemeData(
|
|
primarySwatch: Colors.lightBlue,
|
|
),
|
|
home: NavBarWidget(),
|
|
);
|
|
}
|
|
}
|