mirror of
https://github.com/hackku21/loc-chain-app.git
synced 2024-10-27 20:34:05 +00:00
28 lines
721 B
Dart
28 lines
721 B
Dart
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 userName = prefs.getString('userName') ?? '0';
|
|
if (userName == '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(),
|
|
);
|
|
}
|
|
}
|