userid.dart 338 B

12345678910111213
  1. import 'package:flutter/material.dart';
  2. import 'package:provider/provider.dart';
  3. import 'package:sport/provider/user_model.dart';
  4. mixin UserId<T extends StatefulWidget> on State<T> {
  5. String selfId;
  6. @override
  7. void initState() {
  8. super.initState();
  9. selfId = "${Provider.of<UserModel>(context, listen: false).user.id}";
  10. }
  11. }